From: "Mody, Rasesh" <Rasesh.Mody@cavium.com>
To: "stable@dpdk.org" <stable@dpdk.org>
Cc: "Shaikh, Shahed" <Shahed.Shaikh@cavium.com>,
"yskoh@mellanox.com" <yskoh@mellanox.com>,
Dept-Eng DPDK Dev <Dept-EngDPDKDev@cavium.com>
Subject: [dpdk-stable] [PATCH 17.11 2/5] net/qede: fix flow director for IPv6 filter
Date: Wed, 19 Dec 2018 00:42:40 +0000 [thread overview]
Message-ID: <1545180127-3202-2-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1545180127-3202-1-git-send-email-rasesh.mody@cavium.com>
From: Shahed Shaikh <shahed.shaikh@cavium.com>
[ backported from upstream commit 7ffef6292b6d49fabbbc120663e433442146e263 ]
- PMD does not fill vtc_flow field of IPv6 header while
constructing a packet for IPv6 filter. Hence filter was
not getting applied properly.
- IPv6 addresses got swapped while copying src and dst addresses.
- Same issue with UDP and TCP port ids.
Fixes: 622075356e8f ("net/qede: support ntuple and flow director filter")
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
---
drivers/net/qede/qede_fdir.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/qede/qede_fdir.c b/drivers/net/qede/qede_fdir.c
index 0515256..050b737 100644
--- a/drivers/net/qede/qede_fdir.c
+++ b/drivers/net/qede/qede_fdir.c
@@ -18,6 +18,7 @@
#define QEDE_FDIR_IP_DEFAULT_VERSION_IHL (IP_VERSION | IP_HDRLEN)
#define QEDE_FDIR_TCP_DEFAULT_DATAOFF (0x50)
#define QEDE_FDIR_IPV4_DEF_TTL (64)
+#define QEDE_FDIR_IPV6_DEFAULT_VTC_FLOW (0x60000000)
/* Sum of length of header types of L2, L3, L4.
* L2 : ether_hdr + vlan_hdr + vxlan_hdr
@@ -340,18 +341,21 @@ void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev)
ip6->proto = input->flow.ipv6_flow.proto ?
input->flow.ipv6_flow.proto :
next_proto[input->flow_type];
- rte_memcpy(&ip6->src_addr, &input->flow.ipv6_flow.dst_ip,
+ ip6->vtc_flow =
+ rte_cpu_to_be_32(QEDE_FDIR_IPV6_DEFAULT_VTC_FLOW);
+ rte_memcpy(&ip6->src_addr, &input->flow.ipv6_flow.src_ip,
IPV6_ADDR_LEN);
- rte_memcpy(&ip6->dst_addr, &input->flow.ipv6_flow.src_ip,
+ rte_memcpy(&ip6->dst_addr, &input->flow.ipv6_flow.dst_ip,
IPV6_ADDR_LEN);
len += sizeof(struct ipv6_hdr);
+ params->ipv6 = true;
raw_pkt = (uint8_t *)buff;
/* UDP */
if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_UDP) {
udp = (struct udp_hdr *)(raw_pkt + len);
- udp->src_port = input->flow.udp6_flow.dst_port;
- udp->dst_port = input->flow.udp6_flow.src_port;
+ udp->src_port = input->flow.udp6_flow.src_port;
+ udp->dst_port = input->flow.udp6_flow.dst_port;
len += sizeof(struct udp_hdr);
params->udp = true;
} else { /* TCP */
--
1.7.10.3
next prev parent reply other threads:[~2018-12-19 0:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-19 0:42 [dpdk-stable] [PATCH 17.11 1/5] net/qede/base: fix MFW FLR flow Mody, Rasesh
2018-12-19 0:42 ` Mody, Rasesh [this message]
2018-12-19 0:42 ` [dpdk-stable] [PATCH 17.11 3/5] net/qede: fix Rx buffer size calculation Mody, Rasesh
2018-12-19 0:42 ` [dpdk-stable] [PATCH 17.11 4/5] net/qede: fix Tx tunnel offload support mask Mody, Rasesh
2018-12-19 0:42 ` [dpdk-stable] [PATCH 17.11 5/5] net/qede/base: fix to handle stag update event Mody, Rasesh
2018-12-19 20:09 ` [dpdk-stable] [PATCH 17.11 1/5] net/qede/base: fix MFW FLR flow Yongseok Koh
2018-12-19 22:18 ` Rasesh Mody
2018-12-20 0:02 ` Yongseok Koh
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=1545180127-3202-2-git-send-email-rasesh.mody@cavium.com \
--to=rasesh.mody@cavium.com \
--cc=Dept-EngDPDKDev@cavium.com \
--cc=Shahed.Shaikh@cavium.com \
--cc=stable@dpdk.org \
--cc=yskoh@mellanox.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).