* [dpdk-dev] [PATCH] net/iavf: enable port reset @ 2020-03-25 2:47 Lunyuan Cui 2020-03-26 3:26 ` Wu, Jingjing ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Lunyuan Cui @ 2020-03-25 2:47 UTC (permalink / raw) To: dev; +Cc: Jingjing Wu, Qiming Yang, Lunyuan Cui This patch is intended to add iavf_dev_reset ops, enable iavf to support "port reset all". Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com> --- drivers/net/iavf/iavf_ethdev.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 34913f9c4..01366bc3c 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -32,6 +32,7 @@ static int iavf_dev_configure(struct rte_eth_dev *dev); static int iavf_dev_start(struct rte_eth_dev *dev); static void iavf_dev_stop(struct rte_eth_dev *dev); static void iavf_dev_close(struct rte_eth_dev *dev); +static int iavf_dev_reset(struct rte_eth_dev *dev); static int iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev); @@ -91,6 +92,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { .dev_start = iavf_dev_start, .dev_stop = iavf_dev_stop, .dev_close = iavf_dev_close, + .dev_reset = iavf_dev_reset, .dev_infos_get = iavf_dev_info_get, .dev_supported_ptypes_get = iavf_dev_supported_ptypes_get, .link_update = iavf_dev_link_update, @@ -1416,6 +1418,23 @@ iavf_dev_uninit(struct rte_eth_dev *dev) return 0; } +/* + * Reset VF device only to re-initialize resources in PMD layer + */ +static int +iavf_dev_reset(struct rte_eth_dev *dev) +{ + int ret; + + ret = iavf_dev_uninit(dev); + if (ret) + return ret; + + ret = iavf_dev_init(dev); + + return ret; +} + static int eth_iavf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) { -- 2.17.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/iavf: enable port reset 2020-03-25 2:47 [dpdk-dev] [PATCH] net/iavf: enable port reset Lunyuan Cui @ 2020-03-26 3:26 ` Wu, Jingjing 2020-04-01 3:38 ` Ye Xiaolong 2020-04-01 7:12 ` [dpdk-dev] [PATCH v2] " Lunyuan Cui 2 siblings, 0 replies; 7+ messages in thread From: Wu, Jingjing @ 2020-03-26 3:26 UTC (permalink / raw) To: Cui, LunyuanX, dev; +Cc: Yang, Qiming -----Original Message----- From: Cui, LunyuanX Sent: Wednesday, March 25, 2020 10:48 AM To: dev@dpdk.org Cc: Wu, Jingjing <jingjing.wu@intel.com>; Yang, Qiming <qiming.yang@intel.com>; Cui, LunyuanX <lunyuanx.cui@intel.com> Subject: [PATCH] net/iavf: enable port reset This patch is intended to add iavf_dev_reset ops, enable iavf to support "port reset all". Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/iavf: enable port reset 2020-03-25 2:47 [dpdk-dev] [PATCH] net/iavf: enable port reset Lunyuan Cui 2020-03-26 3:26 ` Wu, Jingjing @ 2020-04-01 3:38 ` Ye Xiaolong 2020-04-01 7:12 ` [dpdk-dev] [PATCH v2] " Lunyuan Cui 2 siblings, 0 replies; 7+ messages in thread From: Ye Xiaolong @ 2020-04-01 3:38 UTC (permalink / raw) To: Lunyuan Cui; +Cc: dev, Jingjing Wu, Qiming Yang Hi, Lunyuan On 03/25, Lunyuan Cui wrote: >This patch is intended to add iavf_dev_reset ops, enable iavf to support >"port reset all". > >Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com> >--- > drivers/net/iavf/iavf_ethdev.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c >index 34913f9c4..01366bc3c 100644 >--- a/drivers/net/iavf/iavf_ethdev.c >+++ b/drivers/net/iavf/iavf_ethdev.c >@@ -32,6 +32,7 @@ static int iavf_dev_configure(struct rte_eth_dev *dev); > static int iavf_dev_start(struct rte_eth_dev *dev); > static void iavf_dev_stop(struct rte_eth_dev *dev); > static void iavf_dev_close(struct rte_eth_dev *dev); >+static int iavf_dev_reset(struct rte_eth_dev *dev); > static int iavf_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); > static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev); >@@ -91,6 +92,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { > .dev_start = iavf_dev_start, > .dev_stop = iavf_dev_stop, > .dev_close = iavf_dev_close, >+ .dev_reset = iavf_dev_reset, > .dev_infos_get = iavf_dev_info_get, > .dev_supported_ptypes_get = iavf_dev_supported_ptypes_get, > .link_update = iavf_dev_link_update, >@@ -1416,6 +1418,23 @@ iavf_dev_uninit(struct rte_eth_dev *dev) > return 0; > } > >+/* >+ * Reset VF device only to re-initialize resources in PMD layer >+ */ >+static int >+iavf_dev_reset(struct rte_eth_dev *dev) >+{ >+ int ret; >+ >+ ret = iavf_dev_uninit(dev); >+ if (ret) >+ return ret; >+ >+ ret = iavf_dev_init(dev); >+ >+ return ret; What about merging above 2 lines into return iavf_dev_init(dev); Btw, this patch can't be applied to latest next-net-intel, could you rebase and send a new version? Thanks, Xiaolong >+} >+ > static int eth_iavf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > struct rte_pci_device *pci_dev) > { >-- >2.17.1 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v2] net/iavf: enable port reset 2020-03-25 2:47 [dpdk-dev] [PATCH] net/iavf: enable port reset Lunyuan Cui 2020-03-26 3:26 ` Wu, Jingjing 2020-04-01 3:38 ` Ye Xiaolong @ 2020-04-01 7:12 ` Lunyuan Cui 2020-04-07 1:37 ` Chen, Zhaoyan 2020-04-08 6:47 ` Ye Xiaolong 2 siblings, 2 replies; 7+ messages in thread From: Lunyuan Cui @ 2020-04-01 7:12 UTC (permalink / raw) To: dev; +Cc: Qiming Yang, Jingjing Wu, Lunyuan Cui This patch is intended to add iavf_dev_reset ops, enable iavf to support "port reset all". Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com> --- drivers/net/iavf/iavf_ethdev.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 7a8bec9c9..382530a43 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -32,6 +32,7 @@ static int iavf_dev_configure(struct rte_eth_dev *dev); static int iavf_dev_start(struct rte_eth_dev *dev); static void iavf_dev_stop(struct rte_eth_dev *dev); static void iavf_dev_close(struct rte_eth_dev *dev); +static int iavf_dev_reset(struct rte_eth_dev *dev); static int iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev); @@ -91,6 +92,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { .dev_start = iavf_dev_start, .dev_stop = iavf_dev_stop, .dev_close = iavf_dev_close, + .dev_reset = iavf_dev_reset, .dev_infos_get = iavf_dev_info_get, .dev_supported_ptypes_get = iavf_dev_supported_ptypes_get, .link_update = iavf_dev_link_update, @@ -1419,6 +1421,21 @@ iavf_dev_uninit(struct rte_eth_dev *dev) return 0; } +/* + * Reset VF device only to re-initialize resources in PMD layer + */ +static int +iavf_dev_reset(struct rte_eth_dev *dev) +{ + int ret; + + ret = iavf_dev_uninit(dev); + if (ret) + return ret; + + return iavf_dev_init(dev); +} + static int iavf_dcf_cap_check_handler(__rte_unused const char *key, const char *value, __rte_unused void *opaque) -- 2.17.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/iavf: enable port reset 2020-04-01 7:12 ` [dpdk-dev] [PATCH v2] " Lunyuan Cui @ 2020-04-07 1:37 ` Chen, Zhaoyan 2020-04-08 6:47 ` Ye Xiaolong 1 sibling, 0 replies; 7+ messages in thread From: Chen, Zhaoyan @ 2020-04-07 1:37 UTC (permalink / raw) To: dev Cc: Yang, Qiming, Wu, Jingjing, Cui, LunyuanX, Cui, LunyuanX, Chen, Zhaoyan Tested-by: Chen, Zhaoyan <zhaoyan.chen@intel.com> > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Lunyuan Cui > Sent: Wednesday, April 1, 2020 3:12 PM > To: dev@dpdk.org > Cc: Yang, Qiming <qiming.yang@intel.com>; Wu, Jingjing > <jingjing.wu@intel.com>; Cui, LunyuanX <lunyuanx.cui@intel.com> > Subject: [dpdk-dev] [PATCH v2] net/iavf: enable port reset > > This patch is intended to add iavf_dev_reset ops, enable iavf to support > "port reset all". > > Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com> > Acked-by: Jingjing Wu <jingjing.wu@intel.com> > --- > drivers/net/iavf/iavf_ethdev.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c > index 7a8bec9c9..382530a43 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -32,6 +32,7 @@ static int iavf_dev_configure(struct rte_eth_dev > *dev); static int iavf_dev_start(struct rte_eth_dev *dev); static void > iavf_dev_stop(struct rte_eth_dev *dev); static void iavf_dev_close(struct > rte_eth_dev *dev); > +static int iavf_dev_reset(struct rte_eth_dev *dev); > static int iavf_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); static > const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev); > @@ -91,6 +92,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { > .dev_start = iavf_dev_start, > .dev_stop = iavf_dev_stop, > .dev_close = iavf_dev_close, > + .dev_reset = iavf_dev_reset, > .dev_infos_get = iavf_dev_info_get, > .dev_supported_ptypes_get = iavf_dev_supported_ptypes_get, > .link_update = iavf_dev_link_update, > @@ -1419,6 +1421,21 @@ iavf_dev_uninit(struct rte_eth_dev *dev) > return 0; > } > > +/* > + * Reset VF device only to re-initialize resources in PMD layer */ > +static int iavf_dev_reset(struct rte_eth_dev *dev) { > + int ret; > + > + ret = iavf_dev_uninit(dev); > + if (ret) > + return ret; > + > + return iavf_dev_init(dev); > +} > + > static int > iavf_dcf_cap_check_handler(__rte_unused const char *key, > const char *value, __rte_unused void *opaque) > -- > 2.17.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/iavf: enable port reset 2020-04-01 7:12 ` [dpdk-dev] [PATCH v2] " Lunyuan Cui 2020-04-07 1:37 ` Chen, Zhaoyan @ 2020-04-08 6:47 ` Ye Xiaolong 1 sibling, 0 replies; 7+ messages in thread From: Ye Xiaolong @ 2020-04-08 6:47 UTC (permalink / raw) To: Lunyuan Cui; +Cc: dev, Qiming Yang, Jingjing Wu On 04/01, Lunyuan Cui wrote: >This patch is intended to add iavf_dev_reset ops, enable iavf to support >"port reset all". > >Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com> >Acked-by: Jingjing Wu <jingjing.wu@intel.com> >--- > drivers/net/iavf/iavf_ethdev.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c >index 7a8bec9c9..382530a43 100644 >--- a/drivers/net/iavf/iavf_ethdev.c >+++ b/drivers/net/iavf/iavf_ethdev.c >@@ -32,6 +32,7 @@ static int iavf_dev_configure(struct rte_eth_dev *dev); > static int iavf_dev_start(struct rte_eth_dev *dev); > static void iavf_dev_stop(struct rte_eth_dev *dev); > static void iavf_dev_close(struct rte_eth_dev *dev); >+static int iavf_dev_reset(struct rte_eth_dev *dev); > static int iavf_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); > static const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev); >@@ -91,6 +92,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { > .dev_start = iavf_dev_start, > .dev_stop = iavf_dev_stop, > .dev_close = iavf_dev_close, >+ .dev_reset = iavf_dev_reset, > .dev_infos_get = iavf_dev_info_get, > .dev_supported_ptypes_get = iavf_dev_supported_ptypes_get, > .link_update = iavf_dev_link_update, >@@ -1419,6 +1421,21 @@ iavf_dev_uninit(struct rte_eth_dev *dev) > return 0; > } > >+/* >+ * Reset VF device only to re-initialize resources in PMD layer >+ */ >+static int >+iavf_dev_reset(struct rte_eth_dev *dev) >+{ >+ int ret; >+ >+ ret = iavf_dev_uninit(dev); >+ if (ret) >+ return ret; >+ >+ return iavf_dev_init(dev); >+} >+ > static int > iavf_dcf_cap_check_handler(__rte_unused const char *key, > const char *value, __rte_unused void *opaque) >-- >2.17.1 > Acked-by: Xiaolong Ye <xiaolong.ye@intel.com> Applied to dpdk-next-net-intel, Thanks. ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20201217103608.234579-1-dapengx.yu@intel.com>]
[parent not found: <9da466c5a8155ce123e983ab07a25fa866873f15.camel@debian.org>]
[parent not found: <5f219a97191f4064aa22f57160795737@intel.com>]
* Re: [dpdk-dev] [PATCH] net/iavf: enable port reset [not found] ` <5f219a97191f4064aa22f57160795737@intel.com> @ 2020-12-18 2:37 ` Xie, WeiX 0 siblings, 0 replies; 7+ messages in thread From: Xie, WeiX @ 2020-12-18 2:37 UTC (permalink / raw) To: Yu, DapengX, Yu, PingX, Chen, BoX C Cc: Wu, Jingjing, Lu, Wenzhuo, stable, bluca, dev Tested-by: Xie,WeiX < weix.xie@intel.com> Regards, Xie Wei > -----Original Message----- > From: Luca Boccassi [mailto:bluca@debian.org] > Sent: Thursday, December 17, 2020 11:58 PM > To: Yu, DapengX <dapengx.yu@intel.com>; Wu, Jingjing > <jingjing.wu@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com> > Cc: stable@dpdk.org > Subject: Re: [PATCH] net/iavf: enable port reset > > On Thu, 2020-12-17 at 18:36 +0800, dapengx.yu@intel.com wrote: > > From: YU DAPENG <dapengx.yu@intel.com> > > > > This patch is intended to add iavf_dev_reset ops, enable iavf to > > support "port reset". And also make iavf_dev_close be called to clean > > port resources. > > > > Signed-off-by: YU DAPENG <dapengx.yu@intel.com> > > --- > > drivers/net/iavf/iavf_ethdev.c | 21 ++++++++++++++++++--- > > 1 file changed, 18 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/iavf/iavf_ethdev.c > > b/drivers/net/iavf/iavf_ethdev.c index 3291d18a2d..042dd93641 100644 > > --- a/drivers/net/iavf/iavf_ethdev.c > > +++ b/drivers/net/iavf/iavf_ethdev.c > > @@ -37,6 +37,7 @@ static int iavf_dev_configure(struct rte_eth_dev > > *dev); static int iavf_dev_start(struct rte_eth_dev *dev); static > > void iavf_dev_stop(struct rte_eth_dev *dev); static void > > iavf_dev_close(struct rte_eth_dev *dev); > > +static int iavf_dev_reset(struct rte_eth_dev *dev); > > static int iavf_dev_info_get(struct rte_eth_dev *dev, > > struct rte_eth_dev_info *dev_info); static const > uint32_t > > *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev); @@ -99,6 > > +100,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops = { > > .dev_start = iavf_dev_start, > > .dev_stop = iavf_dev_stop, > > .dev_close = iavf_dev_close, > > + .dev_reset = iavf_dev_reset, > > .dev_infos_get = iavf_dev_info_get, > > .dev_supported_ptypes_get = iavf_dev_supported_ptypes_get, > > .link_update = iavf_dev_link_update, > > @@ -1438,7 +1440,6 @@ static int > > iavf_dev_uninit(struct rte_eth_dev *dev) { > > struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data- > >dev_private); > > - struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > > > > if (rte_eal_process_type() != RTE_PROC_PRIMARY) > > return -EPERM; > > @@ -1446,8 +1447,7 @@ iavf_dev_uninit(struct rte_eth_dev *dev) > > dev->dev_ops = NULL; > > dev->rx_pkt_burst = NULL; > > dev->tx_pkt_burst = NULL; > > - if (hw->adapter_stopped == 0) > > - iavf_dev_close(dev); > > + iavf_dev_close(dev); > > > > rte_free(vf->vf_res); > > vf->vsi_res = NULL; > > @@ -1470,6 +1470,21 @@ iavf_dev_uninit(struct rte_eth_dev *dev) > > return 0; > > } > > > > +/* > > + * Reset VF device only to re-initialize resources in PMD layer */ > > +static int iavf_dev_reset(struct rte_eth_dev *dev) { > > + int ret; > > + > > + ret = iavf_dev_uninit(dev); > > + if (ret) > > + return ret; > > + > > + return iavf_dev_init(dev); > > +} > > + > > static int eth_iavf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > > struct rte_pci_device *pci_dev) { > > Thank you, applied. > > Has this been validated by the QA team, and confirmed the test case now > passes? > > -- > Kind regards, > Luca Boccassi ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-12-18 2:37 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-03-25 2:47 [dpdk-dev] [PATCH] net/iavf: enable port reset Lunyuan Cui 2020-03-26 3:26 ` Wu, Jingjing 2020-04-01 3:38 ` Ye Xiaolong 2020-04-01 7:12 ` [dpdk-dev] [PATCH v2] " Lunyuan Cui 2020-04-07 1:37 ` Chen, Zhaoyan 2020-04-08 6:47 ` Ye Xiaolong [not found] <20201217103608.234579-1-dapengx.yu@intel.com> [not found] ` <9da466c5a8155ce123e983ab07a25fa866873f15.camel@debian.org> [not found] ` <5f219a97191f4064aa22f57160795737@intel.com> 2020-12-18 2:37 ` [dpdk-dev] [PATCH] " Xie, WeiX
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).