From patchwork Fri Jun 3 00:22:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 13187 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 3FA186A6D; Fri, 3 Jun 2016 02:23:28 +0200 (CEST) Received: from alln-iport-4.cisco.com (alln-iport-4.cisco.com [173.37.142.91]) by dpdk.org (Postfix) with ESMTP id 166345A9F for ; Fri, 3 Jun 2016 02:23:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1461; q=dns/txt; s=iport; t=1464913404; x=1466123004; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=TWRg5XmZbShLz7Y6ZTDlFdEeOw3rPZ0U1/u5fp39+6I=; b=OWUCobp0NMBMzU6+TR3U9kOW5URas679TeXuLYbXpN983hYqjFVFKCEi JMNbmPpF86HvQPYN4FbJSYJNn5eCH0DpBpMg+jFKQn1Drl+zz3mOjehst IuuGRlnUxA9R0BkJKLp4L38bVyopAjo8TzkT+PAmeKYr97DtQPnGEJNAC I=; X-IronPort-AV: E=Sophos;i="5.26,409,1459814400"; d="scan'208";a="280244246" Received: from alln-core-12.cisco.com ([173.36.13.134]) by alln-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Jun 2016 00:23:23 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-12.cisco.com (8.14.5/8.14.5) with ESMTP id u530NNhI005671; Fri, 3 Jun 2016 00:23:23 GMT Received: by cisco.com (Postfix, from userid 392789) id 776C83FAADEC; Thu, 2 Jun 2016 17:23:23 -0700 (PDT) From: John Daley To: dev@dpdk.org Cc: bruce.richarsdon@intel.com, John Daley Date: Thu, 2 Jun 2016 17:22:56 -0700 Message-Id: <1464913377-30879-13-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1464913377-30879-1-git-send-email-johndale@cisco.com> References: <1464071579-30072-1-git-send-email-johndale@cisco.com> <1464913377-30879-1-git-send-email-johndale@cisco.com> Subject: [dpdk-dev] [PATCH v3 12/13] enic: expand local Tx mbuf flags variable to 64-bits 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The offload flags variable (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. This breaks Tx vlan IP and L4 offloads. 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") Suggested-by: Piotr Azarewicz Signed-off-by: John Daley Acked-by: Piotr Azarewicz --- This is essentially patch http://www.dpdk.org/dev/patchwork/patch/12642 applied after the enic_send_packet function was melded into the main transmit funciton. drivers/net/enic/enic_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c index 7527bce..350d04b 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -384,7 +384,7 @@ uint16_t enic_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; unsigned int wq_desc_avail; int head_idx; struct vnic_wq_buf *buf;