DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] net/mlx5: remove unnecessary NULL check
@ 2020-03-31 10:24 wangyunjian
  2020-03-31 10:53 ` Matan Azrad
  2020-11-18  2:15 ` Suanming Mou
  0 siblings, 2 replies; 5+ messages in thread
From: wangyunjian @ 2020-03-31 10:24 UTC (permalink / raw)
  To: dev; +Cc: matan, shahafs, viacheslavo, jerry.lilijun, xudingke, Yunjian Wang

From: Yunjian Wang <wangyunjian@huawei.com>

This NULL check is unnecessary, container_of is never NULL.

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/mlx5/mlx5.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 94aaa6057..2e4edb123 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -747,7 +747,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
 	if (pos) {
 		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
 					entry);
-		MLX5_ASSERT(tbl_data);
 		mlx5_hlist_remove(sh->flow_tbls, pos);
 		rte_free(tbl_data);
 	}
@@ -756,7 +755,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
 	if (pos) {
 		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
 					entry);
-		MLX5_ASSERT(tbl_data);
 		mlx5_hlist_remove(sh->flow_tbls, pos);
 		rte_free(tbl_data);
 	}
@@ -766,7 +764,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
 	if (pos) {
 		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
 					entry);
-		MLX5_ASSERT(tbl_data);
 		mlx5_hlist_remove(sh->flow_tbls, pos);
 		rte_free(tbl_data);
 	}
-- 
2.19.1



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

* Re: [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check
  2020-03-31 10:24 [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check wangyunjian
@ 2020-03-31 10:53 ` Matan Azrad
  2020-04-01 11:13   ` wangyunjian
  2020-11-18  2:15 ` Suanming Mou
  1 sibling, 1 reply; 5+ messages in thread
From: Matan Azrad @ 2020-03-31 10:53 UTC (permalink / raw)
  To: wangyunjian, dev; +Cc: Shahaf Shuler, Slava Ovsiienko, jerry.lilijun, xudingke



From: wangyunjian
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> This NULL check is unnecessary, container_of is never NULL.
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>  drivers/net/mlx5/mlx5.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index
> 94aaa6057..2e4edb123 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -747,7 +747,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
>  	if (pos) {
>  		tbl_data = container_of(pos, struct
> mlx5_flow_tbl_data_entry,
>  					entry);
> -		MLX5_ASSERT(tbl_data);

So, maybe the assert should be on entry?

>  		mlx5_hlist_remove(sh->flow_tbls, pos);
>  		rte_free(tbl_data);
>  	}
> @@ -756,7 +755,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
>  	if (pos) {
>  		tbl_data = container_of(pos, struct
> mlx5_flow_tbl_data_entry,
>  					entry);
> -		MLX5_ASSERT(tbl_data);
>  		mlx5_hlist_remove(sh->flow_tbls, pos);
>  		rte_free(tbl_data);
>  	}
> @@ -766,7 +764,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
>  	if (pos) {
>  		tbl_data = container_of(pos, struct
> mlx5_flow_tbl_data_entry,
>  					entry);
> -		MLX5_ASSERT(tbl_data);
>  		mlx5_hlist_remove(sh->flow_tbls, pos);
>  		rte_free(tbl_data);
>  	}
> --
> 2.19.1
> 


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

* Re: [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check
  2020-03-31 10:53 ` Matan Azrad
@ 2020-04-01 11:13   ` wangyunjian
  0 siblings, 0 replies; 5+ messages in thread
From: wangyunjian @ 2020-04-01 11:13 UTC (permalink / raw)
  To: Matan Azrad, dev
  Cc: Shahaf Shuler, Slava Ovsiienko, Lilijun (Jerry), xudingke



> -----Original Message-----
> From: Matan Azrad [mailto:matan@mellanox.com]
> Sent: Tuesday, March 31, 2020 6:54 PM
> To: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org
> Cc: Shahaf Shuler <shahafs@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Lilijun (Jerry) <jerry.lilijun@huawei.com>;
> xudingke <xudingke@huawei.com>
> Subject: RE: [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check
> 
> 
> 
> From: wangyunjian
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > This NULL check is unnecessary, container_of is never NULL.
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> >  drivers/net/mlx5/mlx5.c | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index
> > 94aaa6057..2e4edb123 100644
> > --- a/drivers/net/mlx5/mlx5.c
> > +++ b/drivers/net/mlx5/mlx5.c
> > @@ -747,7 +747,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
> >  	if (pos) {
> >  		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
> >  					entry);
> > -		MLX5_ASSERT(tbl_data);
> 
> So, maybe the assert should be on entry?

Now the 'pos' is being NULL checked.

Thanks
Yunjian
> 
> >  		mlx5_hlist_remove(sh->flow_tbls, pos);
> >  		rte_free(tbl_data);
> >  	}
> > @@ -756,7 +755,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
> >  	if (pos) {
> >  		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
> >  					entry);
> > -		MLX5_ASSERT(tbl_data);
> >  		mlx5_hlist_remove(sh->flow_tbls, pos);
> >  		rte_free(tbl_data);
> >  	}
> > @@ -766,7 +764,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
> >  	if (pos) {
> >  		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
> >  					entry);
> > -		MLX5_ASSERT(tbl_data);
> >  		mlx5_hlist_remove(sh->flow_tbls, pos);
> >  		rte_free(tbl_data);
> >  	}
> > --
> > 2.19.1
> >


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

* Re: [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check
  2020-03-31 10:24 [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check wangyunjian
  2020-03-31 10:53 ` Matan Azrad
@ 2020-11-18  2:15 ` Suanming Mou
  2020-11-18  2:41   ` wangyunjian
  1 sibling, 1 reply; 5+ messages in thread
From: Suanming Mou @ 2020-11-18  2:15 UTC (permalink / raw)
  To: wangyunjian, dev; +Cc: matan, shahafs, viacheslavo, jerry.lilijun, xudingke

Hi Yunjian,

As the code changed, I think this patch is not needed anymore.

Thanks,
SuanmingMou

On 3/31/2020 6:24 PM, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> This NULL check is unnecessary, container_of is never NULL.
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>   drivers/net/mlx5/mlx5.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
> index 94aaa6057..2e4edb123 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -747,7 +747,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
>   	if (pos) {
>   		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
>   					entry);
> -		MLX5_ASSERT(tbl_data);
>   		mlx5_hlist_remove(sh->flow_tbls, pos);
>   		rte_free(tbl_data);
>   	}
> @@ -756,7 +755,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
>   	if (pos) {
>   		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
>   					entry);
> -		MLX5_ASSERT(tbl_data);
>   		mlx5_hlist_remove(sh->flow_tbls, pos);
>   		rte_free(tbl_data);
>   	}
> @@ -766,7 +764,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
>   	if (pos) {
>   		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
>   					entry);
> -		MLX5_ASSERT(tbl_data);
>   		mlx5_hlist_remove(sh->flow_tbls, pos);
>   		rte_free(tbl_data);
>   	}



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

