summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-08-05 14:15:32 -0700
committerBen Pfaff <blp@nicira.com>2011-08-08 10:24:24 -0700
commit7b6b0ef47e398a2fbda48fd385f9781b2df8bebb (patch)
treebae52e2382bf61228cee38bb32ddaa3b8345a689 /ofproto
parent8cea3c07718d55c6eea288be87b3ea9e4d3b88cd (diff)
downloadopenvswitch-7b6b0ef47e398a2fbda48fd385f9781b2df8bebb.tar.gz
netdev: Clean up and refactor packet receive interface.
The Open vSwitch tree only has one user of the ability for a netdev to receive packets from a network device. Thus, this commit simplifies the common-case use of the netdev interface by replacing the "ethertype" option from "struct netdev_options" by a new netdev_listen() call. The only user of netdev_listen() wants to receive all packets from a network device, so this commit also removes the ability to restrict the received packets to a particular protocol. (This ability was once used by the Open vSwitch integrated DHCP client, but that code has been removed.) This commit also simplifies and improves the implementation of the code in netdev-linux that started listening to a network device. Before, I had not figured out how to avoid receiving all packets on all devices before binding to a particular device, but I took a closer look at the kernel code and figured it out. I've tested that the userspace datapath (dpif-netdev), the only user of netdev_recv(), still works after this change.
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index f40f99590..8054d05cd 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1115,7 +1115,6 @@ ofport_open(const struct ofproto_port *ofproto_port, struct ofp_phy_port *opp)
memset(&netdev_options, 0, sizeof netdev_options);
netdev_options.name = ofproto_port->name;
netdev_options.type = ofproto_port->type;
- netdev_options.ethertype = NETDEV_ETH_TYPE_NONE;
error = netdev_open(&netdev_options, &netdev);
if (error) {