patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure
@ 2021-12-04 10:23 Yunjian Wang
  2021-12-20  7:37 ` Wang, Haiyue
  2021-12-24 11:26 ` [PATCH v2 1/1] " Yunjian Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Yunjian Wang @ 2021-12-04 10:23 UTC (permalink / raw)
  To: dev; +Cc: haiyue.wang, dingxiaoxiong, xudingke, Yunjian Wang, stable

The function ixgbe_fdir_filter_init() and ixgbe_l2_tn_filter_init()
could return errors, the return value need to be checked and returned.

Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index fe61dba81d..25d6de7709 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1223,13 +1223,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 
 	/* initialize PF if max_vfs not zero */
 	ret = ixgbe_pf_host_init(eth_dev);
-	if (ret) {
-		rte_free(eth_dev->data->mac_addrs);
-		eth_dev->data->mac_addrs = NULL;
-		rte_free(eth_dev->data->hash_mac_addrs);
-		eth_dev->data->hash_mac_addrs = NULL;
-		return ret;
-	}
+	if (ret)
+		goto err_pf_host_init;
 
 	ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
 	/* let hardware know driver is loaded */
@@ -1268,10 +1263,14 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	TAILQ_INIT(&filter_info->fivetuple_list);
 
 	/* initialize flow director filter list & hash */
-	ixgbe_fdir_filter_init(eth_dev);
+	ret = ixgbe_fdir_filter_init(eth_dev);
+	if (ret)
+		goto err_fdir_filter_init;
 
 	/* initialize l2 tunnel filter list & hash */
-	ixgbe_l2_tn_filter_init(eth_dev);
+	ret = ixgbe_l2_tn_filter_init(eth_dev);
+	if (ret)
+		goto err_l2_tn_filter_init;
 
 	/* initialize flow filter lists */
 	ixgbe_filterlist_init();
@@ -1283,6 +1282,19 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	ixgbe_tm_conf_init(eth_dev);
 
 	return 0;
+
+err_l2_tn_filter_init:
+	ixgbe_fdir_filter_uninit(eth_dev);
+err_fdir_filter_init:
+	ixgbe_pf_host_uninit(eth_dev);
+	rte_intr_callback_unregister(intr_handle,
+		ixgbe_dev_interrupt_handler, eth_dev);
+err_pf_host_init:
+	rte_free(eth_dev->data->mac_addrs);
+	eth_dev->data->mac_addrs = NULL;
+	rte_free(eth_dev->data->hash_mac_addrs);
+	eth_dev->data->hash_mac_addrs = NULL;
+	return ret;
 }
 
 static int
