Hi Ilya, > -----Original Message----- > From: Ilya Maximets <[email protected]> > Sent: Wednesday, April 24, 2019 6:12 PM > To: Ophir Munk <[email protected]>; [email protected] > Cc: Ian Stokes <[email protected]>; Flavio Leitner <[email protected]>; > Kevin Traynor <[email protected]>; Roni Bar Yanai > <[email protected]>; Finn Christensen <[email protected]>; Ben Pfaff > <[email protected]>; Roi Dayan <[email protected]>; Simon Horman > <[email protected]>; Olga Shern <[email protected]>; > Asaf Penso <[email protected]>; Oz Shlomo <[email protected]>; Paul > Blakey <[email protected]> > Subject: Re: [PATCH] netdev: Dynamic per-port Flow API. > ... > >> +static int > >> +netdev_assign_flow_api(struct netdev *netdev) { > >> + struct netdev_registered_flow_api *rfa; > >> + > >> + CMAP_FOR_EACH (rfa, cmap_node, &netdev_flow_apis) { > >> + if (!rfa->flow_api->init_flow_api(netdev)) { > >> + ovs_refcount_ref(&rfa->refcnt); > >> + ovsrcu_set(&netdev->flow_api, rfa->flow_api); > >> + VLOG_INFO("%s: Assigned flow API '%s'.", > >> + netdev_get_name(netdev), rfa->flow_api->type); > >> + return 0; > >> + } > > > > By this logic the first API which successfully passes init_flow_api() > > becomes > the flow_api for this netdev. > > Assuming there are 2 vport APIs: 1. system datapath vport API 2. netdev > datapath vport API (planned to be added soon). > > Assuming both vport APIs successfully pass init_flow_api(), then the first > one to be tested will always be chosen and the second one will never be > used. > > Are we sure that the system datapath vport will not always be chosen with > the current netdev_tc_init_flow_api() implementation. > > How can we distinguish between a vport created under different > datapaths? > > This issue must be resolved for this patch. > > netdev-vport that works in userspace datapath has no backing linux interface > --> get_ifindex failure --> no offloading API configured.
I think the above suggestion will not solve the issue of how we can distinguish between a vport created under different datapaths? Relying on get_index will not work in case you have two vports (say both of type "vxlan"): one in kernel and another in userspace. In such a case: the kernel vxlan vport will be added first to linux with device name "vxlan_sys_4789". The same name is used by the userspace vport vxlan. Therefore, netdev-vport that works in userspace datapath will have the same name of the linux-vport which is already created in linux --> get_ifindex will unintentionally succeed --> netdev-vport will falsely select the kernel offloading API (as already described above: "By this logic the first API..."). I am recreating this scenario in my setup. This patch series is important but one of its main goals is to enable different offloads for different vports under Kernel/userspace. Can you please advise how this goal can be achieved? Regards, Ophir _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
