From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D5B002C18 for ; Fri, 15 Apr 2016 16:27:39 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 15 Apr 2016 07:27:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,487,1455004800"; d="scan'208";a="955730852" Received: from gklab-246-025.igk.intel.com (HELO Sent) ([10.217.246.25]) by orsmga002.jf.intel.com with SMTP; 15 Apr 2016 07:27:27 -0700 Received: by Sent (sSMTP sendmail emulation); Fri, 15 Apr 2016 17:29:53 +0200 From: Daniel Mrzyglod To: dev@dpdk.org Cc: Daniel Mrzyglod Date: Fri, 15 Apr 2016 17:29:40 +0200 Message-Id: <1460734180-121811-1-git-send-email-danielx.t.mrzyglod@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] examples/exception_path: bad shift operation in setup_port_lcore_affinities X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2016 14:27:40 -0000 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 --- 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