netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ahmed Zaki <ahmed.zaki@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
	horms@kernel.org, Junfeng Guo <junfeng.guo@intel.com>,
	Marcin Szycik <marcin.szycik@linux.intel.com>,
	Ahmed Zaki <ahmed.zaki@intel.com>
Subject: [PATCH iwl-next v3 09/13] virtchnl: support raw packet in protocol header
Date: Wed, 10 Jul 2024 14:40:11 -0600	[thread overview]
Message-ID: <20240710204015.124233-10-ahmed.zaki@intel.com> (raw)
In-Reply-To: <20240710204015.124233-1-ahmed.zaki@intel.com>

From: Junfeng Guo <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.

Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Ahmed Zaki <ahmed.zaki@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 8e177b67e82f..4f78a65e33dc 100644
--- a/include/linux/avf/virtchnl.h
+++ b/include/linux/avf/virtchnl.h
@@ -1121,6 +1121,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)
 #define PROTO_HDR_FIELD_MASK ((1UL << PROTO_HDR_SHIFT) - 1)
@@ -1266,13 +1267,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.43.0


  parent reply	other threads:[~2024-07-10 20:41 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 20:40 [PATCH iwl-next v3 00/13] ice: iavf: add support for TC U32 filters on VFs Ahmed Zaki
2024-07-10 20:40 ` [PATCH iwl-next v3 01/13] ice: add parser create and destroy skeleton Ahmed Zaki
2024-07-22 15:05   ` Simon Horman
2024-07-10 20:40 ` [PATCH iwl-next v3 02/13] ice: parse and init various DDP parser sections Ahmed Zaki
2024-07-11  5:28   ` [Intel-wired-lan] " Paul Menzel
2024-07-15 14:16     ` Ahmed Zaki
2024-07-22 14:52   ` Simon Horman
2024-07-10 20:40 ` [PATCH iwl-next v3 03/13] ice: add debugging functions for the " Ahmed Zaki
2024-07-22 14:53   ` Simon Horman
2024-07-24 16:19     ` Ahmed Zaki
2024-07-10 20:40 ` [PATCH iwl-next v3 04/13] ice: add parser internal helper functions Ahmed Zaki
2024-07-22 15:06   ` Simon Horman
2024-07-10 20:40 ` [PATCH iwl-next v3 05/13] ice: add parser execution main loop Ahmed Zaki
2024-07-22 15:01   ` Simon Horman
2024-07-10 20:40 ` [PATCH iwl-next v3 06/13] ice: support turning on/off the parser's double vlan mode Ahmed Zaki
2024-07-22 15:02   ` Simon Horman
2024-07-10 20:40 ` [PATCH iwl-next v3 07/13] ice: add UDP tunnels support to the parser Ahmed Zaki
2024-07-22 15:06   ` Simon Horman
2024-07-22 15:10   ` Simon Horman
2024-07-10 20:40 ` [PATCH iwl-next v3 08/13] ice: add API for parser profile initialization Ahmed Zaki
2024-07-10 20:40 ` Ahmed Zaki [this message]
2024-07-22 15:10   ` [PATCH iwl-next v3 09/13] virtchnl: support raw packet in protocol header Simon Horman
2024-07-10 20:40 ` [PATCH iwl-next v3 10/13] ice: add method to disable FDIR SWAP option Ahmed Zaki
2024-07-11  4:59   ` [Intel-wired-lan] " Paul Menzel
2024-07-15 14:23     ` Ahmed Zaki
2024-07-17  9:55       ` Paul Menzel
2024-07-18 16:54         ` Ahmed Zaki
2024-07-10 20:40 ` [PATCH iwl-next v3 11/13] ice: enable FDIR filters from raw binary patterns for VFs Ahmed Zaki
2024-07-11  5:42   ` [Intel-wired-lan] " Paul Menzel
2024-07-15 14:33     ` Ahmed Zaki
2024-07-22 15:03   ` Simon Horman
2024-07-10 20:40 ` [PATCH iwl-next v3 12/13] iavf: refactor add/del FDIR filters Ahmed Zaki
2024-07-22 15:04   ` Simon Horman
2024-07-24 16:14     ` Ahmed Zaki
2024-07-24 16:30       ` Simon Horman
2024-07-24 19:28         ` Ahmed Zaki
2024-07-10 20:40 ` [PATCH iwl-next v3 13/13] iavf: add support for offloading tc U32 cls filters Ahmed Zaki
2024-07-22 15:05   ` Simon Horman

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=20240710204015.124233-10-ahmed.zaki@intel.com \
    --to=ahmed.zaki@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=junfeng.guo@intel.com \
    --cc=marcin.szycik@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    /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).