-- 
2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure
  2021-12-04 10:23 [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure Yunjian Wang
@ 2021-12-20  7:37 ` Wang, Haiyue
  2021-12-24 11:05   ` wangyunjian
  2021-12-24 11:26 ` [PATCH v2 1/1] " Yunjian Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Wang, Haiyue @ 2021-12-20  7:37 UTC (permalink / raw)
  To: Yunjian Wang, dev; +Cc: dingxiaoxiong, xudingke, stable

> -----Original Message-----
> From: Yunjian Wang <wangyunjian@huawei.com>
> Sent: Saturday, December 4, 2021 18:24
> To: dev@dpdk.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; dingxiaoxiong@huawei.com; xudingke@huawei.com; Yunjian Wang
> <wangyunjian@huawei.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure
> 
> The function ixgbe_fdir_filter_init() and ixgbe_l2_tn_filter_init()
> could return errors, the return value need to be checked and returned.
> 
> Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
> Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 30 +++++++++++++++++++++---------
>  1 file changed, 21 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index fe61dba81d..25d6de7709 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -1223,13 +1223,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
> 
>  	/* initialize PF if max_vfs not zero */
>  	ret = ixgbe_pf_host_init(eth_dev);
> -	if (ret) {
> -		rte_free(eth_dev->data->mac_addrs);
> -		eth_dev->data->mac_addrs = NULL;
> -		rte_free(eth_dev->data->hash_mac_addrs);
> -		eth_dev->data->hash_mac_addrs = NULL;
> -		return ret;
> -	}
> +	if (ret)
> +		goto err_pf_host_init;
> 
>  	ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
>  	/* let hardware know driver is loaded */
> @@ -1268,10 +1263,14 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
>  	TAILQ_INIT(&filter_info->fivetuple_list);
> 
>  	/* initialize flow director filter list & hash */
> -	ixgbe_fdir_filter_init(eth_dev);
> +	ret = ixgbe_fdir_filter_init(eth_dev);
> +	if (ret)
> +		goto err_fdir_filter_init;
> 
>  	/* initialize l2 tunnel filter list & hash */
> -	ixgbe_l2_tn_filter_init(eth_dev);
> +	ret = ixgbe_l2_tn_filter_init(eth_dev);
> +	if (ret)
> +		goto err_l2_tn_filter_init;
> 
>  	/* initialize flow filter lists */
>  	ixgbe_filterlist_init();
> @@ -1283,6 +1282,19 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
>  	ixgbe_tm_conf_init(eth_dev);
> 
>  	return 0;
> +
> +err_l2_tn_filter_init:
> +	ixgbe_fdir_filter_uninit(eth_dev);
> +err_fdir_filter_init:
> +	ixgbe_pf_host_uninit(eth_dev);

The interrupt needs to be closed ?

ixgbe_disable_intr(hw);

rte_intr_disable(intr_handle);

rte_intr_callback_unregister(intr_handle, ixgbe_dev_interrupt_handler, eth_dev);

> +	rte_intr_callback_unregister(intr_handle,
> +		ixgbe_dev_interrupt_handler, eth_dev);
> +err_pf_host_init:
> +	rte_free(eth_dev->data->mac_addrs);
> +	eth_dev->data->mac_addrs = NULL;
> +	rte_free(eth_dev->data->hash_mac_addrs);
> +	eth_dev->data->hash_mac_addrs = NULL;
> +	return ret;
>  }
> 
>  static int
> --
> 2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure
  2021-12-20  7:37 ` Wang, Haiyue
@ 2021-12-24 11:05   ` wangyunjian
  0 siblings, 0 replies; 6+ messages in thread
From: wangyunjian @ 2021-12-24 11:05 UTC (permalink / raw)
  To: Wang, Haiyue, dev; +Cc: dingxiaoxiong, xudingke, stable

> -----Original Message-----
> From: Wang, Haiyue [mailto:haiyue.wang@intel.com]
> Sent: Monday, December 20, 2021 3:37 PM
> To: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org
> Cc: dingxiaoxiong <dingxiaoxiong@huawei.com>; xudingke
> <xudingke@huawei.com>; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure
> 
> > -----Original Message-----
> > From: Yunjian Wang <wangyunjian@huawei.com>
> > Sent: Saturday, December 4, 2021 18:24
> > To: dev@dpdk.org
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>; dingxiaoxiong@huawei.com;
> > xudingke@huawei.com; Yunjian Wang <wangyunjian@huawei.com>;
> > stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure
> >
> > The function ixgbe_fdir_filter_init() and ixgbe_l2_tn_filter_init()
> > could return errors, the return value need to be checked and returned.
> >
> > Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
> > Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c | 30 +++++++++++++++++++++---------
> >  1 file changed, 21 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index fe61dba81d..25d6de7709 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -1223,13 +1223,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev,
> > void *init_params __rte_unused)
> >
> >  	/* initialize PF if max_vfs not zero */
> >  	ret = ixgbe_pf_host_init(eth_dev);
> > -	if (ret) {
> > -		rte_free(eth_dev->data->mac_addrs);
> > -		eth_dev->data->mac_addrs = NULL;
> > -		rte_free(eth_dev->data->hash_mac_addrs);
> > -		eth_dev->data->hash_mac_addrs = NULL;
> > -		return ret;
> > -	}
> > +	if (ret)
> > +		goto err_pf_host_init;
> >
> >  	ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
> >  	/* let hardware know driver is loaded */ @@ -1268,10 +1263,14 @@
> > eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params
> __rte_unused)
> >  	TAILQ_INIT(&filter_info->fivetuple_list);
> >
> >  	/* initialize flow director filter list & hash */
> > -	ixgbe_fdir_filter_init(eth_dev);
> > +	ret = ixgbe_fdir_filter_init(eth_dev);
> > +	if (ret)
> > +		goto err_fdir_filter_init;
> >
> >  	/* initialize l2 tunnel filter list & hash */
> > -	ixgbe_l2_tn_filter_init(eth_dev);
> > +	ret = ixgbe_l2_tn_filter_init(eth_dev);
> > +	if (ret)
> > +		goto err_l2_tn_filter_init;
> >
> >  	/* initialize flow filter lists */
> >  	ixgbe_filterlist_init();
> > @@ -1283,6 +1282,19 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev,
> void *init_params __rte_unused)
> >  	ixgbe_tm_conf_init(eth_dev);
> >
> >  	return 0;
> > +
> > +err_l2_tn_filter_init:
> > +	ixgbe_fdir_filter_uninit(eth_dev);
> > +err_fdir_filter_init:
> > +	ixgbe_pf_host_uninit(eth_dev);
> 
> The interrupt needs to be closed ?
> 
> ixgbe_disable_intr(hw);
> 
> rte_intr_disable(intr_handle);
> 
> rte_intr_callback_unregister(intr_handle, ixgbe_dev_interrupt_handler,
> eth_dev);

OK, thanks for your suggestion, will include it in next version.

> 
> > +	rte_intr_callback_unregister(intr_handle,
> > +		ixgbe_dev_interrupt_handler, eth_dev);
> > +err_pf_host_init:
> > +	rte_free(eth_dev->data->mac_addrs);
> > +	eth_dev->data->mac_addrs = NULL;
> > +	rte_free(eth_dev->data->hash_mac_addrs);
> > +	eth_dev->data->hash_mac_addrs = NULL;
> > +	return ret;
> >  }
> >
> >  static int
> > --
> > 2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/1] net/ixgbe: check ixgbe filter init failure
  2021-12-04 10:23 [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure Yunjian Wang
  2021-12-20  7:37 ` Wang, Haiyue
@ 2021-12-24 11:26 ` Yunjian Wang
  2021-12-30  5:32   ` Wang, Haiyue
  1 sibling, 1 reply; 6+ messages in thread
From: Yunjian Wang @ 2021-12-24 11:26 UTC (permalink / raw)
  To: dev; +Cc: haiyue.wang, dingxiaoxiong, xudingke, Yunjian Wang, stable

The function ixgbe_fdir_filter_init() and ixgbe_l2_tn_filter_init()
could return errors, the return value need to be checked and returned.

Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
v2: update code suggested by Haiyue Wang
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index fe61dba81d..1c4b6fab13 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1223,13 +1223,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 
 	/* initialize PF if max_vfs not zero */
 	ret = ixgbe_pf_host_init(eth_dev);
-	if (ret) {
-		rte_free(eth_dev->data->mac_addrs);
-		eth_dev->data->mac_addrs = NULL;
-		rte_free(eth_dev->data->hash_mac_addrs);
-		eth_dev->data->hash_mac_addrs = NULL;
-		return ret;
-	}
+	if (ret)
+		goto err_pf_host_init;
 
 	ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
 	/* let hardware know driver is loaded */
@@ -1268,10 +1263,14 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	TAILQ_INIT(&filter_info->fivetuple_list);
 
 	/* initialize flow director filter list & hash */
-	ixgbe_fdir_filter_init(eth_dev);
+	ret = ixgbe_fdir_filter_init(eth_dev);
+	if (ret)
+		goto err_fdir_filter_init;
 
 	/* initialize l2 tunnel filter list & hash */
-	ixgbe_l2_tn_filter_init(eth_dev);
+	ret = ixgbe_l2_tn_filter_init(eth_dev);
+	if (ret)
+		goto err_l2_tn_filter_init;
 
 	/* initialize flow filter lists */
 	ixgbe_filterlist_init();
@@ -1283,6 +1282,21 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	ixgbe_tm_conf_init(eth_dev);
 
 	return 0;
+
+err_l2_tn_filter_init:
+	ixgbe_fdir_filter_uninit(eth_dev);
+err_fdir_filter_init:
+	ixgbe_disable_intr(hw);
+	rte_intr_disable(intr_handle);
+	rte_intr_callback_unregister(intr_handle,
+		ixgbe_dev_interrupt_handler, eth_dev);
+	ixgbe_pf_host_uninit(eth_dev);
+err_pf_host_init:
+	rte_free(eth_dev->data->mac_addrs);
+	eth_dev->data->mac_addrs = NULL;
+	rte_free(eth_dev->data->hash_mac_addrs);
+	eth_dev->data->hash_mac_addrs = NULL;
+	return ret;
 }
 
 static int
