DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/exception_path: bad shift operation in setup_port_lcore_affinities
@ 2016-04-15 15:29 Daniel Mrzyglod
  2016-04-27 14:24 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Mrzyglod @ 2016-04-15 15:29 UTC (permalink / raw)
  To: dev; +Cc: Daniel Mrzyglod

CID: #30688
The operaton may have an undefined behavior or yield to an unexpected result.

In setup_port_lcore_affinities: A bit shift operation has a shift amount which
is too large or has a negative value.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
 examples/exception_path/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index bec9804..c14a933 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -351,7 +351,7 @@ setup_port_lcore_affinities(void)
 
 			port_ids[i] = rx_port++;
 		}
-		else if (output_cores_mask & (1ULL << i)) {
+		else if (output_cores_mask & (1ULL << (i & 0x3f))) {
 			/* Skip ports that are not enabled */
 			while ((ports_mask & (1 << tx_port)) == 0) {
 				tx_port++;
-- 
2.5.5

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

end of thread, other threads:[~2016-04-27 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-15 15:29 [dpdk-dev] [PATCH] examples/exception_path: bad shift operation in setup_port_lcore_affinities Daniel Mrzyglod
2016-04-27 14:24 ` Thomas Monjalon

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