DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/ioat: fix failure check for ioat dequeue
@ 2020-02-04 16:00 Ciara Power
  2020-02-13 12:09 ` Bruce Richardson
  2020-02-13 14:01 ` David Marchand
  0 siblings, 2 replies; 3+ messages in thread
From: Ciara Power @ 2020-02-04 16:00 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev, Ciara Power, stable

The nb_dq return value from the ioat dequeue is negative in failure
cases, however the variable was an unsigned int, causing the condition
where nb_dq <= 0 to never be true. This is now cast to a signed int,
which will successfully reflect the -1 value to be used in this
conditional check.

Coverity issue: 350342
Coverity issue: 350349
Fixes: 92c981637ffc ("examples/ioat: handle failure case for ioat dequeue")
Cc: bruce.richardson@intel.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 examples/ioat/ioatfwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index e9117718f..f460a5c92 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -460,7 +460,7 @@ ioat_tx_port(struct rxtx_port_config *tx_config)
 				MAX_PKT_BURST, NULL);
 		}
 
-		if (nb_dq <= 0)
+		if ((int32_t) nb_dq <= 0)
 			return;
 
 		if (copy_mode == COPY_MODE_IOAT_NUM)
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] examples/ioat: fix failure check for ioat dequeue
  2020-02-04 16:00 [dpdk-dev] [PATCH] examples/ioat: fix failure check for ioat dequeue Ciara Power
@ 2020-02-13 12:09 ` Bruce Richardson
  2020-02-13 14:01 ` David Marchand
  1 sibling, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2020-02-13 12:09 UTC (permalink / raw)
  To: Ciara Power; +Cc: dev, stable

On Tue, Feb 04, 2020 at 04:00:06PM +0000, Ciara Power wrote:
> The nb_dq return value from the ioat dequeue is negative in failure
> cases, however the variable was an unsigned int, causing the condition
> where nb_dq <= 0 to never be true. This is now cast to a signed int,
> which will successfully reflect the -1 value to be used in this
> conditional check.
> 
> Coverity issue: 350342
> Coverity issue: 350349
> Fixes: 92c981637ffc ("examples/ioat: handle failure case for ioat dequeue")
> Cc: bruce.richardson@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH] examples/ioat: fix failure check for ioat dequeue
  2020-02-04 16:00 [dpdk-dev] [PATCH] examples/ioat: fix failure check for ioat dequeue Ciara Power
  2020-02-13 12:09 ` Bruce Richardson
@ 2020-02-13 14:01 ` David Marchand
  1 sibling, 0 replies; 3+ messages in thread
From: David Marchand @ 2020-02-13 14:01 UTC (permalink / raw)
  To: Ciara Power; +Cc: Bruce Richardson, dev, dpdk stable

On Tue, Feb 4, 2020 at 5:10 PM Ciara Power <ciara.power@intel.com> wrote:
>
> The nb_dq return value from the ioat dequeue is negative in failure
> cases, however the variable was an unsigned int, causing the condition
> where nb_dq <= 0 to never be true. This is now cast to a signed int,
> which will successfully reflect the -1 value to be used in this
> conditional check.
>
> Coverity issue: 350342
> Coverity issue: 350349
> Fixes: 92c981637ffc ("examples/ioat: handle failure case for ioat dequeue")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.


--
David Marchand


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

end of thread, other threads:[~2020-02-13 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 16:00 [dpdk-dev] [PATCH] examples/ioat: fix failure check for ioat dequeue Ciara Power
2020-02-13 12:09 ` Bruce Richardson
2020-02-13 14:01 ` David Marchand

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