diff mbox series

[net-next] net/mlx5e: Fix actions_match_supported() return

Message ID 20200320132305.GB95012@mwanda (mailing list archive)
State Not Applicable
Headers show
Series [net-next] net/mlx5e: Fix actions_match_supported() return | expand

Commit Message

Dan Carpenter March 20, 2020, 1:23 p.m. UTC
The actions_match_supported() function returns a bool, true for success
and false for failure.  This error path is returning a negative which
is cast to true but it should return false.

Fixes: 4c3844d9e97e ("net/mlx5e: CT: Introduce connection tracking")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leon Romanovsky March 20, 2020, 2:33 p.m. UTC | #1
On Fri, Mar 20, 2020 at 04:23:05PM +0300, Dan Carpenter wrote:
> The actions_match_supported() function returns a bool, true for success
> and false for failure.  This error path is returning a negative which
> is cast to true but it should return false.
>
> Fixes: 4c3844d9e97e ("net/mlx5e: CT: Introduce connection tracking")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Saeed Mahameed March 21, 2020, 2:43 a.m. UTC | #2
On Fri, 2020-03-20 at 16:23 +0300, Dan Carpenter wrote:
> The actions_match_supported() function returns a bool, true for
> success
> and false for failure.  This error path is returning a negative which
> is cast to true but it should return false.
> 
> Fixes: 4c3844d9e97e ("net/mlx5e: CT: Introduce connection tracking")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> index 044891a03be3..e5de7d2bac2b 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> @@ -3058,7 +3058,7 @@ static bool actions_match_supported(struct
> mlx5e_priv *priv,
>  			 */
>  			NL_SET_ERR_MSG_MOD(extack,
>  					   "Can't offload mirroring
> with action ct");
> -			return -EOPNOTSUPP;
> +			return false;
>  		}
>  	} else {
>  		actions = flow->nic_attr->action;

applied to net-next-mlx5 

Thanks,
Saeed.
Dan Carpenter March 23, 2020, 10:02 a.m. UTC | #3
On Sat, Mar 21, 2020 at 02:43:08AM +0000, Saeed Mahameed wrote:
> On Fri, 2020-03-20 at 16:23 +0300, Dan Carpenter wrote:
> > The actions_match_supported() function returns a bool, true for
> > success
> > and false for failure.  This error path is returning a negative which
> > is cast to true but it should return false.
> > 
> > Fixes: 4c3844d9e97e ("net/mlx5e: CT: Introduce connection tracking")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> >  drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > index 044891a03be3..e5de7d2bac2b 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > @@ -3058,7 +3058,7 @@ static bool actions_match_supported(struct
> > mlx5e_priv *priv,
> >  			 */
> >  			NL_SET_ERR_MSG_MOD(extack,
> >  					   "Can't offload mirroring
> > with action ct");
> > -			return -EOPNOTSUPP;
> > +			return false;
> >  		}
> >  	} else {
> >  		actions = flow->nic_attr->action;
> 
> applied to net-next-mlx5 

I can never figure out which tree these are supposed to be applied to.
:(  Is there a trick to it?

regards,
dan carpenter
Jakub Kicinski March 23, 2020, 5:01 p.m. UTC | #4
On Mon, 23 Mar 2020 13:02:16 +0300 Dan Carpenter wrote:
> On Sat, Mar 21, 2020 at 02:43:08AM +0000, Saeed Mahameed wrote:
> > On Fri, 2020-03-20 at 16:23 +0300, Dan Carpenter wrote:  
> > > The actions_match_supported() function returns a bool, true for
> > > success
> > > and false for failure.  This error path is returning a negative which
> > > is cast to true but it should return false.
> > > 
> > > Fixes: 4c3844d9e97e ("net/mlx5e: CT: Introduce connection tracking")
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > ---
> > >  drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > > b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > > index 044891a03be3..e5de7d2bac2b 100644
> > > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > > @@ -3058,7 +3058,7 @@ static bool actions_match_supported(struct
> > > mlx5e_priv *priv,
> > >  			 */
> > >  			NL_SET_ERR_MSG_MOD(extack,
> > >  					   "Can't offload mirroring
> > > with action ct");
> > > -			return -EOPNOTSUPP;
> > > +			return false;
> > >  		}
> > >  	} else {
> > >  		actions = flow->nic_attr->action;  
> > 
> > applied to net-next-mlx5   
> 
> I can never figure out which tree these are supposed to be applied to.
> :(  Is there a trick to it?

Not as far as I know :/ Upstream maintainers usually know which
sub-maintainers like to take patches into their own tree first.

Tagging things as "net-next" is perfectly fine in this case.

We could ask all maintainers who want to funnel patches via their own
trees to add T: entries in MAINTAINERS, but I'm not sure how practical
that is.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 044891a03be3..e5de7d2bac2b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -3058,7 +3058,7 @@  static bool actions_match_supported(struct mlx5e_priv *priv,
 			 */
 			NL_SET_ERR_MSG_MOD(extack,
 					   "Can't offload mirroring with action ct");
-			return -EOPNOTSUPP;
+			return false;
 		}
 	} else {
 		actions = flow->nic_attr->action;