From: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
To: johndale@cisco.com, neescoba@cisco.com
Cc: dev@dpdk.org, Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Subject: [dpdk-dev] [PATCH v1 1/1] enic: fix local ol_flags variable
Date: Tue, 10 May 2016 10:26:33 +0200 [thread overview]
Message-ID: <1462868793-3176-1-git-send-email-piotrx.t.azarewicz@intel.com> (raw)
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 <piotrx.t.azarewicz@intel.com>
---
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
reply other threads:[~2016-05-10 8:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1462868793-3176-1-git-send-email-piotrx.t.azarewicz@intel.com \
--to=piotrx.t.azarewicz@intel.com \
--cc=dev@dpdk.org \
--cc=johndale@cisco.com \
--cc=neescoba@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).