All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com
Cc: dev@dpdk.org, junfeng.guo@intel.com
Subject: [PATCH v2 1/3] common/iavf: support raw packet in protocol header
Date: Fri,  8 Apr 2022 16:02:43 +0800	[thread overview]
Message-ID: <20220408080245.173253-2-junfeng.guo@intel.com> (raw)
In-Reply-To: <20220408080245.173253-1-junfeng.guo@intel.com>

The patch extends existing virtchnl_proto_hdrs structure to allow VF
to pass a pair of buffers as packet data and mask that describe
a match pattern of a filter rule. Then the kernel PF driver is requested
to parse the pair of buffer and figure out low level hardware metadata
(ptype, profile, field vector.. ) to program the expected FDIR or RSS
rules.

INTERNAL ONLY:

This is requirement from DPDK to support Protocol Agnostic Flow
Offloading(*1). Previously we have integrated the Parser Library(*2)
into DPDK and enabled a raw packet based FDIR and RSS support in DPDK
PF driver(*3,*4), to enable the same feature for AVF driver, we need
Virtual Channel to support raw packet filter rule passing.

[1] https://wiki.ith.intel.com/display/NPGCVL/Protocol+Agnostic+Flow+Offloading
[2] http://patchwork.dpdk.org/project/dpdk/list/?series=19057&archive=both&state=*
[3] http://patchwork.dpdk.org/project/dpdk/list/?series=20254&state=%2A&archive=both
[4] http://patchwork.dpdk.org/project/dpdk/list/?series=20291&state=%2A&archive=both

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/common/iavf/virtchnl.h | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h
index 3e44eca7d8..3975229545 100644
--- a/drivers/common/iavf/virtchnl.h
+++ b/drivers/common/iavf/virtchnl.h
@@ -1482,6 +1482,7 @@ enum virtchnl_vfr_states {
 };
 
 #define VIRTCHNL_MAX_NUM_PROTO_HDRS	32
+#define VIRTCHNL_MAX_SIZE_RAW_PACKET	1024
 #define PROTO_HDR_SHIFT			5
 #define PROTO_HDR_FIELD_START(proto_hdr_type) \
 					(proto_hdr_type << PROTO_HDR_SHIFT)
@@ -1676,14 +1677,25 @@ VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_proto_hdr);
 struct virtchnl_proto_hdrs {
 	u8 tunnel_level;
 	/**
-	 * specify where protocol header start from.
+	 * specify where protocol header start from. must be 0 when sending a raw packet request.
 	 * 0 - from the outer layer
 	 * 1 - from the first inner layer
 	 * 2 - from the second inner layer
 	 * ....
-	 **/
-	int count; /* the proto layers must < VIRTCHNL_MAX_NUM_PROTO_HDRS */
-	struct virtchnl_proto_hdr proto_hdr[VIRTCHNL_MAX_NUM_PROTO_HDRS];
+	 */
+	int count;
+	/**
+	 * number of proto layers, must < VIRTCHNL_MAX_NUM_PROTO_HDRS
+	 * must be 0 for a raw packet request.
+	 */
+	union {
+		struct virtchnl_proto_hdr proto_hdr[VIRTCHNL_MAX_NUM_PROTO_HDRS];
+		struct {
+			u16 pkt_len;
+			u8 spec[VIRTCHNL_MAX_SIZE_RAW_PACKET];
+			u8 mask[VIRTCHNL_MAX_SIZE_RAW_PACKET];
+		} raw;
+	};
 };
 
 VIRTCHNL_CHECK_STRUCT_LEN(2312, virtchnl_proto_hdrs);
