diff options
author | Jiri Benc <jbenc@redhat.com> | 2018-02-07 07:49:52 -0800 |
---|---|---|
committer | Pravin B Shelar <pshelar@ovn.org> | 2018-02-12 22:39:19 -0800 |
commit | b147f2e9197e0cbb76fbb89513f1907d9ce68155 (patch) | |
tree | 3fdf5ad582d9cd6483cd66cf48f73b84aa3523f1 /datapath/dp_notify.c | |
parent | b68abe0fd9e8c821c25a3ec3cb9a36a5d22b48b9 (diff) | |
download | openvswitch-b147f2e9197e0cbb76fbb89513f1907d9ce68155.tar.gz |
datapath: reliable interface indentification in port dumps
Upstream commit:
commit 9354d452034273a50a4fd703bea31e5d6b1fc20b
Author: Jiri Benc <jbenc@redhat.com>
Date: Thu Nov 2 17:04:37 2017 -0200
openvswitch: reliable interface indentification in port dumps
This patch allows reliable identification of netdevice interfaces connected
to openvswitch bridges. In particular, user space queries the netdev
interfaces belonging to the ports for statistics, up/down state, etc.
Datapath dump needs to provide enough information for the user space to be
able to do that.
Currently, only interface names are returned. This is not sufficient, as
openvswitch allows its ports to be in different name spaces and the
interface name is valid only in its name space. What is needed and generally
used in other netlink APIs, is the pair ifindex+netnsid.
The solution is addition of the ifindex+netnsid pair (or only ifindex if in
the same name space) to vport get/dump operation.
On request side, ideally the ifindex+netnsid pair could be used to
get/set/del the corresponding vport. This is not implemented by this patch
and can be added later if needed.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Added compat fixup for peernet2id.
Cc: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Diffstat (limited to 'datapath/dp_notify.c')
-rw-r--r-- | datapath/dp_notify.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/datapath/dp_notify.c b/datapath/dp_notify.c index 424f35d93..932a37ed2 100644 --- a/datapath/dp_notify.c +++ b/datapath/dp_notify.c @@ -31,7 +31,8 @@ static void dp_detach_port_notify(struct vport *vport) struct datapath *dp; dp = vport->dp; - notify = ovs_vport_cmd_build_info(vport, 0, 0, OVS_VPORT_CMD_DEL); + notify = ovs_vport_cmd_build_info(vport, ovs_dp_get_net(dp), + 0, 0, OVS_VPORT_CMD_DEL); ovs_dp_detach_port(vport); if (IS_ERR(notify)) { genl_set_err(&dp_vport_genl_family, ovs_dp_get_net(dp), 0, |