[ovs-dev] [PATCH] netdev: Swap transmit and receive stats on internal ports.
Ben Pfaff
blp at nicira.com
Mon Sep 14 16:35:59 UTC 2009
Jesse Gross <jesse at nicira.com> writes:
> + if (dpif && !internal_port) {
> + struct odp_port port;
> +
> + error = dpif_port_query_by_name(dpif, netdev_get_name(&netdev->netdev),
> + &port);
> + if (!error) {
> + internal_port |= port.flags & ODP_PORT_INTERNAL;
> + }
> + }
It's pretty awkward to have to add a dpif parameter to this
function. Not pretty at all.
I think we can avoid it, though. Datapath internal ports can be
identified with the Ethtool operation ETHTOOL_GDRVINFO: the
driver name is "openvswitch". This is what lookup_minor() in
dpif-linux.c does.
When you change this code to do that you should also add a cache
bit for whether a port is internal (VALID_IS_INTERNAL?) and a
cache member to struct netdev_linux_cache (is_internal?), so that
we don't have to check more than once in the common case.
More information about the dev
mailing list