xsk: replace ndo_xsk_async_xmit with ndo_xsk_wakeup
This commit replaces ndo_xsk_async_xmit with ndo_xsk_wakeup. This new ndo provides the same functionality as before but with the addition of a new flags field that is used to specifiy if Rx, Tx or both should be woken up. The previous ndo only woke up Tx, as implied by the name. The i40e and ixgbe drivers (which are all the supported ones) are updated with this new interface. This new ndo will be used by the new need_wakeup functionality of XDP sockets that need to be able to wake up both Rx and Tx driver processing. Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com> Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:

committed by
Daniel Borkmann

parent
e03250061b
commit
9116e5e2b1
@@ -901,6 +901,10 @@ struct netdev_bpf {
|
||||
};
|
||||
};
|
||||
|
||||
/* Flags for ndo_xsk_wakeup. */
|
||||
#define XDP_WAKEUP_RX (1 << 0)
|
||||
#define XDP_WAKEUP_TX (1 << 1)
|
||||
|
||||
#ifdef CONFIG_XFRM_OFFLOAD
|
||||
struct xfrmdev_ops {
|
||||
int (*xdo_dev_state_add) (struct xfrm_state *x);
|
||||
@@ -1227,6 +1231,12 @@ struct tlsdev_ops;
|
||||
* that got dropped are freed/returned via xdp_return_frame().
|
||||
* Returns negative number, means general error invoking ndo, meaning
|
||||
* no frames were xmit'ed and core-caller will free all frames.
|
||||
* int (*ndo_xsk_wakeup)(struct net_device *dev, u32 queue_id, u32 flags);
|
||||
* This function is used to wake up the softirq, ksoftirqd or kthread
|
||||
* responsible for sending and/or receiving packets on a specific
|
||||
* queue id bound to an AF_XDP socket. The flags field specifies if
|
||||
* only RX, only Tx, or both should be woken up using the flags
|
||||
* XDP_WAKEUP_RX and XDP_WAKEUP_TX.
|
||||
* struct devlink_port *(*ndo_get_devlink_port)(struct net_device *dev);
|
||||
* Get devlink port instance associated with a given netdev.
|
||||
* Called with a reference on the netdevice and devlink locks only,
|
||||
@@ -1426,8 +1436,8 @@ struct net_device_ops {
|
||||
int (*ndo_xdp_xmit)(struct net_device *dev, int n,
|
||||
struct xdp_frame **xdp,
|
||||
u32 flags);
|
||||
int (*ndo_xsk_async_xmit)(struct net_device *dev,
|
||||
u32 queue_id);
|
||||
int (*ndo_xsk_wakeup)(struct net_device *dev,
|
||||
u32 queue_id, u32 flags);
|
||||
struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user