diff mbox

[dpdk-dev,v3,12/13] enic: expand local Tx mbuf flags variable to 64-bits

Message ID 1464913377-30879-13-git-send-email-johndale@cisco.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers show

Commit Message

John Daley June 3, 2016, 12:22 a.m. UTC
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 <piotrx.t.azarewicz@intel.com>
Signed-off-by: John Daley <johndale@cisco.com>
---
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(-)

Comments

Piotr Azarewicz June 3, 2016, 8:05 a.m. UTC | #1
> Coverity issue: 13218
> Fixes: fefed3d1e62c ("enic: new driver")
> 
> Suggested-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> Signed-off-by: John Daley <johndale@cisco.com>
> ---
> 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.
> 
Acked-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
diff mbox

Patch

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;