-- 
2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v2 1/1] net/ixgbe: check ixgbe filter init failure
  2021-12-24 11:26 ` [PATCH v2 1/1] " Yunjian Wang
@ 2021-12-30  5:32   ` Wang, Haiyue
  2022-01-30  2:56     ` Zhang, Qi Z
  0 siblings, 1 reply; 6+ messages in thread
From: Wang, Haiyue @ 2021-12-30  5:32 UTC (permalink / raw)
  To: Yunjian Wang, dev; +Cc: dingxiaoxiong, xudingke, stable

> -----Original Message-----
> From: Yunjian Wang <wangyunjian@huawei.com>
> Sent: Friday, December 24, 2021 19:27
> To: dev@dpdk.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; dingxiaoxiong@huawei.com; xudingke@huawei.com; Yunjian Wang
> <wangyunjian@huawei.com>; stable@dpdk.org
> Subject: [PATCH v2 1/1] net/ixgbe: check ixgbe filter init failure
> 
> The function ixgbe_fdir_filter_init() and ixgbe_l2_tn_filter_init()
> could return errors, the return value need to be checked and returned.
> 
> Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
> Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> v2: update code suggested by Haiyue Wang
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 32 +++++++++++++++++++++++---------
>  1 file changed, 23 insertions(+), 9 deletions(-)
> 

Thanks!

Acked-by: Haiyue Wang <haiyue.wang@intel.com>

> --
> 2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH v2 1/1] net/ixgbe: check ixgbe filter init failure
  2021-12-30  5:32   ` Wang, Haiyue
