From: Jesper Dangaard Brouer <brouer@redhat.com>
To: netdev@vger.kernel.org, Daniel Borkmann <borkmann@iogearbox.net>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Jesper Dangaard Brouer <brouer@redhat.com>
Cc: liu.song.a23@gmail.com, songliubraving@fb.com,
John Fastabend <john.fastabend@gmail.com>
Subject: [bpf-next PATCH 4/5] tun: remove ndo_xdp_flush call tun_xdp_flush
Date: Tue, 05 Jun 2018 13:55:45 +0200 [thread overview]
Message-ID: <152819974582.7083.15640103139789286081.stgit@firesoul> (raw)
In-Reply-To: <152819969561.7083.15427306662397720502.stgit@firesoul>
Remove the ndo_xdp_flush call implementation tun_xdp_flush
as no callers of ndo_xdp_flush are left.
The tun drivers XDP_TX implementation also used tun_xdp_flush (and
tun_xdp_xmit). This is easily solved by passing the XDP_XMIT_FLUSH
flag to tun_xdp_xmit in tun_xdp_tx.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
drivers/net/tun.c | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index d82a05fb0594..ef09224496e8 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1347,26 +1347,7 @@ static int tun_xdp_tx(struct net_device *dev, struct xdp_buff *xdp)
if (unlikely(!frame))
return -EOVERFLOW;
- return tun_xdp_xmit(dev, 1, &frame, 0);
-}
-
-static void tun_xdp_flush(struct net_device *dev)
-{
- struct tun_struct *tun = netdev_priv(dev);
- struct tun_file *tfile;
- u32 numqueues;
-
- rcu_read_lock();
-
- numqueues = READ_ONCE(tun->numqueues);
- if (!numqueues)
- goto out;
-
- tfile = rcu_dereference(tun->tfiles[smp_processor_id() %
- numqueues]);
- __tun_xdp_flush_tfile(tfile);
-out:
- rcu_read_unlock();
+ return tun_xdp_xmit(dev, 1, &frame, XDP_XMIT_FLUSH);
}
static const struct net_device_ops tap_netdev_ops = {
@@ -1387,7 +1368,6 @@ static const struct net_device_ops tap_netdev_ops = {
.ndo_get_stats64 = tun_net_get_stats64,
.ndo_bpf = tun_xdp,
.ndo_xdp_xmit = tun_xdp_xmit,
- .ndo_xdp_flush = tun_xdp_flush,
};
static void tun_flow_init(struct tun_struct *tun)
@@ -1706,7 +1686,6 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
alloc_frag->offset += buflen;
if (tun_xdp_tx(tun->dev, &xdp))
goto err_redirect;
- tun_xdp_flush(tun->dev);
rcu_read_unlock();
preempt_enable();
return NULL;
next prev parent reply other threads:[~2018-06-05 11:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 11:55 [bpf-next PATCH 0/5] net/xdp: remove net_device operation ndo_xdp_flush Jesper Dangaard Brouer
2018-06-05 11:55 ` [bpf-next PATCH 1/5] i40e: remove ndo_xdp_flush call i40e_xdp_flush Jesper Dangaard Brouer
2018-06-05 11:55 ` [bpf-next PATCH 2/5] ixgbe: remove ndo_xdp_flush call ixgbe_xdp_flush Jesper Dangaard Brouer
2018-06-05 11:55 ` [bpf-next PATCH 3/5] virtio_net: remove ndo_xdp_flush call virtnet_xdp_flush Jesper Dangaard Brouer
2018-06-05 11:55 ` Jesper Dangaard Brouer [this message]
2018-06-05 11:55 ` [bpf-next PATCH 5/5] net: remove net_device operation ndo_xdp_flush Jesper Dangaard Brouer
2018-06-05 12:38 ` [bpf-next PATCH 0/5] net/xdp: " Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=152819974582.7083.15640103139789286081.stgit@firesoul \
--to=brouer@redhat.com \
--cc=alexei.starovoitov@gmail.com \
--cc=borkmann@iogearbox.net \
--cc=john.fastabend@gmail.com \
--cc=liu.song.a23@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox