netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling
@ 2023-08-03  1:02 Jakub Kicinski
  2023-08-03  1:02 ` [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers Jakub Kicinski
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Jakub Kicinski @ 2023-08-03  1:02 UTC (permalink / raw)
  To: ast; +Cc: netdev, bpf, hawk, amritha.nambiar, aleksander.lobakin,
	Jakub Kicinski

While poking at struct netdev_rx_queue I got annoyed by
the huge rebuild times. I split it out from netdevice.h
and then realized that it was the main reason we included
xdp.h in there. So I removed that dependency as well.

This gives us very pleasant build times for both xdp.h
and struct netdev_rx_queue changes.

I'm sending this for bpf-next because I think it'd be easiest
if it goes in there, and then bpf-next gets flushed soon after?
I can also make a branch on merge-base for net-next and bpf-next..

v2:
 - build fix
 - reorder some includes
v1: https://lore.kernel.org/all/20230802003246.2153774-1-kuba@kernel.org/

Jakub Kicinski (3):
  eth: add missing xdp.h includes in drivers
  net: move struct netdev_rx_queue out of netdevice.h
  net: invert the netdevice.h vs xdp.h dependency

 drivers/net/bonding/bond_main.c               |  1 +
 drivers/net/ethernet/amazon/ena/ena_netdev.h  |  1 +
 drivers/net/ethernet/engleder/tsnep.h         |  1 +
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.h  |  1 +
 drivers/net/ethernet/freescale/enetc/enetc.h  |  1 +
 drivers/net/ethernet/freescale/fec.h          |  1 +
 .../ethernet/fungible/funeth/funeth_txrx.h    |  1 +
 drivers/net/ethernet/google/gve/gve.h         |  1 +
 drivers/net/ethernet/intel/igc/igc.h          |  1 +
 .../ethernet/microchip/lan966x/lan966x_main.h |  1 +
 drivers/net/ethernet/microsoft/mana/mana_en.c |  1 +
 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |  1 +
 drivers/net/ethernet/ti/cpsw_priv.h           |  1 +
 drivers/net/hyperv/hyperv_net.h               |  1 +
 drivers/net/tap.c                             |  1 +
 drivers/net/virtio_net.c                      |  1 +
 include/linux/filter.h                        | 17 ------
 include/linux/netdevice.h                     | 55 ++-----------------
 include/net/busy_poll.h                       |  1 +
 include/net/mana/mana.h                       |  2 +
 include/net/netdev_rx_queue.h                 | 53 ++++++++++++++++++
 include/net/xdp.h                             | 29 ++++++++--
 include/trace/events/xdp.h                    |  1 +
 kernel/bpf/btf.c                              |  1 +
 kernel/bpf/offload.c                          |  1 +
 kernel/bpf/verifier.c                         |  1 +
 net/bpf/test_run.c                            |  1 +
 net/core/dev.c                                |  1 +
 net/core/net-sysfs.c                          |  1 +
 net/netfilter/nf_conntrack_bpf.c              |  1 +
 net/xdp/xsk.c                                 |  1 +
 31 files changed, 110 insertions(+), 72 deletions(-)
 create mode 100644 include/net/netdev_rx_queue.h

-- 
2.41.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers
  2023-08-03  1:02 [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling Jakub Kicinski
@ 2023-08-03  1:02 ` Jakub Kicinski
  2023-08-03 14:09   ` Jesper Dangaard Brouer
  2023-08-03 19:34   ` Horatiu Vultur
  2023-08-03  1:02 ` [PATCH bpf-next v2 2/3] net: move struct netdev_rx_queue out of netdevice.h Jakub Kicinski
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Jakub Kicinski @ 2023-08-03  1:02 UTC (permalink / raw)
  To: ast
  Cc: netdev, bpf, hawk, amritha.nambiar, aleksander.lobakin,
	Jakub Kicinski, Wei Fang, Gerhard Engleder, j.vosburgh, andy,
	shayagr, akiyano, ioana.ciornei, claudiu.manoil, vladimir.oltean,
	shenwei.wang, xiaoning.wang, linux-imx, dmichail, jeroendb,
	pkaligineedi, shailend, jesse.brandeburg, anthony.l.nguyen,
	horatiu.vultur, UNGLinuxDriver, kys, haiyangz, wei.liu, decui,
	peppe.cavallaro, alexandre.torgue, joabreu, mcoquelin.stm32,
	grygorii.strashko, longli, sharmaajay, daniel, john.fastabend,
	simon.horman, leon, linux-hyperv

Handful of drivers currently expect to get xdp.h by virtue
of including netdevice.h. This will soon no longer be the case
so add explicit includes.

Reviewed-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
v2: try a little harder with the alphabetic order of includes

CC: j.vosburgh@gmail.com
CC: andy@greyhouse.net
CC: shayagr@amazon.com
CC: akiyano@amazon.com
CC: ioana.ciornei@nxp.com
CC: claudiu.manoil@nxp.com
CC: vladimir.oltean@nxp.com
CC: shenwei.wang@nxp.com
CC: xiaoning.wang@nxp.com
CC: linux-imx@nxp.com
CC: dmichail@fungible.com
CC: jeroendb@google.com
CC: pkaligineedi@google.com
CC: shailend@google.com
CC: jesse.brandeburg@intel.com
CC: anthony.l.nguyen@intel.com
CC: horatiu.vultur@microchip.com
CC: UNGLinuxDriver@microchip.com
CC: kys@microsoft.com
CC: haiyangz@microsoft.com
CC: wei.liu@kernel.org
CC: decui@microsoft.com
CC: peppe.cavallaro@st.com
CC: alexandre.torgue@foss.st.com
CC: joabreu@synopsys.com
CC: mcoquelin.stm32@gmail.com
CC: grygorii.strashko@ti.com
CC: longli@microsoft.com
CC: sharmaajay@microsoft.com
CC: daniel@iogearbox.net
CC: hawk@kernel.org
CC: john.fastabend@gmail.com
CC: simon.horman@corigine.com
CC: leon@kernel.org
CC: linux-hyperv@vger.kernel.org
CC: bpf@vger.kernel.org
---
 drivers/net/bonding/bond_main.c                       | 1 +
 drivers/net/ethernet/amazon/ena/ena_netdev.h          | 1 +
 drivers/net/ethernet/engleder/tsnep.h                 | 1 +
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h      | 1 +
 drivers/net/ethernet/freescale/enetc/enetc.h          | 1 +
 drivers/net/ethernet/freescale/fec.h                  | 1 +
 drivers/net/ethernet/fungible/funeth/funeth_txrx.h    | 1 +
 drivers/net/ethernet/google/gve/gve.h                 | 1 +
 drivers/net/ethernet/intel/igc/igc.h                  | 1 +
 drivers/net/ethernet/microchip/lan966x/lan966x_main.h | 1 +
 drivers/net/ethernet/microsoft/mana/mana_en.c         | 1 +
 drivers/net/ethernet/stmicro/stmmac/stmmac.h          | 1 +
 drivers/net/ethernet/ti/cpsw_priv.h                   | 1 +
 drivers/net/hyperv/hyperv_net.h                       | 1 +
 drivers/net/tap.c                                     | 1 +
 include/net/mana/mana.h                               | 2 ++
 16 files changed, 17 insertions(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7a0f25301f7e..2f21cca4fdaf 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -90,6 +90,7 @@
 #include <net/tls.h>
 #endif
 #include <net/ip6_route.h>
+#include <net/xdp.h>
 
 #include "bonding_priv.h"
 
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
index 248b715b4d68..33c923e1261a 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
@@ -14,6 +14,7 @@
 #include <linux/interrupt.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
+#include <net/xdp.h>
 #include <uapi/linux/bpf.h>
 
 #include "ena_com.h"
diff --git a/drivers/net/ethernet/engleder/tsnep.h b/drivers/net/ethernet/engleder/tsnep.h
index 11b29f56aaf9..6e14c918e3fb 100644
--- a/drivers/net/ethernet/engleder/tsnep.h
+++ b/drivers/net/ethernet/engleder/tsnep.h
@@ -14,6 +14,7 @@
 #include <linux/net_tstamp.h>
 #include <linux/ptp_clock_kernel.h>
 #include <linux/miscdevice.h>
+#include <net/xdp.h>
 
 #define TSNEP "tsnep"
 
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
index d56d7a13262e..bfb6c96c3b2f 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
@@ -12,6 +12,7 @@
 #include <linux/fsl/mc.h>
 #include <linux/net_tstamp.h>
 #include <net/devlink.h>
+#include <net/xdp.h>
 
 #include <soc/fsl/dpaa2-io.h>
 #include <soc/fsl/dpaa2-fd.h>
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h
index 8577cf7699a0..7439739cd81a 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.h
+++ b/drivers/net/ethernet/freescale/enetc/enetc.h
@@ -11,6 +11,7 @@
 #include <linux/if_vlan.h>
 #include <linux/phylink.h>
 #include <linux/dim.h>
+#include <net/xdp.h>
 
 #include "enetc_hw.h"
 
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 8f1edcca96c4..5a0974e62f99 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -22,6 +22,7 @@
 #include <linux/timecounter.h>
 #include <dt-bindings/firmware/imx/rsrc.h>
 #include <linux/firmware/imx/sci.h>
+#include <net/xdp.h>
 
 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
     defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
diff --git a/drivers/net/ethernet/fungible/funeth/funeth_txrx.h b/drivers/net/ethernet/fungible/funeth/funeth_txrx.h
index 53b7e95213a8..5eec552a1f24 100644
--- a/drivers/net/ethernet/fungible/funeth/funeth_txrx.h
+++ b/drivers/net/ethernet/fungible/funeth/funeth_txrx.h
@@ -5,6 +5,7 @@
 
 #include <linux/netdevice.h>
 #include <linux/u64_stats_sync.h>
+#include <net/xdp.h>
 
 /* Tx descriptor size */
 #define FUNETH_SQE_SIZE 64U
diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h
index 4b425bf71ede..a31256f70348 100644
--- a/drivers/net/ethernet/google/gve/gve.h
+++ b/drivers/net/ethernet/google/gve/gve.h
@@ -11,6 +11,7 @@
 #include <linux/netdevice.h>
 #include <linux/pci.h>
 #include <linux/u64_stats_sync.h>
+#include <net/xdp.h>
 
 #include "gve_desc.h"
 #include "gve_desc_dqo.h"
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 9db384f66a8e..4bffc3cb502f 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -15,6 +15,7 @@
 #include <linux/net_tstamp.h>
 #include <linux/bitfield.h>
 #include <linux/hrtimer.h>
+#include <net/xdp.h>
 
 #include "igc_hw.h"
 
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
index 27f272831ea5..eb7d81b5e9f8 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
@@ -14,6 +14,7 @@
 #include <net/pkt_cls.h>
 #include <net/pkt_sched.h>
 #include <net/switchdev.h>
+#include <net/xdp.h>
 
 #include <vcap_api.h>
 #include <vcap_api_client.h>
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index ac2acc9aca9d..21665f114fe9 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -11,6 +11,7 @@
 
 #include <net/checksum.h>
 #include <net/ip6_checksum.h>
+#include <net/xdp.h>
 
 #include <net/mana/mana.h>
 #include <net/mana/mana_auxiliary.h>
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 4ce5eaaae513..a6d034968654 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -22,6 +22,7 @@
 #include <linux/net_tstamp.h>
 #include <linux/reset.h>
 #include <net/page_pool.h>
+#include <net/xdp.h>
 #include <uapi/linux/bpf.h>
 
 struct stmmac_resources {
diff --git a/drivers/net/ethernet/ti/cpsw_priv.h b/drivers/net/ethernet/ti/cpsw_priv.h
index 34230145ca0b..0e27c433098d 100644
--- a/drivers/net/ethernet/ti/cpsw_priv.h
+++ b/drivers/net/ethernet/ti/cpsw_priv.h
@@ -6,6 +6,7 @@
 #ifndef DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_
 #define DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_
 
+#include <net/xdp.h>
 #include <uapi/linux/bpf.h>
 
 #include "davinci_cpdma.h"
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index c9dd69dbe1b8..810977952f95 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -16,6 +16,7 @@
 #include <linux/hyperv.h>
 #include <linux/rndis.h>
 #include <linux/jhash.h>
+#include <net/xdp.h>
 
 /* RSS related */
 #define OID_GEN_RECEIVE_SCALE_CAPABILITIES 0x00010203  /* query only */
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 9137fb8c1c42..b196a2a54355 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -22,6 +22,7 @@
 #include <net/net_namespace.h>
 #include <net/rtnetlink.h>
 #include <net/sock.h>
+#include <net/xdp.h>
 #include <linux/virtio_net.h>
 #include <linux/skb_array.h>
 
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 024ad8ddb27e..1ccdca03e166 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -4,6 +4,8 @@
 #ifndef _MANA_H
 #define _MANA_H
 
+#include <net/xdp.h>
+
 #include "gdma.h"
 #include "hw_channel.h"
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH bpf-next v2 2/3] net: move struct netdev_rx_queue out of netdevice.h
  2023-08-03  1:02 [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling Jakub Kicinski
  2023-08-03  1:02 ` [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers Jakub Kicinski
@ 2023-08-03  1:02 ` Jakub Kicinski
  2023-08-03 14:24   ` Jesper Dangaard Brouer
  2023-08-03 15:52   ` Alexander Lobakin
  2023-08-03  1:02 ` [PATCH bpf-next v2 3/3] net: invert the netdevice.h vs xdp.h dependency Jakub Kicinski
  2023-08-03 15:50 ` [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling patchwork-bot+netdevbpf
  3 siblings, 2 replies; 10+ messages in thread
From: Jakub Kicinski @ 2023-08-03  1:02 UTC (permalink / raw)
  To: ast
  Cc: netdev, bpf, hawk, amritha.nambiar, aleksander.lobakin,
	Jakub Kicinski, mst, jasowang, xuanzhuo, daniel, andrii,
	martin.lau, song, yonghong.song, john.fastabend, kpsingh, sdf,
	haoluo, jolsa, bjorn, magnus.karlsson, maciej.fijalkowski,
	jonathan.lemon, gregkh, wangyufen, virtualization

struct netdev_rx_queue is touched in only a few places
and having it defined in netdevice.h brings in the dependency
on xdp.h, because struct xdp_rxq_info gets embedded in
struct netdev_rx_queue.

In prep for removal of xdp.h from netdevice.h move all
the netdev_rx_queue stuff to a new header.

We could technically break the new header up to avoid
the sysfs.h include but it's so rarely included it
doesn't seem to be worth it at this point.

Reviewed-by: Amritha Nambiar <amritha.nambiar@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: mst@redhat.com
CC: jasowang@redhat.com
CC: xuanzhuo@linux.alibaba.com
CC: ast@kernel.org
CC: daniel@iogearbox.net
CC: andrii@kernel.org
CC: martin.lau@linux.dev
CC: song@kernel.org
CC: yonghong.song@linux.dev
CC: john.fastabend@gmail.com
CC: kpsingh@kernel.org
CC: sdf@google.com
CC: haoluo@google.com
CC: jolsa@kernel.org
CC: bjorn@kernel.org
CC: magnus.karlsson@intel.com
CC: maciej.fijalkowski@intel.com
CC: jonathan.lemon@gmail.com
CC: hawk@kernel.org
CC: gregkh@linuxfoundation.org
CC: wangyufen@huawei.com
CC: virtualization@lists.linux-foundation.org
CC: bpf@vger.kernel.org
---
 drivers/net/virtio_net.c      |  1 +
 include/linux/netdevice.h     | 44 -----------------------------
 include/net/netdev_rx_queue.h | 53 +++++++++++++++++++++++++++++++++++
 net/bpf/test_run.c            |  1 +
 net/core/dev.c                |  1 +
 net/core/net-sysfs.c          |  1 +
 net/xdp/xsk.c                 |  1 +
 7 files changed, 58 insertions(+), 44 deletions(-)
 create mode 100644 include/net/netdev_rx_queue.h

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 0db14f6b87d3..5bcfd69333ea 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -22,6 +22,7 @@
 #include <net/route.h>
 #include <net/xdp.h>
 #include <net/net_failover.h>
+#include <net/netdev_rx_queue.h>
 
 static int napi_weight = NAPI_POLL_WEIGHT;
 module_param(napi_weight, int, 0444);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3800d0479698..5563c8a210b5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -782,32 +782,6 @@ bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
 #endif
 #endif /* CONFIG_RPS */
 
-/* This structure contains an instance of an RX queue. */
-struct netdev_rx_queue {
-	struct xdp_rxq_info		xdp_rxq;
-#ifdef CONFIG_RPS
-	struct rps_map __rcu		*rps_map;
-	struct rps_dev_flow_table __rcu	*rps_flow_table;
-#endif
-	struct kobject			kobj;
-	struct net_device		*dev;
-	netdevice_tracker		dev_tracker;
-
-#ifdef CONFIG_XDP_SOCKETS
-	struct xsk_buff_pool            *pool;
-#endif
-} ____cacheline_aligned_in_smp;
-
-/*
- * RX queue sysfs structures and functions.
- */
-struct rx_queue_attribute {
-	struct attribute attr;
-	ssize_t (*show)(struct netdev_rx_queue *queue, char *buf);
-	ssize_t (*store)(struct netdev_rx_queue *queue,
-			 const char *buf, size_t len);
-};
-
 /* XPS map type and offset of the xps map within net_device->xps_maps[]. */
 enum xps_map_type {
 	XPS_CPUS = 0,
@@ -3828,24 +3802,6 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev,
 int netif_set_real_num_queues(struct net_device *dev,
 			      unsigned int txq, unsigned int rxq);
 
-static inline struct netdev_rx_queue *
-__netif_get_rx_queue(struct net_device *dev, unsigned int rxq)
-{
-	return dev->_rx + rxq;
-}
-
-#ifdef CONFIG_SYSFS
-static inline unsigned int get_netdev_rx_queue_index(
-		struct netdev_rx_queue *queue)
-{
-	struct net_device *dev = queue->dev;
-	int index = queue - dev->_rx;
-
-	BUG_ON(index >= dev->num_rx_queues);
-	return index;
-}
-#endif
-
 int netif_get_num_default_rss_queues(void);
 
 void dev_kfree_skb_irq_reason(struct sk_buff *skb, enum skb_drop_reason reason);
diff --git a/include/net/netdev_rx_queue.h b/include/net/netdev_rx_queue.h
new file mode 100644
index 000000000000..cdcafb30d437
--- /dev/null
+++ b/include/net/netdev_rx_queue.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_NETDEV_RX_QUEUE_H
+#define _LINUX_NETDEV_RX_QUEUE_H
+
+#include <linux/kobject.h>
+#include <linux/netdevice.h>
+#include <linux/sysfs.h>
+#include <net/xdp.h>
+
+/* This structure contains an instance of an RX queue. */
+struct netdev_rx_queue {
+	struct xdp_rxq_info		xdp_rxq;
+#ifdef CONFIG_RPS
+	struct rps_map __rcu		*rps_map;
+	struct rps_dev_flow_table __rcu	*rps_flow_table;
+#endif
+	struct kobject			kobj;
+	struct net_device		*dev;
+	netdevice_tracker		dev_tracker;
+
+#ifdef CONFIG_XDP_SOCKETS
+	struct xsk_buff_pool            *pool;
+#endif
+} ____cacheline_aligned_in_smp;
+
+/*
+ * RX queue sysfs structures and functions.
+ */
+struct rx_queue_attribute {
+	struct attribute attr;
+	ssize_t (*show)(struct netdev_rx_queue *queue, char *buf);
+	ssize_t (*store)(struct netdev_rx_queue *queue,
+			 const char *buf, size_t len);
+};
+
+static inline struct netdev_rx_queue *
+__netif_get_rx_queue(struct net_device *dev, unsigned int rxq)
+{
+	return dev->_rx + rxq;
+}
+
+#ifdef CONFIG_SYSFS
+static inline unsigned int
+get_netdev_rx_queue_index(struct netdev_rx_queue *queue)
+{
+	struct net_device *dev = queue->dev;
+	int index = queue - dev->_rx;
+
+	BUG_ON(index >= dev->num_rx_queues);
+	return index;
+}
+#endif
+#endif
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 7d47f53f20c1..0aac76c13fd4 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -20,6 +20,7 @@
 #include <linux/smp.h>
 #include <linux/sock_diag.h>
 #include <linux/netfilter.h>
+#include <net/netdev_rx_queue.h>
 #include <net/xdp.h>
 #include <net/netfilter/nf_bpf_link.h>
 
diff --git a/net/core/dev.c b/net/core/dev.c
index 002fec07de73..1916ec990f58 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -152,6 +152,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/prandom.h>
 #include <linux/once_lite.h>
+#include <net/netdev_rx_queue.h>
 
 #include "dev.h"
 #include "net-sysfs.h"
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 15e3f4606b5f..fccaa5bac0ed 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -23,6 +23,7 @@
 #include <linux/of.h>
 #include <linux/of_net.h>
 #include <linux/cpu.h>
+#include <net/netdev_rx_queue.h>
 
 #include "dev.h"
 #include "net-sysfs.h"
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 4f1e0599146e..82aaec1b079f 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -25,6 +25,7 @@
 #include <linux/vmalloc.h>
 #include <net/xdp_sock_drv.h>
 #include <net/busy_poll.h>
+#include <net/netdev_rx_queue.h>
 #include <net/xdp.h>
 
 #include "xsk_queue.h"
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH bpf-next v2 3/3] net: invert the netdevice.h vs xdp.h dependency
  2023-08-03  1:02 [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling Jakub Kicinski
  2023-08-03  1:02 ` [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers Jakub Kicinski
  2023-08-03  1:02 ` [PATCH bpf-next v2 2/3] net: move struct netdev_rx_queue out of netdevice.h Jakub Kicinski
@ 2023-08-03  1:02 ` Jakub Kicinski
  2023-08-03 13:59   ` Jesper Dangaard Brouer
  2023-08-03 15:50 ` [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling patchwork-bot+netdevbpf
  3 siblings, 1 reply; 10+ messages in thread
From: Jakub Kicinski @ 2023-08-03  1:02 UTC (permalink / raw)
  To: ast
  Cc: netdev, bpf, hawk, amritha.nambiar, aleksander.lobakin,
	Jakub Kicinski, daniel, john.fastabend, andrii, martin.lau, song,
	yonghong.song, kpsingh, sdf, haoluo, jolsa

xdp.h is far more specific and is included in only 67 other
files vs netdevice.h's 1538 include sites.
Make xdp.h include netdevice.h, instead of the other way around.
This decreases the incremental allmodconfig builds size when
xdp.h is touched from 5947 to 662 objects.

Move bpf_prog_run_xdp() to xdp.h, seems appropriate and filter.h
is a mega-header in its own right so it's nice to avoid xdp.h
getting included there as well.

The only unfortunate part is that the typedef for xdp_features_t
has to move to netdevice.h, since its embedded in struct netdevice.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: ast@kernel.org
CC: daniel@iogearbox.net
CC: john.fastabend@gmail.com
CC: andrii@kernel.org
CC: martin.lau@linux.dev
CC: song@kernel.org
CC: yonghong.song@linux.dev
CC: kpsingh@kernel.org
CC: sdf@google.com
CC: haoluo@google.com
CC: jolsa@kernel.org
CC: hawk@kernel.org
CC: bpf@vger.kernel.org
---
 include/linux/filter.h           | 17 -----------------
 include/linux/netdevice.h        | 11 ++++-------
 include/net/busy_poll.h          |  1 +
 include/net/xdp.h                | 29 +++++++++++++++++++++++++----
 include/trace/events/xdp.h       |  1 +
 kernel/bpf/btf.c                 |  1 +
 kernel/bpf/offload.c             |  1 +
 kernel/bpf/verifier.c            |  1 +
 net/netfilter/nf_conntrack_bpf.c |  1 +
 9 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/include/linux/filter.h b/include/linux/filter.h
index f5eabe3fa5e8..2d6fe30bad5f 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -774,23 +774,6 @@ DECLARE_STATIC_KEY_FALSE(bpf_master_redirect_enabled_key);
 
 u32 xdp_master_redirect(struct xdp_buff *xdp);
 
-static __always_inline u32 bpf_prog_run_xdp(const struct bpf_prog *prog,
-					    struct xdp_buff *xdp)
-{
-	/* Driver XDP hooks are invoked within a single NAPI poll cycle and thus
-	 * under local_bh_disable(), which provides the needed RCU protection
-	 * for accessing map entries.
-	 */
-	u32 act = __bpf_prog_run(prog, xdp, BPF_DISPATCHER_FUNC(xdp));
-
-	if (static_branch_unlikely(&bpf_master_redirect_enabled_key)) {
-		if (act == XDP_TX && netif_is_bond_slave(xdp->rxq->dev))
-			act = xdp_master_redirect(xdp);
-	}
-
-	return act;
-}
-
 void bpf_prog_change_xdp(struct bpf_prog *prev_prog, struct bpf_prog *prog);
 
 static inline u32 bpf_prog_insn_size(const struct bpf_prog *prog)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5563c8a210b5..d8ed85183fe4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -40,7 +40,6 @@
 #include <net/dcbnl.h>
 #endif
 #include <net/netprio_cgroup.h>
-#include <net/xdp.h>
 
 #include <linux/netdev_features.h>
 #include <linux/neighbour.h>
@@ -76,8 +75,12 @@ struct udp_tunnel_nic_info;
 struct udp_tunnel_nic;
 struct bpf_prog;
 struct xdp_buff;
+struct xdp_frame;
+struct xdp_metadata_ops;
 struct xdp_md;
 
+typedef u32 xdp_features_t;
+
 void synchronize_net(void);
 void netdev_set_default_ethtool_ops(struct net_device *dev,
 				    const struct ethtool_ops *ops);
@@ -1628,12 +1631,6 @@ struct net_device_ops {
 						  bool cycles);
 };
 
-struct xdp_metadata_ops {
-	int	(*xmo_rx_timestamp)(const struct xdp_md *ctx, u64 *timestamp);
-	int	(*xmo_rx_hash)(const struct xdp_md *ctx, u32 *hash,
-			       enum xdp_rss_hash_type *rss_type);
-};
-
 /**
  * enum netdev_priv_flags - &struct net_device priv_flags
  *
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h
index f90f0021f5f2..4dabeb6c76d3 100644
--- a/include/net/busy_poll.h
+++ b/include/net/busy_poll.h
@@ -16,6 +16,7 @@
 #include <linux/sched/clock.h>
 #include <linux/sched/signal.h>
 #include <net/ip.h>
+#include <net/xdp.h>
 
 /*		0 - Reserved to indicate value not set
  *     1..NR_CPUS - Reserved for sender_cpu
diff --git a/include/net/xdp.h b/include/net/xdp.h
index d1c5381fc95f..de08c8e0d134 100644
--- a/include/net/xdp.h
+++ b/include/net/xdp.h
@@ -6,9 +6,10 @@
 #ifndef __LINUX_NET_XDP_H__
 #define __LINUX_NET_XDP_H__
 
-#include <linux/skbuff.h> /* skb_shared_info */
-#include <uapi/linux/netdev.h>
 #include <linux/bitfield.h>
+#include <linux/filter.h>
+#include <linux/netdevice.h>
+#include <linux/skbuff.h> /* skb_shared_info */
 
 /**
  * DOC: XDP RX-queue information
@@ -45,8 +46,6 @@ enum xdp_mem_type {
 	MEM_TYPE_MAX,
 };
 
-typedef u32 xdp_features_t;
-
 /* XDP flags for ndo_xdp_xmit */
 #define XDP_XMIT_FLUSH		(1U << 0)	/* doorbell signal consumer */
 #define XDP_XMIT_FLAGS_MASK	XDP_XMIT_FLUSH
@@ -443,6 +442,12 @@ enum xdp_rss_hash_type {
 	XDP_RSS_TYPE_L4_IPV6_SCTP_EX = XDP_RSS_TYPE_L4_IPV6_SCTP | XDP_RSS_L3_DYNHDR,
 };
 
+struct xdp_metadata_ops {
+	int	(*xmo_rx_timestamp)(const struct xdp_md *ctx, u64 *timestamp);
+	int	(*xmo_rx_hash)(const struct xdp_md *ctx, u32 *hash,
+			       enum xdp_rss_hash_type *rss_type);
+};
+
 #ifdef CONFIG_NET
 u32 bpf_xdp_metadata_kfunc_id(int id);
 bool bpf_dev_bound_kfunc_id(u32 btf_id);
@@ -474,4 +479,20 @@ static inline void xdp_clear_features_flag(struct net_device *dev)
 	xdp_set_features_flag(dev, 0);
 }
 
+static __always_inline u32 bpf_prog_run_xdp(const struct bpf_prog *prog,
+					    struct xdp_buff *xdp)
+{
+	/* Driver XDP hooks are invoked within a single NAPI poll cycle and thus
+	 * under local_bh_disable(), which provides the needed RCU protection
+	 * for accessing map entries.
+	 */
+	u32 act = __bpf_prog_run(prog, xdp, BPF_DISPATCHER_FUNC(xdp));
+
+	if (static_branch_unlikely(&bpf_master_redirect_enabled_key)) {
+		if (act == XDP_TX && netif_is_bond_slave(xdp->rxq->dev))
+			act = xdp_master_redirect(xdp);
+	}
+
+	return act;
+}
 #endif /* __LINUX_NET_XDP_H__ */
diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h
index cd89f1d5ce7b..9adc2bdf2f94 100644
--- a/include/trace/events/xdp.h
+++ b/include/trace/events/xdp.h
@@ -9,6 +9,7 @@
 #include <linux/filter.h>
 #include <linux/tracepoint.h>
 #include <linux/bpf.h>
+#include <net/xdp.h>
 
 #define __XDP_ACT_MAP(FN)	\
 	FN(ABORTED)		\
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index ef9581a580e2..249657c466dd 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -29,6 +29,7 @@
 #include <net/netfilter/nf_bpf_link.h>
 
 #include <net/sock.h>
+#include <net/xdp.h>
 #include "../tools/lib/bpf/relo_core.h"
 
 /* BTF (BPF Type Format) is the meta data format which describes
diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c
index 8a26cd8814c1..3e4f2ec1af06 100644
--- a/kernel/bpf/offload.c
+++ b/kernel/bpf/offload.c
@@ -25,6 +25,7 @@
 #include <linux/rhashtable.h>
 #include <linux/rtnetlink.h>
 #include <linux/rwsem.h>
+#include <net/xdp.h>
 
 /* Protects offdevs, members of bpf_offload_netdev and offload members
  * of all progs.
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index e7b1af016841..132f25dab931 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -26,6 +26,7 @@
 #include <linux/poison.h>
 #include <linux/module.h>
 #include <linux/cpumask.h>
+#include <net/xdp.h>
 
 #include "disasm.h"
 
diff --git a/net/netfilter/nf_conntrack_bpf.c b/net/netfilter/nf_conntrack_bpf.c
index 0d36d7285e3f..c7a6114091ae 100644
--- a/net/netfilter/nf_conntrack_bpf.c
+++ b/net/netfilter/nf_conntrack_bpf.c
@@ -14,6 +14,7 @@
 #include <linux/types.h>
 #include <linux/btf_ids.h>
 #include <linux/net_namespace.h>
+#include <net/xdp.h>
 #include <net/netfilter/nf_conntrack_bpf.h>
 #include <net/netfilter/nf_conntrack_core.h>
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next v2 3/3] net: invert the netdevice.h vs xdp.h dependency
  2023-08-03  1:02 ` [PATCH bpf-next v2 3/3] net: invert the netdevice.h vs xdp.h dependency Jakub Kicinski
@ 2023-08-03 13:59   ` Jesper Dangaard Brouer
  0 siblings, 0 replies; 10+ messages in thread
From: Jesper Dangaard Brouer @ 2023-08-03 13:59 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, bpf, amritha.nambiar, aleksander.lobakin, daniel,
	john.fastabend, andrii, martin.lau, song, yonghong.song, ast,
	kpsingh, sdf, haoluo, jolsa



On 03/08/2023 03.02, Jakub Kicinski wrote:
> xdp.h is far more specific and is included in only 67 other
> files vs netdevice.h's 1538 include sites.
> Make xdp.h include netdevice.h, instead of the other way around.
> This decreases the incremental allmodconfig builds size when
> xdp.h is touched from 5947 to 662 objects.
> 
> Move bpf_prog_run_xdp() to xdp.h, seems appropriate and filter.h
> is a mega-header in its own right so it's nice to avoid xdp.h
> getting included there as well.
> 
> The only unfortunate part is that the typedef for xdp_features_t
> has to move to netdevice.h, since its embedded in struct netdevice.
> 
> Signed-off-by: Jakub Kicinski<kuba@kernel.org>
> ---
> CC:ast@kernel.org
> CC:daniel@iogearbox.net
> CC:john.fastabend@gmail.com
> CC:andrii@kernel.org
> CC:martin.lau@linux.dev
> CC:song@kernel.org
> CC:yonghong.song@linux.dev
> CC:kpsingh@kernel.org
> CC:sdf@google.com
> CC:haoluo@google.com
> CC:jolsa@kernel.org
> CC:hawk@kernel.org
> CC:bpf@vger.kernel.org
> ---
>   include/linux/filter.h           | 17 -----------------
>   include/linux/netdevice.h        | 11 ++++-------
>   include/net/busy_poll.h          |  1 +
>   include/net/xdp.h                | 29 +++++++++++++++++++++++++----
>   include/trace/events/xdp.h       |  1 +
>   kernel/bpf/btf.c                 |  1 +
>   kernel/bpf/offload.c             |  1 +
>   kernel/bpf/verifier.c            |  1 +
>   net/netfilter/nf_conntrack_bpf.c |  1 +
>   9 files changed, 35 insertions(+), 28 deletions(-)

LGTM

Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers
  2023-08-03  1:02 ` [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers Jakub Kicinski
@ 2023-08-03 14:09   ` Jesper Dangaard Brouer
  2023-08-03 19:34   ` Horatiu Vultur
  1 sibling, 0 replies; 10+ messages in thread
From: Jesper Dangaard Brouer @ 2023-08-03 14:09 UTC (permalink / raw)
  To: Jakub Kicinski, ast
  Cc: netdev, bpf, amritha.nambiar, aleksander.lobakin, Wei Fang,
	Gerhard Engleder, j.vosburgh, andy, shayagr, akiyano,
	ioana.ciornei, claudiu.manoil, vladimir.oltean, shenwei.wang,
	xiaoning.wang, linux-imx, dmichail, jeroendb, pkaligineedi,
	shailend, jesse.brandeburg, anthony.l.nguyen, horatiu.vultur,
	UNGLinuxDriver, kys, haiyangz, wei.liu, decui, peppe.cavallaro,
	alexandre.torgue, joabreu, mcoquelin.stm32, grygorii.strashko,
	longli, sharmaajay, daniel, john.fastabend, simon.horman, leon,
	linux-hyperv



On 03/08/2023 03.02, Jakub Kicinski wrote:
> Handful of drivers currently expect to get xdp.h by virtue
> of including netdevice.h. This will soon no longer be the case
> so add explicit includes.
> 
> Reviewed-by: Wei Fang<wei.fang@nxp.com>
> Reviewed-by: Gerhard Engleder<gerhard@engleder-embedded.com>
> Signed-off-by: Jakub Kicinski<kuba@kernel.org>
> ---

LGTM

Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next v2 2/3] net: move struct netdev_rx_queue out of netdevice.h
  2023-08-03  1:02 ` [PATCH bpf-next v2 2/3] net: move struct netdev_rx_queue out of netdevice.h Jakub Kicinski
@ 2023-08-03 14:24   ` Jesper Dangaard Brouer
  2023-08-03 15:52   ` Alexander Lobakin
  1 sibling, 0 replies; 10+ messages in thread
From: Jesper Dangaard Brouer @ 2023-08-03 14:24 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, bpf, amritha.nambiar, aleksander.lobakin, mst, jasowang,
	xuanzhuo, ast, daniel, andrii, martin.lau, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, bjorn,
	magnus.karlsson, maciej.fijalkowski, jonathan.lemon, gregkh,
	wangyufen, virtualization



On 03/08/2023 03.02, Jakub Kicinski wrote:
> struct netdev_rx_queue is touched in only a few places
> and having it defined in netdevice.h brings in the dependency
> on xdp.h, because struct xdp_rxq_info gets embedded in
> struct netdev_rx_queue.
> 
> In prep for removal of xdp.h from netdevice.h move all
> the netdev_rx_queue stuff to a new header.
> 
> We could technically break the new header up to avoid
> the sysfs.h include but it's so rarely included it
> doesn't seem to be worth it at this point.
> 
> Reviewed-by: Amritha Nambiar<amritha.nambiar@intel.com>
> Signed-off-by: Jakub Kicinski<kuba@kernel.org>
> ---

Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling
  2023-08-03  1:02 [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling Jakub Kicinski
                   ` (2 preceding siblings ...)
  2023-08-03  1:02 ` [PATCH bpf-next v2 3/3] net: invert the netdevice.h vs xdp.h dependency Jakub Kicinski
@ 2023-08-03 15:50 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-03 15:50 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: ast, netdev, bpf, hawk, amritha.nambiar, aleksander.lobakin

Hello:

This series was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:

On Wed,  2 Aug 2023 18:02:27 -0700 you wrote:
> While poking at struct netdev_rx_queue I got annoyed by
> the huge rebuild times. I split it out from netdevice.h
> and then realized that it was the main reason we included
> xdp.h in there. So I removed that dependency as well.
> 
> This gives us very pleasant build times for both xdp.h
> and struct netdev_rx_queue changes.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,1/3] eth: add missing xdp.h includes in drivers
    https://git.kernel.org/bpf/bpf-next/c/92272ec4107e
  - [bpf-next,v2,2/3] net: move struct netdev_rx_queue out of netdevice.h
    https://git.kernel.org/bpf/bpf-next/c/49e47a5b6145
  - [bpf-next,v2,3/3] net: invert the netdevice.h vs xdp.h dependency
    https://git.kernel.org/bpf/bpf-next/c/680ee0456a57

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next v2 2/3] net: move struct netdev_rx_queue out of netdevice.h
  2023-08-03  1:02 ` [PATCH bpf-next v2 2/3] net: move struct netdev_rx_queue out of netdevice.h Jakub Kicinski
  2023-08-03 14:24   ` Jesper Dangaard Brouer
@ 2023-08-03 15:52   ` Alexander Lobakin
  1 sibling, 0 replies; 10+ messages in thread
From: Alexander Lobakin @ 2023-08-03 15:52 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: ast, netdev, bpf, hawk, amritha.nambiar, mst, jasowang, xuanzhuo,
	daniel, andrii, martin.lau, song, yonghong.song, john.fastabend,
	kpsingh, sdf, haoluo, jolsa, bjorn, magnus.karlsson,
	maciej.fijalkowski, jonathan.lemon, gregkh, wangyufen,
	virtualization

From: Jakub Kicinski <kuba@kernel.org>
Date: Wed,  2 Aug 2023 18:02:29 -0700

> struct netdev_rx_queue is touched in only a few places
> and having it defined in netdevice.h brings in the dependency
> on xdp.h, because struct xdp_rxq_info gets embedded in
> struct netdev_rx_queue.

[...]

> +static inline struct netdev_rx_queue *
> +__netif_get_rx_queue(struct net_device *dev, unsigned int rxq)
> +{
> +	return dev->_rx + rxq;
> +}
> +
> +#ifdef CONFIG_SYSFS
> +static inline unsigned int
> +get_netdev_rx_queue_index(struct netdev_rx_queue *queue)
> +{
> +	struct net_device *dev = queue->dev;
> +	int index = queue - dev->_rx;
> +
> +	BUG_ON(index >= dev->num_rx_queues);
> +	return index;
> +}
> +#endif
> +#endif

Looks a bit confusing :s Could you separate then by a NL and leave a
comment near each one with the corresponding definition? Like

	return index;
}
#endif /* CONFIG_SYSFS */

#endif /* _LINUX_NETDEV_RX_QUEUE_H */

Maybe Alex could do that when applying, given that there are no more
change requests.

> diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
> index 7d47f53f20c1..0aac76c13fd4 100644
> --- a/net/bpf/test_run.c
> +++ b/net/bpf/test_run.c
> @@ -20,6 +20,7 @@

[...]

Thanks,
Olek

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers
  2023-08-03  1:02 ` [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers Jakub Kicinski
  2023-08-03 14:09   ` Jesper Dangaard Brouer
@ 2023-08-03 19:34   ` Horatiu Vultur
  1 sibling, 0 replies; 10+ messages in thread
From: Horatiu Vultur @ 2023-08-03 19:34 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: ast, netdev, bpf, hawk, amritha.nambiar, aleksander.lobakin,
	Wei Fang, Gerhard Engleder, j.vosburgh, andy, shayagr, akiyano,
	ioana.ciornei, claudiu.manoil, vladimir.oltean, shenwei.wang,
	xiaoning.wang, linux-imx, dmichail, jeroendb, pkaligineedi,
	shailend, jesse.brandeburg, anthony.l.nguyen, UNGLinuxDriver, kys,
	haiyangz, wei.liu, decui, peppe.cavallaro, alexandre.torgue,
	joabreu, mcoquelin.stm32, grygorii.strashko, longli, sharmaajay,
	daniel, john.fastabend, simon.horman, leon, linux-hyperv

The 08/02/2023 18:02, Jakub Kicinski wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Handful of drivers currently expect to get xdp.h by virtue
> of including netdevice.h. This will soon no longer be the case
> so add explicit includes.
> 
> Reviewed-by: Wei Fang <wei.fang@nxp.com>
> Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>

> ---
> v2: try a little harder with the alphabetic order of includes
> 
> CC: j.vosburgh@gmail.com
> CC: andy@greyhouse.net
> CC: shayagr@amazon.com
> CC: akiyano@amazon.com
> CC: ioana.ciornei@nxp.com
> CC: claudiu.manoil@nxp.com
> CC: vladimir.oltean@nxp.com
> CC: shenwei.wang@nxp.com
> CC: xiaoning.wang@nxp.com
> CC: linux-imx@nxp.com
> CC: dmichail@fungible.com
> CC: jeroendb@google.com
> CC: pkaligineedi@google.com
> CC: shailend@google.com
> CC: jesse.brandeburg@intel.com
> CC: anthony.l.nguyen@intel.com
> CC: horatiu.vultur@microchip.com
> CC: UNGLinuxDriver@microchip.com
> CC: kys@microsoft.com
> CC: haiyangz@microsoft.com
> CC: wei.liu@kernel.org
> CC: decui@microsoft.com
> CC: peppe.cavallaro@st.com
> CC: alexandre.torgue@foss.st.com
> CC: joabreu@synopsys.com
> CC: mcoquelin.stm32@gmail.com
> CC: grygorii.strashko@ti.com
> CC: longli@microsoft.com
> CC: sharmaajay@microsoft.com
> CC: daniel@iogearbox.net
> CC: hawk@kernel.org
> CC: john.fastabend@gmail.com
> CC: simon.horman@corigine.com
> CC: leon@kernel.org
> CC: linux-hyperv@vger.kernel.org
> CC: bpf@vger.kernel.org
> ---
>  drivers/net/bonding/bond_main.c                       | 1 +
>  drivers/net/ethernet/amazon/ena/ena_netdev.h          | 1 +
>  drivers/net/ethernet/engleder/tsnep.h                 | 1 +
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h      | 1 +
>  drivers/net/ethernet/freescale/enetc/enetc.h          | 1 +
>  drivers/net/ethernet/freescale/fec.h                  | 1 +
>  drivers/net/ethernet/fungible/funeth/funeth_txrx.h    | 1 +
>  drivers/net/ethernet/google/gve/gve.h                 | 1 +
>  drivers/net/ethernet/intel/igc/igc.h                  | 1 +
>  drivers/net/ethernet/microchip/lan966x/lan966x_main.h | 1 +
>  drivers/net/ethernet/microsoft/mana/mana_en.c         | 1 +
>  drivers/net/ethernet/stmicro/stmmac/stmmac.h          | 1 +
>  drivers/net/ethernet/ti/cpsw_priv.h                   | 1 +
>  drivers/net/hyperv/hyperv_net.h                       | 1 +
>  drivers/net/tap.c                                     | 1 +
>  include/net/mana/mana.h                               | 2 ++
>  16 files changed, 17 insertions(+)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 7a0f25301f7e..2f21cca4fdaf 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -90,6 +90,7 @@
>  #include <net/tls.h>
>  #endif
>  #include <net/ip6_route.h>
> +#include <net/xdp.h>
> 
>  #include "bonding_priv.h"
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
> index 248b715b4d68..33c923e1261a 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
> @@ -14,6 +14,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/netdevice.h>
>  #include <linux/skbuff.h>
> +#include <net/xdp.h>
>  #include <uapi/linux/bpf.h>
> 
>  #include "ena_com.h"
> diff --git a/drivers/net/ethernet/engleder/tsnep.h b/drivers/net/ethernet/engleder/tsnep.h
> index 11b29f56aaf9..6e14c918e3fb 100644
> --- a/drivers/net/ethernet/engleder/tsnep.h
> +++ b/drivers/net/ethernet/engleder/tsnep.h
> @@ -14,6 +14,7 @@
>  #include <linux/net_tstamp.h>
>  #include <linux/ptp_clock_kernel.h>
>  #include <linux/miscdevice.h>
> +#include <net/xdp.h>
> 
>  #define TSNEP "tsnep"
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> index d56d7a13262e..bfb6c96c3b2f 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> @@ -12,6 +12,7 @@
>  #include <linux/fsl/mc.h>
>  #include <linux/net_tstamp.h>
>  #include <net/devlink.h>
> +#include <net/xdp.h>
> 
>  #include <soc/fsl/dpaa2-io.h>
>  #include <soc/fsl/dpaa2-fd.h>
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h
> index 8577cf7699a0..7439739cd81a 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.h
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.h
> @@ -11,6 +11,7 @@
>  #include <linux/if_vlan.h>
>  #include <linux/phylink.h>
>  #include <linux/dim.h>
> +#include <net/xdp.h>
> 
>  #include "enetc_hw.h"
> 
> diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
> index 8f1edcca96c4..5a0974e62f99 100644
> --- a/drivers/net/ethernet/freescale/fec.h
> +++ b/drivers/net/ethernet/freescale/fec.h
> @@ -22,6 +22,7 @@
>  #include <linux/timecounter.h>
>  #include <dt-bindings/firmware/imx/rsrc.h>
>  #include <linux/firmware/imx/sci.h>
> +#include <net/xdp.h>
> 
>  #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
>      defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
> diff --git a/drivers/net/ethernet/fungible/funeth/funeth_txrx.h b/drivers/net/ethernet/fungible/funeth/funeth_txrx.h
> index 53b7e95213a8..5eec552a1f24 100644
> --- a/drivers/net/ethernet/fungible/funeth/funeth_txrx.h
> +++ b/drivers/net/ethernet/fungible/funeth/funeth_txrx.h
> @@ -5,6 +5,7 @@
> 
>  #include <linux/netdevice.h>
>  #include <linux/u64_stats_sync.h>
> +#include <net/xdp.h>
> 
>  /* Tx descriptor size */
>  #define FUNETH_SQE_SIZE 64U
> diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h
> index 4b425bf71ede..a31256f70348 100644
> --- a/drivers/net/ethernet/google/gve/gve.h
> +++ b/drivers/net/ethernet/google/gve/gve.h
> @@ -11,6 +11,7 @@
>  #include <linux/netdevice.h>
>  #include <linux/pci.h>
>  #include <linux/u64_stats_sync.h>
> +#include <net/xdp.h>
> 
>  #include "gve_desc.h"
>  #include "gve_desc_dqo.h"
> diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
> index 9db384f66a8e..4bffc3cb502f 100644
> --- a/drivers/net/ethernet/intel/igc/igc.h
> +++ b/drivers/net/ethernet/intel/igc/igc.h
> @@ -15,6 +15,7 @@
>  #include <linux/net_tstamp.h>
>  #include <linux/bitfield.h>
>  #include <linux/hrtimer.h>
> +#include <net/xdp.h>
> 
>  #include "igc_hw.h"
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
> index 27f272831ea5..eb7d81b5e9f8 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
> @@ -14,6 +14,7 @@
>  #include <net/pkt_cls.h>
>  #include <net/pkt_sched.h>
>  #include <net/switchdev.h>
> +#include <net/xdp.h>
> 
>  #include <vcap_api.h>
>  #include <vcap_api_client.h>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index ac2acc9aca9d..21665f114fe9 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -11,6 +11,7 @@
> 
>  #include <net/checksum.h>
>  #include <net/ip6_checksum.h>
> +#include <net/xdp.h>
> 
>  #include <net/mana/mana.h>
>  #include <net/mana/mana_auxiliary.h>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> index 4ce5eaaae513..a6d034968654 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
> @@ -22,6 +22,7 @@
>  #include <linux/net_tstamp.h>
>  #include <linux/reset.h>
>  #include <net/page_pool.h>
> +#include <net/xdp.h>
>  #include <uapi/linux/bpf.h>
> 
>  struct stmmac_resources {
> diff --git a/drivers/net/ethernet/ti/cpsw_priv.h b/drivers/net/ethernet/ti/cpsw_priv.h
> index 34230145ca0b..0e27c433098d 100644
> --- a/drivers/net/ethernet/ti/cpsw_priv.h
> +++ b/drivers/net/ethernet/ti/cpsw_priv.h
> @@ -6,6 +6,7 @@
>  #ifndef DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_
>  #define DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_
> 
> +#include <net/xdp.h>
>  #include <uapi/linux/bpf.h>
> 
>  #include "davinci_cpdma.h"
> diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> index c9dd69dbe1b8..810977952f95 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -16,6 +16,7 @@
>  #include <linux/hyperv.h>
>  #include <linux/rndis.h>
>  #include <linux/jhash.h>
> +#include <net/xdp.h>
> 
>  /* RSS related */
>  #define OID_GEN_RECEIVE_SCALE_CAPABILITIES 0x00010203  /* query only */
> diff --git a/drivers/net/tap.c b/drivers/net/tap.c
> index 9137fb8c1c42..b196a2a54355 100644
> --- a/drivers/net/tap.c
> +++ b/drivers/net/tap.c
> @@ -22,6 +22,7 @@
>  #include <net/net_namespace.h>
>  #include <net/rtnetlink.h>
>  #include <net/sock.h>
> +#include <net/xdp.h>
>  #include <linux/virtio_net.h>
>  #include <linux/skb_array.h>
> 
> diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
> index 024ad8ddb27e..1ccdca03e166 100644
> --- a/include/net/mana/mana.h
> +++ b/include/net/mana/mana.h
> @@ -4,6 +4,8 @@
>  #ifndef _MANA_H
>  #define _MANA_H
> 
> +#include <net/xdp.h>
> +
>  #include "gdma.h"
>  #include "hw_channel.h"
> 
> --
> 2.41.0
> 

-- 
/Horatiu

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-08-03 19:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03  1:02 [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling Jakub Kicinski
2023-08-03  1:02 ` [PATCH bpf-next v2 1/3] eth: add missing xdp.h includes in drivers Jakub Kicinski
2023-08-03 14:09   ` Jesper Dangaard Brouer
2023-08-03 19:34   ` Horatiu Vultur
2023-08-03  1:02 ` [PATCH bpf-next v2 2/3] net: move struct netdev_rx_queue out of netdevice.h Jakub Kicinski
2023-08-03 14:24   ` Jesper Dangaard Brouer
2023-08-03 15:52   ` Alexander Lobakin
2023-08-03  1:02 ` [PATCH bpf-next v2 3/3] net: invert the netdevice.h vs xdp.h dependency Jakub Kicinski
2023-08-03 13:59   ` Jesper Dangaard Brouer
2023-08-03 15:50 ` [PATCH bpf-next v2 0/3] net: struct netdev_rx_queue and xdp.h reshuffling patchwork-bot+netdevbpf

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).