summaryrefslogtreecommitdiff
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorMartin KaFai Lau <martin.lau@kernel.org>2023-08-03 08:38:07 -0700
committerMartin KaFai Lau <martin.lau@kernel.org>2023-08-03 08:38:53 -0700
commit648880e9331c68b2008430fd90f3648d1795399d (patch)
tree738e89e1fdb86967ee4f9d3f266bacde2d9fc170 /include/linux/netdevice.h
parent87dc2bb3291832994d216c7c86e3f4898022272f (diff)
parent680ee0456a5712309db9ec2692e908ea1d6b1644 (diff)
Merge branch 'net: struct netdev_rx_queue and xdp.h reshuffling'
Jakub Kicinski says: ==================== 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/ ==================== Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h55
1 files changed, 4 insertions, 51 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3800d0479698..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);
@@ -782,32 +785,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,
@@ -1654,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
*
@@ -3828,24 +3799,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);