From: "Xing, Beilei" <beilei.xing@intel.com>
To: Sean Harte <seanbh@gmail.com>
Cc: "Wu, Jingjing" <jingjing.wu@intel.com>,
"Chilikin, Andrey" <andrey.chilikin@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v6 6/8] net/i40e: add FDIR support for GTP-C and GTP-U
Date: Fri, 29 Sep 2017 09:33:25 +0000 [thread overview]
Message-ID: <94479800C636CB44BD422CB454846E0132038E8C@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <CACA5i9bMUaB-LMzrfLKP6hnWFDVz7HRKufzo+2xi6=MY4UkROg@mail.gmail.com>
> -----Original Message-----
> From: Sean Harte [mailto:seanbh@gmail.com]
> Sent: Friday, September 29, 2017 4:15 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Chilikin, Andrey
> <andrey.chilikin@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v6 6/8] net/i40e: add FDIR support for GTP-C
> and GTP-U
>
> On 29 September 2017 at 06:19, Beilei Xing <beilei.xing@intel.com> wrote:
> > This patch adds FDIR support for GTP-C and GTP-U. The input set of
> > GTP-C and GTP-U is TEID.
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> > ---
> > drivers/net/i40e/i40e_ethdev.h | 30 +++++
> > drivers/net/i40e/i40e_fdir.c | 200 ++++++++++++++++++++++---------
> > drivers/net/i40e/i40e_flow.c | 263
> +++++++++++++++++++++++++++++++++++------
> > 3 files changed, 396 insertions(+), 97 deletions(-)
>
> <snip>
>
> > @@ -1173,10 +1196,69 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf
> *pf,
> > rte_cpu_to_be_16(ETHER_TYPE_ARP))
> > payload += sizeof(struct arp_hdr);
> > set_idx = I40E_FLXPLD_L2_IDX;
> > - break;
> > - default:
> > - PMD_DRV_LOG(ERR, "unknown pctype %u.", fdir_input->pctype);
> > - return -EINVAL;
> > + } else if (fdir_input->flow_ext.customized_pctype) {
> > + /* If customized pctype is used */
> > + cus_pctype = i40e_flow_fdir_find_customized_pctype(pf, pctype);
> > + if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||
> > + cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
> > + cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
> > + cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
> > + udp = (struct udp_hdr *)(raw_pkt + len);
> > + udp->dgram_len =
> > +
> > + rte_cpu_to_be_16(I40E_FDIR_UDP_DEFAULT_LEN);
> > +
> > + gtp = (struct rte_flow_item_gtp *)
> > + ((unsigned char *)udp + sizeof(struct udp_hdr));
> > + gtp->v_pt_rsv_flags = 0x30;
>
> 0x30 isn't valid for GTP-C, the sequence number must be present in GTP-C so
> it will be 0x32 or more. Is this byte actually matched against by the device
> using the GTP pctypes?
We construct packets and send the packet to HW to create flow director rule for GTP-C and
GTP-U. Actually I didn’t get error info with 0x30. And in my test, GTP-C packets can hit GTP-C
pctype rule. Will try 0x32 later.
>
> > + gtp->msg_len =
> > + rte_cpu_to_be_16(I40E_FDIR_GTP_DEFAULT_LEN);
> > + gtp->teid = fdir_input->flow.gtp_flow.teid;
> > + gtp->msg_type = 0x1;
>
> Why use this value?
Just for constructing a GTP packet to create a fdir rule for one pctype, can use other values except 0xFF.
>
> > +
> > + if (cus_pctype->index == I40E_CUSTOMIZED_GTPC)
> > + udp->dst_port =
> > + rte_cpu_to_be_16(2123);
>
> This will only match half of GTP-C messages. GTP-C messages have a UDP
> port destination of 2123, or a UDP source port of 2123. To match all GTP-C
> packets you need to look at both.
Yes. But the GTP profile for i40e didn't support response message.
>
> > + else
> > + udp->dst_port =
> > + rte_cpu_to_be_16(2152);
> > +
> > + if (cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4) {
> > + gtp->msg_type = 0xFF;
> > + gtp_ipv4 = (struct ipv4_hdr *)
> > + ((unsigned char *)gtp +
> > + sizeof(struct
> > + rte_flow_item_gtp));
>
> This is only valid if v_pt_rsv_flags is 0x30. GTP-U packets are allowed to have
> a sequence number, which adds an extra 4 bytes to the GTP header.
For the GTP profile, there're 4 pctypes for GTP packets: GTPC, GTPU, GTPIPV4, and GTPIPV6.
HW parse which pctype the GTP packets belonge to.
We construct packet to create a fdir rule for one pctype, after that, all packets whose
pctype matches the rule's pctype will hit the rule.
>
> > + gtp_ipv4->version_ihl =
> > + I40E_FDIR_IP_DEFAULT_VERSION_IHL;
> > + gtp_ipv4->next_proto_id = IPPROTO_IP;
> > + gtp_ipv4->total_length =
> > + rte_cpu_to_be_16(
> > + I40E_FDIR_INNER_IP_DEFAULT_LEN);
> > + payload = (unsigned char *)gtp_ipv4 +
> > + sizeof(struct ipv4_hdr);
> > + } else if (cus_pctype->index ==
> > + I40E_CUSTOMIZED_GTPU_IPV6) {
> > + gtp->msg_type = 0xFF;
> > + gtp_ipv6 = (struct ipv6_hdr *)
> > + ((unsigned char *)gtp +
> > + sizeof(struct
> > + rte_flow_item_gtp));
>
> This is only valid if v_pt_rsv_flags is 0x30. GTP-U packets are allowed to have
> a sequence number, which adds an extra 4 bytes to the GTP header.
Same with above.
>
> > + gtp_ipv6->vtc_flow =
> > + rte_cpu_to_be_32(
> > + I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |
> > + (0 << I40E_FDIR_IPv6_TC_OFFSET));
> > + gtp_ipv6->proto = IPPROTO_NONE;
> > + gtp_ipv6->payload_len =
> > + rte_cpu_to_be_16(
> > + I40E_FDIR_INNER_IPv6_DEFAULT_LEN);
> > + gtp_ipv6->hop_limits =
> > + I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
> > + payload = (unsigned char *)gtp_ipv6 +
> > + sizeof(struct ipv6_hdr);
> > + } else
> > + payload = (unsigned char *)gtp +
> > + sizeof(struct rte_flow_item_gtp);
> > + }
> > + } else {
> > + PMD_DRV_LOG(ERR, "unknown pctype %u.",
> > + fdir_input->pctype);
> > + return -1;
> > }
> >
> > /* fill the flexbytes to payload */
>
> <snip>
next prev parent reply other threads:[~2017-09-29 9:33 UTC|newest]
Thread overview: 116+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-25 7:50 [dpdk-dev] [PATCH 0/7] GTP enabling Beilei Xing
2017-08-25 7:50 ` [dpdk-dev] [PATCH 1/7] net/i40e: support RSS for GTP-C and GTP-U Beilei Xing
2017-09-07 11:20 ` [dpdk-dev] [PATCH v2 0/6] GPT-C and GTP-U enabling Beilei Xing
2017-09-07 11:20 ` [dpdk-dev] [PATCH v2 1/6] net/i40e: support RSS for GTP-C and GTP-U Beilei Xing
2017-09-18 14:17 ` Bruce Richardson
2017-09-18 14:21 ` Bruce Richardson
2017-09-07 11:20 ` [dpdk-dev] [PATCH v2 2/6] ethdev: add GTPC and GTPU items Beilei Xing
2017-09-07 12:19 ` Adrien Mazarguil
2017-09-12 6:40 ` Xing, Beilei
2017-09-12 10:46 ` Adrien Mazarguil
2017-09-13 3:09 ` Xing, Beilei
2017-09-07 11:21 ` [dpdk-dev] [PATCH v2 3/6] net/i40e: finish integration FDIR with generic flow API Beilei Xing
2017-09-07 11:21 ` [dpdk-dev] [PATCH v2 4/6] net/i40e: add FDIR support for GTP-C and GTP-U Beilei Xing
2017-09-07 11:21 ` [dpdk-dev] [PATCH v2 5/6] net/i40e: add cloud filter parsing function for GTP Beilei Xing
2017-09-07 11:21 ` [dpdk-dev] [PATCH v2 6/6] net/i40e: enable cloud filter for GTP-C and GTP-U Beilei Xing
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 0/8] GPT-C and GTP-U enabling Beilei Xing
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 1/8] mbuf: support GTP in software packet type parser Beilei Xing
2017-09-25 9:21 ` Olivier MATZ
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 0/8] GPT-C and GTP-U enabling Beilei Xing
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 1/8] mbuf: support GTP in software packet type parser Beilei Xing
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 2/8] net/i40e: update ptype and pctype info Beilei Xing
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 3/8] net/i40e: support RSS for new pctype Beilei Xing
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 4/8] ethdev: add GTP items to support flow API Beilei Xing
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 5/8] net/i40e: finish integration FDIR with generic " Beilei Xing
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 6/8] net/i40e: add FDIR support for GTP-C and GTP-U Beilei Xing
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 7/8] net/i40e: add cloud filter parsing function for GTP Beilei Xing
2017-09-28 2:17 ` [dpdk-dev] [PATCH v4 8/8] net/i40e: enable cloud filter for GTP-C and GTP-U Beilei Xing
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 0/8] GPT-C and GTP-U enabling Beilei Xing
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 1/8] mbuf: support GTP in software packet type parser Beilei Xing
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 2/8] net/i40e: update ptype and pctype info Beilei Xing
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 3/8] net/i40e: support RSS for new pctype Beilei Xing
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 4/8] ethdev: add GTP items to support flow API Beilei Xing
2017-09-28 13:43 ` Sean Harte
2017-09-29 2:12 ` Xing, Beilei
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 5/8] net/i40e: finish integration FDIR with generic " Beilei Xing
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 6/8] net/i40e: add FDIR support for GTP-C and GTP-U Beilei Xing
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 7/8] net/i40e: add cloud filter parsing function for GTP Beilei Xing
2017-09-28 8:13 ` [dpdk-dev] [PATCH v5 8/8] net/i40e: enable cloud filter for GTP-C and GTP-U Beilei Xing
2017-09-29 5:18 ` [dpdk-dev] [PATCH v6 0/8] GPT-C and GTP-U enabling Beilei Xing
2017-09-29 5:18 ` [dpdk-dev] [PATCH v6 1/8] mbuf: support GTP in software packet type parser Beilei Xing
2017-09-29 8:15 ` Sean Harte
2017-09-29 8:41 ` Xing, Beilei
2017-09-29 5:18 ` [dpdk-dev] [PATCH v6 2/8] net/i40e: update ptype and pctype info Beilei Xing
2017-09-29 13:22 ` Wu, Jingjing
2017-09-29 13:24 ` Xing, Beilei
2017-09-29 5:18 ` [dpdk-dev] [PATCH v6 3/8] net/i40e: support RSS for new pctype Beilei Xing
2017-09-29 13:24 ` Wu, Jingjing
2017-09-29 5:18 ` [dpdk-dev] [PATCH v6 4/8] ethdev: add GTP items to support flow API Beilei Xing
2017-09-29 8:15 ` Sean Harte
2017-09-29 8:54 ` Xing, Beilei
2017-09-29 9:29 ` Sean Harte
2017-09-29 9:37 ` Xing, Beilei
2017-10-02 12:27 ` Adrien Mazarguil
2017-10-03 8:56 ` Sean Harte
2017-10-05 8:06 ` Wu, Jingjing
2017-10-05 8:30 ` Adrien Mazarguil
2017-10-05 8:39 ` Wu, Jingjing
2017-09-29 5:18 ` [dpdk-dev] [PATCH v6 5/8] net/i40e: finish integration FDIR with generic " Beilei Xing
2017-09-29 13:28 ` Wu, Jingjing
2017-09-29 5:19 ` [dpdk-dev] [PATCH v6 6/8] net/i40e: add FDIR support for GTP-C and GTP-U Beilei Xing
2017-09-29 8:15 ` Sean Harte
2017-09-29 9:33 ` Xing, Beilei [this message]
2017-09-29 10:09 ` Sean Harte
2017-09-29 11:30 ` Xing, Beilei
2017-09-29 11:39 ` Xing, Beilei
2017-09-29 13:14 ` Xing, Beilei
2017-09-29 15:15 ` Xing, Beilei
2017-09-29 5:19 ` [dpdk-dev] [PATCH v6 7/8] net/i40e: add cloud filter parsing function for GTP Beilei Xing
2017-09-29 5:19 ` [dpdk-dev] [PATCH v6 8/8] net/i40e: enable cloud filter for GTP-C and GTP-U Beilei Xing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 0/8] net/i40e: GPT-C and GTP-U enabling Beilei Xing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 1/8] mbuf: support GTP in software packet type parser Beilei Xing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 2/8] net/i40e: update ptype and pctype info Beilei Xing
2017-10-05 2:51 ` Wu, Jingjing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 3/8] net/i40e: support RSS for new pctype Beilei Xing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 4/8] ethdev: add GTP items to support flow API Beilei Xing
2017-10-05 8:01 ` Wu, Jingjing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 5/8] net/i40e: finish integration FDIR with generic " Beilei Xing
2017-10-05 2:52 ` Wu, Jingjing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 6/8] net/i40e: add FDIR support for GTP-C and GTP-U Beilei Xing
2017-10-05 3:09 ` Wu, Jingjing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 7/8] net/i40e: add cloud filter parsing function for GTP Beilei Xing
2017-10-05 3:13 ` Wu, Jingjing
2017-09-29 15:50 ` [dpdk-dev] [PATCH v7 8/8] net/i40e: enable cloud filter for GTP-C and GTP-U Beilei Xing
2017-10-05 8:03 ` Wu, Jingjing
2017-10-04 22:43 ` [dpdk-dev] [PATCH v7 0/8] net/i40e: GPT-C and GTP-U enabling Ferruh Yigit
2017-10-05 8:14 ` [dpdk-dev] [PATCH v8 0/7] " Beilei Xing
2017-10-05 8:14 ` [dpdk-dev] [PATCH v8 1/7] mbuf: support GTP in software packet type parser Beilei Xing
2017-10-05 11:50 ` Sean Harte
2017-10-05 8:14 ` [dpdk-dev] [PATCH v8 2/7] net/i40e: update ptype and pctype info Beilei Xing
2017-10-05 8:14 ` [dpdk-dev] [PATCH v8 3/7] ethdev: add GTP items to support flow API Beilei Xing
2017-10-05 11:50 ` Sean Harte
2017-10-05 8:14 ` [dpdk-dev] [PATCH v8 4/7] net/i40e: finish integration FDIR with generic " Beilei Xing
2017-10-05 8:14 ` [dpdk-dev] [PATCH v8 5/7] net/i40e: add FDIR support for GTP-C and GTP-U Beilei Xing
2017-10-05 11:50 ` Sean Harte
2017-10-05 8:14 ` [dpdk-dev] [PATCH v8 6/7] net/i40e: add cloud filter parsing function for GTP Beilei Xing
2017-10-05 8:14 ` [dpdk-dev] [PATCH v8 7/7] net/i40e: enable cloud filter for GTP-C and GTP-U Beilei Xing
2017-10-05 8:23 ` [dpdk-dev] [PATCH v8 0/7] net/i40e: GPT-C and GTP-U enabling Wu, Jingjing
2017-10-05 21:13 ` Ferruh Yigit
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 2/8] net/i40e: update ptype and pctype info Beilei Xing
2017-09-23 2:58 ` Wu, Jingjing
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 3/8] net/i40e: support RSS for new pctype Beilei Xing
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 4/8] ethdev: add GTP items to support flow API Beilei Xing
2017-09-22 13:39 ` Adrien Mazarguil
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 5/8] net/i40e: finish integration FDIR with generic " Beilei Xing
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 6/8] net/i40e: add FDIR support for GTP-C and GTP-U Beilei Xing
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 7/8] net/i40e: add cloud filter parsing function for GTP Beilei Xing
2017-09-22 22:35 ` [dpdk-dev] [PATCH v3 8/8] net/i40e: enable cloud filter for GTP-C and GTP-U Beilei Xing
2017-08-25 7:50 ` [dpdk-dev] [PATCH 2/7] ethdev: add GTP item Beilei Xing
2017-09-06 16:02 ` Adrien Mazarguil
2017-09-07 6:31 ` Xing, Beilei
2017-08-25 7:50 ` [dpdk-dev] [PATCH 3/7] app/testpmd: add GTP fields to flow command Beilei Xing
2017-09-06 16:03 ` Adrien Mazarguil
2017-08-25 7:50 ` [dpdk-dev] [PATCH 4/7] net/i40e: finish integration FDIR with generic flow API Beilei Xing
2017-08-25 7:50 ` [dpdk-dev] [PATCH 5/7] net/i40e: add FDIR support for GTP-C and GTP-U Beilei Xing
2017-08-25 7:50 ` [dpdk-dev] [PATCH 6/7] net/i40e: add cloud filter parsing function for GTP Beilei Xing
2017-08-25 7:50 ` [dpdk-dev] [PATCH 7/7] net/i40e: enable cloud filter for GTP-C and GTP-U Beilei Xing
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=94479800C636CB44BD422CB454846E0132038E8C@SHSMSX101.ccr.corp.intel.com \
--to=beilei.xing@intel.com \
--cc=andrey.chilikin@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=seanbh@gmail.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).