[v3,7/7] net/bnxt: fix to not overwrite error message

Message ID 20200107003735.96055-8-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series bnxt patchset |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ajit Khaparde Jan. 7, 2020, 12:37 a.m. UTC
  In some cases when flow creation fails, we  overwrite the specific
error message with a generic error message. This patch fixes it.

Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit Jan. 7, 2020, 9:18 a.m. UTC | #1
On 1/7/2020 12:37 AM, Ajit Khaparde wrote:
> In some cases when flow creation fails, we  overwrite the specific
> error message with a generic error message. This patch fixes it.
> 
> Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_flow.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
> index 707aedcec..cde1fa41c 100644
> --- a/drivers/net/bnxt/bnxt_flow.c
> +++ b/drivers/net/bnxt/bnxt_flow.c
> @@ -1485,7 +1485,7 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
>  		if (rxq && !vnic->rx_queue_cnt)
>  			rxq->vnic = &bp->vnic_info[0];
>  	}
> -	return rc;
> +	return -rte_errno;

The result will be same as far as I can see, you may get rid of the "rc =
-rte_errno;" assignments before "goto ret;" with this change if you want.

Also commit log seems describing the below change not this one ...

>  }
>  
>  static
> @@ -1815,7 +1815,7 @@ bnxt_flow_create(struct rte_eth_dev *dev,
>  		rte_flow_error_set(error, 0,
>  				   RTE_FLOW_ERROR_TYPE_NONE, NULL,
>  				   "Flow with pattern exists, updating destination queue");
> -	else
> +	else if (!rte_errno)
>  		rte_flow_error_set(error, -ret,
>  				   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
>  				   "Failed to create flow.");
>
  
Ajit Khaparde Jan. 7, 2020, 9:50 p.m. UTC | #2
On Tue, Jan 7, 2020 at 1:18 AM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 1/7/2020 12:37 AM, Ajit Khaparde wrote:
> > In some cases when flow creation fails, we  overwrite the specific
> > error message with a generic error message. This patch fixes it.
> >
> > Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
> > ---
> >  drivers/net/bnxt/bnxt_flow.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
> > index 707aedcec..cde1fa41c 100644
> > --- a/drivers/net/bnxt/bnxt_flow.c
> > +++ b/drivers/net/bnxt/bnxt_flow.c
> > @@ -1485,7 +1485,7 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev
> *dev,
> >               if (rxq && !vnic->rx_queue_cnt)
> >                       rxq->vnic = &bp->vnic_info[0];
> >       }
> > -     return rc;
> > +     return -rte_errno;
>
> The result will be same as far as I can see, you may get rid of the "rc =
> -rte_errno;" assignments before "goto ret;" with this change if you want.
>
I had that change lined up for my next set. But I can send it early.


>
> Also commit log seems describing the below change not this one ...
>
> >  }
> >
> >  static
> > @@ -1815,7 +1815,7 @@ bnxt_flow_create(struct rte_eth_dev *dev,
> >               rte_flow_error_set(error, 0,
> >                                  RTE_FLOW_ERROR_TYPE_NONE, NULL,
> >                                  "Flow with pattern exists, updating
> destination queue");
> > -     else
> > +     else if (!rte_errno)
> >               rte_flow_error_set(error, -ret,
> >                                  RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
> >                                  "Failed to create flow.");
> >
>
>
  

Patch

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 707aedcec..cde1fa41c 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1485,7 +1485,7 @@  bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 		if (rxq && !vnic->rx_queue_cnt)
 			rxq->vnic = &bp->vnic_info[0];
 	}
-	return rc;
+	return -rte_errno;
 }
 
 static
@@ -1815,7 +1815,7 @@  bnxt_flow_create(struct rte_eth_dev *dev,
 		rte_flow_error_set(error, 0,
 				   RTE_FLOW_ERROR_TYPE_NONE, NULL,
 				   "Flow with pattern exists, updating destination queue");
-	else
+	else if (!rte_errno)
 		rte_flow_error_set(error, -ret,
 				   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
 				   "Failed to create flow.");