Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Junfeng Guo <junfeng.guo@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: qi.z.zhang@intel.com
Subject: [Intel-wired-lan] [PATCH iwl-next 1/3] virtchnl: support raw packet in protocol header
Date: Mon,  5 Jun 2023 10:44:51 +0800	[thread overview]
Message-ID: <20230605024453.2378898-2-junfeng.guo@intel.com> (raw)
In-Reply-To: <20230605024453.2378898-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.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 include/linux/avf/virtchnl.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h
index c15221dcb75e..33b4c6db0c10 100644
--- a/include/linux/avf/virtchnl.h
+++ b/include/linux/avf/virtchnl.h
@@ -1083,6 +1083,7 @@ enum virtchnl_rss_algorithm {
 };
 
 #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)
 #define PROTO_HDR_FIELD_MASK ((1UL << PROTO_HDR_SHIFT) - 1)
@@ -1228,13 +1229,22 @@ struct virtchnl_proto_hdrs {
 	u8 pad[3];
 	/**
 	 * 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];
+	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

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2023-06-05  2:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05  2:44 [Intel-wired-lan] [PATCH iwl-next 0/3] Enable the raw flow filtering for FDIR Junfeng Guo
2023-06-05  2:44 ` Junfeng Guo [this message]
2023-06-05  2:44 ` [Intel-wired-lan] [PATCH iwl-next 2/3] ice: add method to disable FDIR SWAP option Junfeng Guo
2023-06-05  2:44 ` [Intel-wired-lan] [PATCH iwl-next 3/3] ice: enable Protocol Agnostic Flow Offloading FDIR Junfeng Guo
2023-06-05  5:18   ` kernel test robot
2023-06-05 11:30   ` kernel test robot
2023-08-18  6:47 ` [Intel-wired-lan] [PATCH iwl-next v2 0/3] Enable the raw flow filtering for FDIR Junfeng Guo
2023-08-18  6:47   ` [Intel-wired-lan] [PATCH iwl-next v2 1/3] virtchnl: support raw packet in protocol header Junfeng Guo
2023-08-18  6:47   ` [Intel-wired-lan] [PATCH iwl-next v2 2/3] ice: add method to disable FDIR SWAP option Junfeng Guo
2023-08-18  6:47   ` [Intel-wired-lan] [PATCH iwl-next v2 3/3] ice: enable Protocol Agnostic Flow Offloading FDIR Junfeng Guo
2023-08-22 15:20     ` kernel test robot
2023-08-23 14:25     ` kernel test robot
2023-08-24 20:44 ` [Intel-wired-lan] [PATCH iwl-next 0/3] Enable the raw flow filtering for FDIR Tony Nguyen
2023-08-28  6:57   ` Guo, Junfeng

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=20230605024453.2378898-2-junfeng.guo@intel.com \
    --to=junfeng.guo@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox