Netdev List
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: netdev@vger.kernel.org
Cc: Daniel Borkmann <borkmann@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>
Subject: [V2 PATCH net-next 1/5] xdp: remove bpf_warn_invalid_xdp_redirect
Date: Wed, 23 Aug 2017 12:15:20 +0200	[thread overview]
Message-ID: <150348332000.23476.2108908505323595829.stgit@firesoul> (raw)
In-Reply-To: <150348327373.23476.14851572406177222309.stgit@firesoul>

Given there is a tracepoint that can track the error code
of xdp_do_redirect calls, the WARN_ONCE in bpf_warn_invalid_xdp_redirect
doesn't seem relevant any longer.  Simply remove the function.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 net/core/filter.c |    8 --------
 1 file changed, 8 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index fa2115695037..31c579749679 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2499,7 +2499,6 @@ static int __bpf_tx_xdp(struct net_device *dev,
 	int err;
 
 	if (!dev->netdev_ops->ndo_xdp_xmit) {
-		bpf_warn_invalid_xdp_redirect(dev->ifindex);
 		return -EOPNOTSUPP;
 	}
 
@@ -2572,7 +2571,6 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp,
 	fwd = dev_get_by_index_rcu(dev_net(dev), index);
 	ri->ifindex = 0;
 	if (unlikely(!fwd)) {
-		bpf_warn_invalid_xdp_redirect(index);
 		err = -EINVAL;
 		goto out;
 	}
@@ -2593,7 +2591,6 @@ int xdp_do_generic_redirect(struct net_device *dev, struct sk_buff *skb)
 	dev = dev_get_by_index_rcu(dev_net(dev), index);
 	ri->ifindex = 0;
 	if (unlikely(!dev)) {
-		bpf_warn_invalid_xdp_redirect(index);
 		goto err;
 	}
 
@@ -3573,11 +3570,6 @@ void bpf_warn_invalid_xdp_action(u32 act)
 }
 EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
 
-void bpf_warn_invalid_xdp_redirect(u32 ifindex)
-{
-	WARN_ONCE(1, "Illegal XDP redirect to unsupported device ifindex(%i)\n", ifindex);
-}
-
 static bool __is_valid_sock_ops_access(int off, int size)
 {
 	if (off < 0 || off >= sizeof(struct bpf_sock_ops))

  reply	other threads:[~2017-08-23 10:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 20:47 [PATCH net-next 0/5] xdp: more work on xdp tracepoints Jesper Dangaard Brouer
2017-08-22 20:47 ` [PATCH net-next 1/5] xdp: remove bpf_warn_invalid_xdp_redirect Jesper Dangaard Brouer
2017-08-22 21:19   ` Daniel Borkmann
2017-08-22 20:47 ` [PATCH net-next 2/5] xdp: make generic xdp redirect use tracepoint trace_xdp_redirect Jesper Dangaard Brouer
2017-08-22 21:21   ` Daniel Borkmann
2017-08-22 20:47 ` [PATCH net-next 3/5] ixgbe: use return codes from ndo_xdp_xmit that are distinguishable Jesper Dangaard Brouer
2017-08-22 21:21   ` Daniel Borkmann
2017-08-22 20:47 ` [PATCH net-next 4/5] xdp: remove net_device names from xdp_redirect tracepoint Jesper Dangaard Brouer
2017-08-22 21:23   ` Daniel Borkmann
2017-08-22 20:47 ` [PATCH net-next 5/5] xdp: get tracepoints xdp_exception and xdp_redirect in sync Jesper Dangaard Brouer
2017-08-22 21:30   ` Daniel Borkmann
2017-08-23  7:41     ` Jesper Dangaard Brouer
2017-08-23  8:54       ` Daniel Borkmann
2017-08-23 10:15         ` [V2 PATCH net-next 0/5] xdp: more work on xdp tracepoints Jesper Dangaard Brouer
2017-08-23 10:15           ` Jesper Dangaard Brouer [this message]
2017-08-23 10:15           ` [V2 PATCH net-next 2/5] xdp: make generic xdp redirect use tracepoint trace_xdp_redirect Jesper Dangaard Brouer
2017-08-23 10:15           ` [V2 PATCH net-next 3/5] ixgbe: use return codes from ndo_xdp_xmit that are distinguishable Jesper Dangaard Brouer
2017-08-23 10:15           ` [V2 PATCH net-next 4/5] xdp: remove net_device names from xdp_redirect tracepoint Jesper Dangaard Brouer
2017-08-23 10:58             ` Daniel Borkmann
2017-08-23 10:15           ` [V2 PATCH net-next 5/5] xdp: get tracepoints xdp_exception and xdp_redirect in sync Jesper Dangaard Brouer
2017-08-23 10:59             ` Daniel Borkmann
2017-08-23 11:16           ` [V2 PATCH net-next 0/5] xdp: more work on xdp tracepoints Jesper Dangaard Brouer
2017-08-24  0:07             ` David Miller
2017-08-24 10:32               ` [V3 " Jesper Dangaard Brouer
2017-08-24 10:33                 ` [V3 PATCH net-next 1/5] xdp: remove bpf_warn_invalid_xdp_redirect Jesper Dangaard Brouer
2017-08-24 10:33                 ` [V3 PATCH net-next 2/5] xdp: make generic xdp redirect use tracepoint trace_xdp_redirect Jesper Dangaard Brouer
2017-08-24 10:33                 ` [V3 PATCH net-next 3/5] ixgbe: use return codes from ndo_xdp_xmit that are distinguishable Jesper Dangaard Brouer
2017-08-24 10:33                 ` [V3 PATCH net-next 4/5] xdp: remove net_device names from xdp_redirect tracepoint Jesper Dangaard Brouer
2017-08-24 10:33                 ` [V3 PATCH net-next 5/5] xdp: get tracepoints xdp_exception and xdp_redirect in sync Jesper Dangaard Brouer
2017-08-24 14:46                 ` [V3 PATCH net-next 0/5] xdp: more work on xdp tracepoints John Fastabend
2017-08-24 19:00                 ` David Miller

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=150348332000.23476.2108908505323595829.stgit@firesoul \
    --to=brouer@redhat.com \
    --cc=borkmann@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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