* Re: [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check
  2020-11-18  2:15 ` Suanming Mou
@ 2020-11-18  2:41   ` wangyunjian
  0 siblings, 0 replies; 5+ messages in thread
From: wangyunjian @ 2020-11-18  2:41 UTC (permalink / raw)
  To: Suanming Mou, dev; +Cc: matan, shahafs, viacheslavo, Lilijun (Jerry), xudingke

OK, please reject this patch.

Thanks,
Yunjian

> -----Original Message-----
> From: Suanming Mou [mailto:suanmingm@nvidia.com]
> Sent: Wednesday, November 18, 2020 10:16 AM
> To: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org
> Cc: matan@mellanox.com; shahafs@mellanox.com;
> viacheslavo@mellanox.com; Lilijun (Jerry) <jerry.lilijun@huawei.com>; xudingke
> <xudingke@huawei.com>
> Subject: Re: [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check
> 
> Hi Yunjian,
> 
> As the code changed, I think this patch is not needed anymore.
> 
> Thanks,
> SuanmingMou
> 
> On 3/31/2020 6:24 PM, wangyunjian wrote:
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > This NULL check is unnecessary, container_of is never NULL.
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> >   drivers/net/mlx5/mlx5.c | 3 ---
> >   1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index
> > 94aaa6057..2e4edb123 100644
> > --- a/drivers/net/mlx5/mlx5.c
> > +++ b/drivers/net/mlx5/mlx5.c
> > @@ -747,7 +747,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
> >   	if (pos) {
> >   		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
> >   					entry);
> > -		MLX5_ASSERT(tbl_data);
> >   		mlx5_hlist_remove(sh->flow_tbls, pos);
> >   		rte_free(tbl_data);
> >   	}
> > @@ -756,7 +755,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
> >   	if (pos) {
> >   		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
> >   					entry);
> > -		MLX5_ASSERT(tbl_data);
> >   		mlx5_hlist_remove(sh->flow_tbls, pos);
> >   		rte_free(tbl_data);
> >   	}
> > @@ -766,7 +764,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv)
> >   	if (pos) {
> >   		tbl_data = container_of(pos, struct mlx5_flow_tbl_data_entry,
> >   					entry);
> > -		MLX5_ASSERT(tbl_data);
> >   		mlx5_hlist_remove(sh->flow_tbls, pos);
> >   		rte_free(tbl_data);
> >   	}
> 


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

end of thread, other threads:[~2020-11-18  2:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 10:24 [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check wangyunjian
2020-03-31 10:53 ` Matan Azrad
2020-04-01 11:13   ` wangyunjian
2020-11-18  2:15 ` Suanming Mou
2020-11-18  2:41   ` wangyunjian

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git