XDP hardware hints discussion mail archive
 help / color / mirror / Atom feed
From: Ederson de Souza <ederson.desouza@intel.com>
To: xdp-hints@xdp-project.net
Cc: bpf@vger.kernel.org
Subject: [[RFC xdp-hints] 12/16] ethtool,igc: Add "xdp_headroom" driver info
Date: Mon,  2 Aug 2021 18:03:27 -0700	[thread overview]
Message-ID: <20210803010331.39453-13-ederson.desouza@intel.com> (raw)
In-Reply-To: <20210803010331.39453-1-ederson.desouza@intel.com>

This information can be used by user space applications to determine how
much headroom is needed for the XDP frame.

igc driver is also changed to add this new information.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 ++
 include/uapi/linux/ethtool.h                 | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index d3e84416248e..7cfd4eb59234 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -8,6 +8,7 @@
 
 #include "igc.h"
 #include "igc_diag.h"
+#include "igc_xdp.h"
 
 /* forward declaration */
 struct igc_stats {
@@ -156,6 +157,7 @@ static void igc_ethtool_get_drvinfo(struct net_device *netdev,
 		sizeof(drvinfo->bus_info));
 
 	drvinfo->n_priv_flags = IGC_PRIV_FLAGS_STR_LEN;
+	drvinfo->xdp_headroom = XDP_PACKET_HEADROOM;
 }
 
 static int igc_ethtool_get_regs_len(struct net_device *netdev)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 67aa7134b301..dcf14ad4dccd 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -176,6 +176,8 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
  *	and %ETHTOOL_SEEPROM commands, in bytes
  * @regdump_len: Size of register dump returned by the %ETHTOOL_GREGS
  *	command, in bytes
+ * @xdp_headroom: Size of minimum XDP headroom needed by the driver
+ *	to fill with metadata information.
  *
  * Users can use the %ETHTOOL_GSSET_INFO command to get the number of
  * strings in any string set (from Linux 2.6.34).
@@ -197,6 +199,7 @@ struct ethtool_drvinfo {
 	__u32	testinfo_len;
 	__u32	eedump_len;
 	__u32	regdump_len;
+	__u32	xdp_headroom;
 };
 
 #define SOPASS_MAX	6
-- 
2.32.0


  parent reply	other threads:[~2021-08-03  1:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03  1:03 [[RFC xdp-hints] 00/16] XDP hints and AF_XDP support Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 01/16] bpf: add btf register/unregister API Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 02/16] net/core: XDP metadata BTF netlink API Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 03/16] tools/bpf: Query XDP metadata BTF ID Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 04/16] tools/bpf: Add xdp set command for md btf Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 05/16] igc: Fix race condition in PTP Tx code Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 06/16] igc: Retrieve the TX timestamp directly (instead of in a interrupt) Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 07/16] igc: Add support for multiple in-flight TX timestamps Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 08/16] igc: Use irq safe locks for timestamping Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 09/16] net/xdp: Support for generic XDP hints Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 10/16] igc: XDP packet RX timestamp Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 11/16] igc: XDP packet TX timestamp Ederson de Souza
2021-08-03  1:03 ` Ederson de Souza [this message]
2021-08-03  1:03 ` [[RFC xdp-hints] 13/16] libbpf: Helpers to access XDP frame metadata Ederson de Souza
2021-08-06 22:59   ` Andrii Nakryiko
2021-08-19 11:47     ` Toke Høiland-Jørgensen
2021-08-03  1:03 ` [[RFC xdp-hints] 14/16] libbpf: Helpers to access XDP hints based on BTF definitions Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 15/16] samples/bpf: XDP hints AF_XDP example Ederson de Souza
2021-08-03  1:03 ` [[RFC xdp-hints] 16/16] samples/bpf: Show XDP hints usage Ederson de Souza
2021-08-06 23:14   ` Andrii Nakryiko
2021-08-03  9:12 ` [[RFC xdp-hints] 00/16] XDP hints and AF_XDP support Alexander Lobakin
2021-08-03 15:23   ` John Fastabend
2021-08-04 15:15     ` Alexander Lobakin
2021-08-04 23:45       ` John Fastabend
2021-08-13 22:04         ` Desouza, Ederson

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

  List information: https://lists.xdp-project.net/postorius/lists/xdp-hints.xdp-project.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210803010331.39453-13-ederson.desouza@intel.com \
    --to=ederson.desouza@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=xdp-hints@xdp-project.net \
    --subject='Re: [[RFC xdp-hints] 12/16] ethtool,igc: Add "xdp_headroom" driver info' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox