Message ID | 20181115183543.13416-3-ktraynor@redhat.com |
---|---|
State | Superseded |
Delegated to: | Ian Stokes |
Headers | show |
Series | Update to DPDK 18.11-rc3 | expand |
On 11/15/2018 6:35 PM, Kevin Traynor wrote: Thanks for this Kevin, I've tested with multiple devices (i40e, ixgbe, igb and all associated VFs). Didn't come across any issues with adding removing or with hotplugging. LGTM unless there are objections? Ian > rte_eth_dev_attach/detach have been removed from > DPDK 18.11. Replace them with rte_dev_probe/remove. > > Signed-off-by: Kevin Traynor <ktraynor@redhat.com> > --- > lib/netdev-dpdk.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c > index c586144f5..af310b06b 100644 > --- a/lib/netdev-dpdk.c > +++ b/lib/netdev-dpdk.c > @@ -1352,5 +1352,5 @@ netdev_dpdk_destruct(struct netdev *netdev) > { > struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); > - char devname[RTE_ETH_NAME_MAX_LEN]; > + struct rte_eth_dev_info dev_info; > > ovs_mutex_lock(&dpdk_mutex); > @@ -1361,8 +1361,9 @@ netdev_dpdk_destruct(struct netdev *netdev) > if (dev->attached) { > rte_eth_dev_close(dev->port_id); > - if (rte_eth_dev_detach(dev->port_id, devname) < 0) { > + rte_eth_dev_info_get(dev->port_id, &dev_info); > + if (dev_info.device && !rte_dev_remove(dev_info.device)) { > + VLOG_INFO("Device '%s' has been detached", dev->devargs); > + } else { > VLOG_ERR("Device '%s' can not be detached", dev->devargs); > - } else { > - VLOG_INFO("Device '%s' has been detached", devname); > } > } > @@ -1654,5 +1655,6 @@ netdev_dpdk_process_devargs(struct netdev_dpdk *dev, > || !rte_eth_dev_is_valid_port(new_port_id)) { > /* Device not found in DPDK, attempt to attach it */ > - if (!rte_eth_dev_attach(devargs, &new_port_id)) { > + if (!rte_dev_probe(devargs) > + && !rte_eth_dev_get_port_by_name(name, &new_port_id)) { > /* Attach successful */ > dev->attached = true; > @@ -3210,9 +3212,8 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED, > const char *argv[], void *aux OVS_UNUSED) > { > - int ret; > char *response; > dpdk_port_t port_id; > - char devname[RTE_ETH_NAME_MAX_LEN]; > struct netdev_dpdk *dev; > + struct rte_eth_dev_info dev_info; > > ovs_mutex_lock(&dpdk_mutex); > @@ -3233,6 +3234,6 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED, > rte_eth_dev_close(port_id); > > - ret = rte_eth_dev_detach(port_id, devname); > - if (ret < 0) { > + rte_eth_dev_info_get(port_id, &dev_info); > + if (!dev_info.device || rte_dev_remove(dev_info.device)) { > response = xasprintf("Device '%s' can not be detached", argv[1]); > goto error; >
Hi Ian, Kevin, dpdk 18.11 was officially released. Can you please inform what are the plans for merging these series into dpdk-latest and dpdk-hwol branches? Once merged - I would appreciate having the representor patches reviewed (after being rebased). Regards, Ophir -----Original Message----- From: Ian Stokes <ian.stokes@intel.com> Sent: Thursday, November 22, 2018 11:44 AM To: Kevin Traynor <ktraynor@redhat.com>; dev@openvswitch.org; Ophir Munk <ophirmu@mellanox.com>; i.maximets@samsung.com Subject: Re: [v3 dpdk-latest 2/3] netdev-dpdk: Replace rte_eth_dev_attach/detach. On 11/15/2018 6:35 PM, Kevin Traynor wrote: Thanks for this Kevin, I've tested with multiple devices (i40e, ixgbe, igb and all associated VFs). Didn't come across any issues with adding removing or with hotplugging. LGTM unless there are objections? Ian > rte_eth_dev_attach/detach have been removed from DPDK 18.11. Replace > them with rte_dev_probe/remove. > > Signed-off-by: Kevin Traynor <ktraynor@redhat.com> > --- > lib/netdev-dpdk.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index > c586144f5..af310b06b 100644 > --- a/lib/netdev-dpdk.c > +++ b/lib/netdev-dpdk.c > @@ -1352,5 +1352,5 @@ netdev_dpdk_destruct(struct netdev *netdev) > { > struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); > - char devname[RTE_ETH_NAME_MAX_LEN]; > + struct rte_eth_dev_info dev_info; > > ovs_mutex_lock(&dpdk_mutex); > @@ -1361,8 +1361,9 @@ netdev_dpdk_destruct(struct netdev *netdev) > if (dev->attached) { > rte_eth_dev_close(dev->port_id); > - if (rte_eth_dev_detach(dev->port_id, devname) < 0) { > + rte_eth_dev_info_get(dev->port_id, &dev_info); > + if (dev_info.device && !rte_dev_remove(dev_info.device)) { > + VLOG_INFO("Device '%s' has been detached", dev->devargs); > + } else { > VLOG_ERR("Device '%s' can not be detached", dev->devargs); > - } else { > - VLOG_INFO("Device '%s' has been detached", devname); > } > } > @@ -1654,5 +1655,6 @@ netdev_dpdk_process_devargs(struct netdev_dpdk *dev, > || !rte_eth_dev_is_valid_port(new_port_id)) { > /* Device not found in DPDK, attempt to attach it */ > - if (!rte_eth_dev_attach(devargs, &new_port_id)) { > + if (!rte_dev_probe(devargs) > + && !rte_eth_dev_get_port_by_name(name, &new_port_id)) > + { > /* Attach successful */ > dev->attached = true; @@ -3210,9 +3212,8 @@ > netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED, > const char *argv[], void *aux OVS_UNUSED) > { > - int ret; > char *response; > dpdk_port_t port_id; > - char devname[RTE_ETH_NAME_MAX_LEN]; > struct netdev_dpdk *dev; > + struct rte_eth_dev_info dev_info; > > ovs_mutex_lock(&dpdk_mutex); > @@ -3233,6 +3234,6 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED, > rte_eth_dev_close(port_id); > > - ret = rte_eth_dev_detach(port_id, devname); > - if (ret < 0) { > + rte_eth_dev_info_get(port_id, &dev_info); > + if (!dev_info.device || rte_dev_remove(dev_info.device)) { > response = xasprintf("Device '%s' can not be detached", argv[1]); > goto error; >
On 11/29/2018 09:37 AM, Ophir Munk wrote: > Hi Ian, Kevin, > dpdk 18.11 was officially released. Can you please inform what are the plans for merging these series into dpdk-latest and dpdk-hwol branches? Hi Ophir, I have sent a v7 for dpdk-latest to update to 18.11 release. thanks, Kevin. > Once merged - I would appreciate having the representor patches reviewed (after being rebased). > > Regards, > Ophir > > -----Original Message----- > From: Ian Stokes <ian.stokes@intel.com> > Sent: Thursday, November 22, 2018 11:44 AM > To: Kevin Traynor <ktraynor@redhat.com>; dev@openvswitch.org; Ophir Munk <ophirmu@mellanox.com>; i.maximets@samsung.com > Subject: Re: [v3 dpdk-latest 2/3] netdev-dpdk: Replace rte_eth_dev_attach/detach. > > On 11/15/2018 6:35 PM, Kevin Traynor wrote: > > Thanks for this Kevin, I've tested with multiple devices (i40e, ixgbe, igb and all associated VFs). Didn't come across any issues with adding removing or with hotplugging. LGTM unless there are objections? > > Ian >> rte_eth_dev_attach/detach have been removed from DPDK 18.11. Replace >> them with rte_dev_probe/remove. >> >> Signed-off-by: Kevin Traynor <ktraynor@redhat.com> >> --- >> lib/netdev-dpdk.c | 19 ++++++++++--------- >> 1 file changed, 10 insertions(+), 9 deletions(-) >> >> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index >> c586144f5..af310b06b 100644 >> --- a/lib/netdev-dpdk.c >> +++ b/lib/netdev-dpdk.c >> @@ -1352,5 +1352,5 @@ netdev_dpdk_destruct(struct netdev *netdev) >> { >> struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); >> - char devname[RTE_ETH_NAME_MAX_LEN]; >> + struct rte_eth_dev_info dev_info; >> >> ovs_mutex_lock(&dpdk_mutex); >> @@ -1361,8 +1361,9 @@ netdev_dpdk_destruct(struct netdev *netdev) >> if (dev->attached) { >> rte_eth_dev_close(dev->port_id); >> - if (rte_eth_dev_detach(dev->port_id, devname) < 0) { >> + rte_eth_dev_info_get(dev->port_id, &dev_info); >> + if (dev_info.device && !rte_dev_remove(dev_info.device)) { >> + VLOG_INFO("Device '%s' has been detached", dev->devargs); >> + } else { >> VLOG_ERR("Device '%s' can not be detached", dev->devargs); >> - } else { >> - VLOG_INFO("Device '%s' has been detached", devname); >> } >> } >> @@ -1654,5 +1655,6 @@ netdev_dpdk_process_devargs(struct netdev_dpdk *dev, >> || !rte_eth_dev_is_valid_port(new_port_id)) { >> /* Device not found in DPDK, attempt to attach it */ >> - if (!rte_eth_dev_attach(devargs, &new_port_id)) { >> + if (!rte_dev_probe(devargs) >> + && !rte_eth_dev_get_port_by_name(name, &new_port_id)) >> + { >> /* Attach successful */ >> dev->attached = true; @@ -3210,9 +3212,8 @@ >> netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED, >> const char *argv[], void *aux OVS_UNUSED) >> { >> - int ret; >> char *response; >> dpdk_port_t port_id; >> - char devname[RTE_ETH_NAME_MAX_LEN]; >> struct netdev_dpdk *dev; >> + struct rte_eth_dev_info dev_info; >> >> ovs_mutex_lock(&dpdk_mutex); >> @@ -3233,6 +3234,6 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED, >> rte_eth_dev_close(port_id); >> >> - ret = rte_eth_dev_detach(port_id, devname); >> - if (ret < 0) { >> + rte_eth_dev_info_get(port_id, &dev_info); >> + if (!dev_info.device || rte_dev_remove(dev_info.device)) { >> response = xasprintf("Device '%s' can not be detached", argv[1]); >> goto error; >> >
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index c586144f5..af310b06b 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1352,5 +1352,5 @@ netdev_dpdk_destruct(struct netdev *netdev) { struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); - char devname[RTE_ETH_NAME_MAX_LEN]; + struct rte_eth_dev_info dev_info; ovs_mutex_lock(&dpdk_mutex); @@ -1361,8 +1361,9 @@ netdev_dpdk_destruct(struct netdev *netdev) if (dev->attached) { rte_eth_dev_close(dev->port_id); - if (rte_eth_dev_detach(dev->port_id, devname) < 0) { + rte_eth_dev_info_get(dev->port_id, &dev_info); + if (dev_info.device && !rte_dev_remove(dev_info.device)) { + VLOG_INFO("Device '%s' has been detached", dev->devargs); + } else { VLOG_ERR("Device '%s' can not be detached", dev->devargs); - } else { - VLOG_INFO("Device '%s' has been detached", devname); } } @@ -1654,5 +1655,6 @@ netdev_dpdk_process_devargs(struct netdev_dpdk *dev, || !rte_eth_dev_is_valid_port(new_port_id)) { /* Device not found in DPDK, attempt to attach it */ - if (!rte_eth_dev_attach(devargs, &new_port_id)) { + if (!rte_dev_probe(devargs) + && !rte_eth_dev_get_port_by_name(name, &new_port_id)) { /* Attach successful */ dev->attached = true; @@ -3210,9 +3212,8 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED, const char *argv[], void *aux OVS_UNUSED) { - int ret; char *response; dpdk_port_t port_id; - char devname[RTE_ETH_NAME_MAX_LEN]; struct netdev_dpdk *dev; + struct rte_eth_dev_info dev_info; ovs_mutex_lock(&dpdk_mutex); @@ -3233,6 +3234,6 @@ netdev_dpdk_detach(struct unixctl_conn *conn, int argc OVS_UNUSED, rte_eth_dev_close(port_id); - ret = rte_eth_dev_detach(port_id, devname); - if (ret < 0) { + rte_eth_dev_info_get(port_id, &dev_info); + if (!dev_info.device || rte_dev_remove(dev_info.device)) { response = xasprintf("Device '%s' can not be detached", argv[1]); goto error;
rte_eth_dev_attach/detach have been removed from DPDK 18.11. Replace them with rte_dev_probe/remove. Signed-off-by: Kevin Traynor <ktraynor@redhat.com> --- lib/netdev-dpdk.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)