@ 2022-01-30  2:56     ` Zhang, Qi Z
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Qi Z @ 2022-01-30  2:56 UTC (permalink / raw)
  To: Wang, Haiyue, Yunjian Wang, dev; +Cc: dingxiaoxiong, xudingke, stable



> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang@intel.com>
> Sent: Thursday, December 30, 2021 1:33 PM
> To: Yunjian Wang <wangyunjian@huawei.com>; dev@dpdk.org
> Cc: dingxiaoxiong@huawei.com; xudingke@huawei.com; stable@dpdk.org
> Subject: RE: [PATCH v2 1/1] net/ixgbe: check ixgbe filter init failure
> 
> > -----Original Message-----
> > From: Yunjian Wang <wangyunjian@huawei.com>
> > Sent: Friday, December 24, 2021 19:27
> > To: dev@dpdk.org
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>; dingxiaoxiong@huawei.com;
> > xudingke@huawei.com; Yunjian Wang <wangyunjian@huawei.com>;
> > stable@dpdk.org
> > Subject: [PATCH v2 1/1] net/ixgbe: check ixgbe filter init failure
> >
> > The function ixgbe_fdir_filter_init() and ixgbe_l2_tn_filter_init()
> > could return errors, the return value need to be checked and returned.
> >
> > Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
> > Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> > v2: update code suggested by Haiyue Wang
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c | 32
> > +++++++++++++++++++++++---------
> >  1 file changed, 23 insertions(+), 9 deletions(-)
> >
> 
> Thanks!
> 
> Acked-by: Haiyue Wang <haiyue.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
> 
> > --
> > 2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-30  2:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-04 10:23 [dpdk-dev] [PATCH] net/ixgbe: check ixgbe filter init failure Yunjian Wang
2021-12-20  7:37 ` Wang, Haiyue
2021-12-24 11:05   ` wangyunjian
2021-12-24 11:26 ` [PATCH v2 1/1] " Yunjian Wang
2021-12-30  5:32   ` Wang, Haiyue
2022-01-30  2:56     ` Zhang, Qi Z

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).