[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200413171801.54406-7-dsahern@kernel.org>
Date: Mon, 13 Apr 2020 11:17:55 -0600
From: David Ahern <dsahern@...nel.org>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org,
prashantbhole.linux@...il.com, jasowang@...hat.com,
brouer@...hat.com, toke@...hat.com, toshiaki.makita1@...il.com,
daniel@...earbox.net, john.fastabend@...il.com, ast@...nel.org,
kafai@...com, songliubraving@...com, yhs@...com, andriin@...com,
dsahern@...il.com, David Ahern <dahern@...italocean.com>
Subject: [PATCH RFC-v5 bpf-next 06/12] net: core: Rename do_xdp_generic to do_xdp_generic_rx
From: David Ahern <dahern@...italocean.com>
Rename do_xdp_generic to do_xdp_generic_rx to emphasize its use in the
Rx path.
Signed-off-by: Jason Wang <jasowang@...hat.com>
Signed-off-by: Prashant Bhole <prashantbhole.linux@...il.com>
Signed-off-by: David Ahern <dahern@...italocean.com>
---
drivers/net/tun.c | 4 ++--
include/linux/netdevice.h | 2 +-
net/core/dev.c | 7 ++++---
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 228fe449dc6d..20d94bf79cf7 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1895,7 +1895,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
rcu_read_lock();
xdp_prog = rcu_dereference(tun->xdp_prog);
if (xdp_prog) {
- ret = do_xdp_generic(xdp_prog, skb);
+ ret = do_xdp_generic_rx(xdp_prog, skb);
if (ret != XDP_PASS) {
rcu_read_unlock();
local_bh_enable();
@@ -2459,7 +2459,7 @@ static int tun_xdp_one(struct tun_struct *tun,
skb_probe_transport_header(skb);
if (skb_xdp) {
- err = do_xdp_generic(xdp_prog, skb);
+ err = do_xdp_generic_rx(xdp_prog, skb);
if (err != XDP_PASS)
goto out;
}
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3133247681fd..2649f2b36858 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3711,7 +3711,7 @@ 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);
+int do_xdp_generic_rx(struct bpf_prog *xdp_prog, struct sk_buff *skb);
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 4f0c4fee1125..6da613fb6623 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4620,7 +4620,7 @@ void generic_xdp_tx(struct sk_buff *skb, struct bpf_prog *xdp_prog)
static DEFINE_STATIC_KEY_FALSE(generic_xdp_needed_key);
-int do_xdp_generic(struct bpf_prog *xdp_prog, struct sk_buff *skb)
+int do_xdp_generic_rx(struct bpf_prog *xdp_prog, struct sk_buff *skb)
{
/* Reinjected packets coming from act_mirred or similar should
* not get XDP generic processing.
@@ -4667,7 +4667,7 @@ int do_xdp_generic(struct bpf_prog *xdp_prog, struct sk_buff *skb)
kfree_skb(skb);
return XDP_DROP;
}
-EXPORT_SYMBOL_GPL(do_xdp_generic);
+EXPORT_SYMBOL_GPL(do_xdp_generic_rx);
static int netif_rx_internal(struct sk_buff *skb)
{
@@ -5017,7 +5017,8 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc,
int ret2;
preempt_disable();
- ret2 = do_xdp_generic(rcu_dereference(skb->dev->xdp_prog), skb);
+ ret2 = do_xdp_generic_rx(rcu_dereference(skb->dev->xdp_prog),
+ skb);
preempt_enable();
if (ret2 != XDP_PASS)
--
2.21.1 (Apple Git-122.3)
Powered by blists - more mailing lists