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 4073893FE for ; Tue, 10 May 2016 10:21:30 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 10 May 2016 01:21:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,604,1455004800"; d="scan'208";a="976339688" Received: from gklab-246-018.igk.intel.com (HELO stargo) ([10.217.246.18]) by fmsmga002.fm.intel.com with SMTP; 10 May 2016 01:21:26 -0700 Received: by stargo (sSMTP sendmail emulation); Tue, 10 May 2016 10:26:46 +0200 From: Piotr Azarewicz To: johndale@cisco.com, neescoba@cisco.com Cc: dev@dpdk.org, Piotr Azarewicz Date: Tue, 10 May 2016 10:26:33 +0200 Message-Id: <1462868793-3176-1-git-send-email-piotrx.t.azarewicz@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH v1 1/1] enic: fix local ol_flags variable 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: Tue, 10 May 2016 08:21:30 -0000 Expand local ol_flags field to 64-bits. The offload flags field (ol_flags) in rte_mbuf structure is 64-bits, so local copy of it must be 64-bits too. Moreover bit comparison between 16-bits variable and 64-bits value make no sense. CID 13218 : Operands don't affect result (CONSTANT_EXPRESSION_RESULT) result_independent_of_operands: ol_flags & (18014398509481984ULL /* 1ULL << 54 */) is always 0 regardless of the values of its operands. This occurs as the logical operand of if. Coverity issue: 13218 Fixes: fefed3d1e62c ("enic: new driver") Signed-off-by: Piotr Azarewicz --- drivers/net/enic/enic.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 09f3853..1bea120 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h @@ -191,7 +191,7 @@ extern unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq); extern void enic_send_pkt(struct enic *enic, struct vnic_wq *wq, struct rte_mbuf *tx_pkt, unsigned short len, uint8_t sop, uint8_t eop, uint8_t cq_entry, - uint16_t ol_flags, uint16_t vlan_tag); + uint64_t ol_flags, uint16_t vlan_tag); extern void enic_post_wq_index(struct vnic_wq *wq); extern int enic_probe(struct enic *enic); diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 6bea940..29c5e1c 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -533,7 +533,7 @@ static uint16_t enicpmd_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, struct vnic_wq *wq = (struct vnic_wq *)tx_queue; struct enic *enic = vnic_dev_priv(wq->vdev); unsigned short vlan_id; - unsigned short ol_flags; + uint64_t ol_flags; uint8_t last_seg, eop; unsigned int host_tx_descs = 0; diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 60fe765..a78d0ec 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -180,7 +180,7 @@ void enic_post_wq_index(struct vnic_wq *wq) void enic_send_pkt(struct enic *enic, struct vnic_wq *wq, struct rte_mbuf *tx_pkt, unsigned short len, uint8_t sop, uint8_t eop, uint8_t cq_entry, - uint16_t ol_flags, uint16_t vlan_tag) + uint64_t ol_flags, uint16_t vlan_tag) { struct wq_enet_desc *desc = vnic_wq_next_desc(wq); uint16_t mss = 0; -- 1.7.9.5