-- 
2.25.1


  reply	other threads:[~2022-04-08  8:02 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  6:27 [PATCH 0/3] Enable Protocol Agnostic Flow Offloading FDIR in AVF Junfeng Guo
2022-04-07  6:27 ` [PATCH 1/3] common/iavf: support raw packet in protocol header Junfeng Guo
2022-04-07  6:27 ` [PATCH 2/3] net/iavf: align with proto hdr struct change Junfeng Guo
2022-04-07  6:27 ` [PATCH 3/3] net/iavf: enable Protocol Agnostic Flow Offloading FDIR Junfeng Guo
2022-04-08  8:02   ` [PATCH v2 0/3] Enable Protocol Agnostic Flow Offloading FDIR in AVF Junfeng Guo
2022-04-08  8:02     ` Junfeng Guo [this message]
2022-04-08  8:02     ` [PATCH v2 2/3] net/iavf: align with proto hdr struct change Junfeng Guo
2022-04-08  8:02     ` [PATCH v2 3/3] net/iavf: enable Protocol Agnostic Flow Offloading FDIR Junfeng Guo
2022-04-08  9:12       ` [PATCH v3 0/3] Enable Protocol Agnostic Flow Offloading FDIR in AVF Junfeng Guo
2022-04-08  9:12         ` [PATCH v3 1/3] common/iavf: support raw packet in protocol header Junfeng Guo
2022-04-08  9:12         ` [PATCH v3 2/3] net/iavf: align with proto hdr struct change Junfeng Guo
2022-04-08  9:12         ` [PATCH v3 3/3] net/iavf: enable Protocol Agnostic Flow Offloading FDIR Junfeng Guo
2022-04-21  3:28           ` [PATCH v4 0/4] Enable Protocol Agnostic Flow Offloading in AVF Junfeng Guo
2022-04-21  3:28             ` [PATCH v4 1/4] common/iavf: support raw packet in protocol header Junfeng Guo
2022-05-21  1:34               ` Zhang, Qi Z
2022-04-21  3:28             ` [PATCH v4 2/4] net/iavf: align with proto hdr struct change Junfeng Guo
2022-04-21  3:28             ` [PATCH v4 3/4] net/iavf: enable Protocol Agnostic Flow Offloading FDIR Junfeng Guo
2022-04-21  3:28             ` [PATCH v4 4/4] net/iavf: support Protocol Agnostic Flow Offloading VF RSS Junfeng Guo
2022-05-20  9:16               ` [PATCH v5 0/4] Enable Protocol Agnostic Flow Offloading in AVF Junfeng Guo
2022-05-20  9:16                 ` [PATCH v5 1/4] common/iavf: support raw packet in protocol header Junfeng Guo
2022-05-23  2:31                   ` [PATCH v6 0/3] Enable Protocol Agnostic Flow Offloading in AVF Junfeng Guo
2022-05-23  2:31                     ` [PATCH v6 1/3] common/iavf: support raw packet in protocol header Junfeng Guo
2022-05-23  2:31                     ` [PATCH 1/2] net/iavf: enable Protocol Agnostic Flow Offloading FDIR Junfeng Guo
2022-05-23  2:44                       ` Guo, Junfeng
2022-05-23  2:31                     ` [PATCH v6 2/3] " Junfeng Guo
2022-05-23  5:10                       ` Zhang, Qi Z
2022-05-23  2:31                     ` [PATCH 2/2] net/iavf: support Protocol Agnostic Flow Offloading VF RSS Junfeng Guo
2022-05-23  2:45                       ` Guo, Junfeng
2022-05-23  2:31                     ` [PATCH v6 3/3] " Junfeng Guo
2022-05-23  5:09                     ` [PATCH v6 0/3] Enable Protocol Agnostic Flow Offloading in AVF Zhang, Qi Z
2022-06-05 17:43                       ` Thomas Monjalon
2022-06-05 23:10                         ` Zhang, Qi Z
2022-05-20  9:16                 ` [PATCH v5 2/4] net/iavf: align with proto hdr struct change Junfeng Guo
2022-05-20  9:16                 ` [PATCH v5 3/4] net/iavf: enable Protocol Agnostic Flow Offloading FDIR Junfeng Guo
2022-05-20  9:16                 ` [PATCH v5 4/4] net/iavf: support Protocol Agnostic Flow Offloading VF RSS Junfeng Guo

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=20220408080245.173253-2-junfeng.guo@intel.com \
    --to=junfeng.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.