[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC net-next 03/18] net: core: export do_xdp_generic_core()
From: |
Prashant Bhole |
Subject: |
[RFC net-next 03/18] net: core: export do_xdp_generic_core() |
Date: |
Tue, 26 Nov 2019 19:07:29 +0900 |
From: Jason Wang <address@hidden>
Let's export do_xdp_generic as a general purpose function. It will
just run XDP program on skb but will not handle XDP actions.
Signed-off-by: Jason Wang <address@hidden>
Signed-off-by: Prashant Bhole <address@hidden>
---
include/linux/netdevice.h | 2 ++
net/core/dev.c | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9e6fb8524d91..2b6317ac9795 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3648,6 +3648,8 @@ static inline void dev_consume_skb_any(struct sk_buff
*skb)
void generic_xdp_tx(struct sk_buff *skb, struct bpf_prog *xdp_prog);
int do_xdp_generic(struct bpf_prog *xdp_prog, struct sk_buff *skb);
+u32 do_xdp_generic_core(struct sk_buff *skb, struct xdp_buff *xdp,
+ struct bpf_prog *xdp_prog);
int netif_rx(struct sk_buff *skb);
int netif_rx_ni(struct sk_buff *skb);
int netif_receive_skb(struct sk_buff *skb);
diff --git a/net/core/dev.c b/net/core/dev.c
index 5ae647b9914f..d97c3f35e047 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4461,9 +4461,8 @@ static struct netdev_rx_queue *netif_get_rxqueue(struct
sk_buff *skb)
return rxqueue;
}
-static u32 do_xdp_generic_core(struct sk_buff *skb,
- struct xdp_buff *xdp,
- struct bpf_prog *xdp_prog)
+u32 do_xdp_generic_core(struct sk_buff *skb, struct xdp_buff *xdp,
+ struct bpf_prog *xdp_prog)
{
struct netdev_rx_queue *rxqueue;
void *orig_data, *orig_data_end;
@@ -4574,6 +4573,7 @@ static u32 do_xdp_generic_core(struct sk_buff *skb,
return act;
}
+EXPORT_SYMBOL_GPL(do_xdp_generic_core);
/* When doing generic XDP we have to bypass the qdisc layer and the
* network taps in order to match in-driver-XDP behavior.
--
2.20.1
- Re: [RFC net-next 15/18] virtio_net: implement XDP prog offload functionality, (continued)
- [RFC net-next 10/18] tun: handle XDP_TX action of offloaded program, Prashant Bhole, 2019/11/26
- [RFC net-next 09/18] tun: add a way to inject Tx path packet into Rx path, Prashant Bhole, 2019/11/26
- [RFC net-next 07/18] tun: set offloaded xdp program, Prashant Bhole, 2019/11/26
- [RFC net-next 02/18] net: core: rename netif_receive_generic_xdp() to do_generic_xdp_core(), Prashant Bhole, 2019/11/26
- [RFC net-next 01/18] bpf: introduce bpf_prog_offload_verifier_setup(), Prashant Bhole, 2019/11/26
- [RFC net-next 13/18] virtio_net: use XDP attachment helpers, Prashant Bhole, 2019/11/26
- [RFC net-next 11/18] tun: run xdp prog when tun is read from file interface, Prashant Bhole, 2019/11/26
- [RFC net-next 08/18] tun: run offloaded XDP program in Tx path, Prashant Bhole, 2019/11/26
- [RFC net-next 06/18] tuntap: remove usage of ptr ring in vhost_net, Prashant Bhole, 2019/11/26
- [RFC net-next 03/18] net: core: export do_xdp_generic_core(),
Prashant Bhole <=
- [RFC net-next 05/18] vhost_net: user tap recvmsg api to access ptr ring, Prashant Bhole, 2019/11/26
- Re: [RFC net-next 00/18] virtio_net XDP offload, Jakub Kicinski, 2019/11/26
- Re: [RFC net-next 00/18] virtio_net XDP offload, Michael S. Tsirkin, 2019/11/27
- Re: [RFC net-next 00/18] virtio_net XDP offload, Alexei Starovoitov, 2019/11/27