[dpdk-dev] pdump: fix log message to display correct error number

Message ID 1478795380-16975-1-git-send-email-reshma.pattan@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

Pattan, Reshma Nov. 10, 2016, 4:29 p.m. UTC
  The ethdev Rx/Tx remove callback apis doesn't set rte_errno during
failures, instead they just return negative error number, so using
that number in logs instead of rte_errno upon Rx and Tx callback
removal failures.

Fixes: 278f9454 ("pdump: add new library for packet capture")

Signed-off-by: Reshma Pattan <reshma.pattan@gmail.com>
---
 lib/librte_pdump/rte_pdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

John McNamara Nov. 10, 2016, 4:47 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Reshma Pattan
> Sent: Thursday, November 10, 2016 4:30 PM
> To: dev@dpdk.org
> Cc: Reshma Pattan <reshma.pattan@gmail.com>
> Subject: [dpdk-dev] [PATCH] pdump: fix log message to display correct
> error number
> 
> The ethdev Rx/Tx remove callback apis doesn't set rte_errno during
> failures, instead they just return negative error number, so using that
> number in logs instead of rte_errno upon Rx and Tx callback removal
> failures.
> 
> Fixes: 278f9454 ("pdump: add new library for packet capture")
> 
> Signed-off-by: Reshma Pattan <reshma.pattan@gmail.com>

Acked-by: John McNamara <john.mcnamara@intel.com>
  
De Lara Guarch, Pablo Nov. 10, 2016, 4:48 p.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Reshma Pattan
> Sent: Thursday, November 10, 2016 4:30 PM
> To: dev@dpdk.org
> Cc: Reshma Pattan
> Subject: [dpdk-dev] [PATCH] pdump: fix log message to display correct error
> number
> 
> The ethdev Rx/Tx remove callback apis doesn't set rte_errno during
> failures, instead they just return negative error number, so using
> that number in logs instead of rte_errno upon Rx and Tx callback
> removal failures.
> 
> Fixes: 278f9454 ("pdump: add new library for packet capture")
> 
> Signed-off-by: Reshma Pattan <reshma.pattan@gmail.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
Thomas Monjalon Nov. 12, 2016, 9:29 p.m. UTC | #3
> > The ethdev Rx/Tx remove callback apis doesn't set rte_errno during
> > failures, instead they just return negative error number, so using
> > that number in logs instead of rte_errno upon Rx and Tx callback
> > removal failures.
> > 
> > Fixes: 278f9454 ("pdump: add new library for packet capture")
> > 
> > Signed-off-by: Reshma Pattan <reshma.pattan@gmail.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index 504a1ce..5968683 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -269,7 +269,7 @@  pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue,
 			if (ret < 0) {
 				RTE_LOG(ERR, PDUMP,
 					"failed to remove rx callback, errno=%d\n",
-					rte_errno);
+					-ret);
 				return ret;
 			}
 			cbs->cb = NULL;
@@ -324,7 +324,7 @@  pdump_regitser_tx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue,
 			if (ret < 0) {
 				RTE_LOG(ERR, PDUMP,
 					"failed to remove tx callback, errno=%d\n",
-					rte_errno);
+					-ret);
 				return ret;
 			}
 			cbs->cb = NULL;