[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191218081050.10170-7-prashantbhole.linux@gmail.com>
Date: Wed, 18 Dec 2019 17:10:42 +0900
From: Prashant Bhole <prashantbhole.linux@...il.com>
To: "David S . Miller" <davem@...emloft.net>,
"Michael S . Tsirkin" <mst@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>
Cc: Jason Wang <jasowang@...hat.com>, David Ahern <dsahern@...il.com>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
John Fastabend <john.fastabend@...il.com>,
Toshiaki Makita <toshiaki.makita1@...il.com>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>, netdev@...r.kernel.org,
Prashant Bhole <prashantbhole.linux@...il.com>
Subject: [RFC net-next 06/14] net: core: export do_xdp_generic_core()
From: Jason Wang <jasowang@...hat.com>
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 <jasowang@...hat.com>
Signed-off-by: Prashant Bhole <prashantbhole.linux@...il.com>
---
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 7b5256d374d2..c637754819d3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3660,6 +3660,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 6bfe6fadea17..c45e8eaebf4f 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.21.0
Powered by blists - more mailing lists