xdp: remove bpf_warn_invalid_xdp_redirect
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> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
fb3bbbda5f
commit
d08adb82fd
@@ -2476,7 +2476,6 @@ static int __bpf_tx_xdp(struct net_device *dev,
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (!dev->netdev_ops->ndo_xdp_xmit) {
|
if (!dev->netdev_ops->ndo_xdp_xmit) {
|
||||||
bpf_warn_invalid_xdp_redirect(dev->ifindex);
|
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2543,7 +2542,6 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp,
|
|||||||
fwd = dev_get_by_index_rcu(dev_net(dev), index);
|
fwd = dev_get_by_index_rcu(dev_net(dev), index);
|
||||||
ri->ifindex = 0;
|
ri->ifindex = 0;
|
||||||
if (unlikely(!fwd)) {
|
if (unlikely(!fwd)) {
|
||||||
bpf_warn_invalid_xdp_redirect(index);
|
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -2564,7 +2562,6 @@ int xdp_do_generic_redirect(struct net_device *dev, struct sk_buff *skb)
|
|||||||
dev = dev_get_by_index_rcu(dev_net(dev), index);
|
dev = dev_get_by_index_rcu(dev_net(dev), index);
|
||||||
ri->ifindex = 0;
|
ri->ifindex = 0;
|
||||||
if (unlikely(!dev)) {
|
if (unlikely(!dev)) {
|
||||||
bpf_warn_invalid_xdp_redirect(index);
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3565,11 +3562,6 @@ void bpf_warn_invalid_xdp_action(u32 act)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
|
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)
|
static bool __is_valid_sock_ops_access(int off, int size)
|
||||||
{
|
{
|
||||||
if (off < 0 || off >= sizeof(struct bpf_sock_ops))
|
if (off < 0 || off >= sizeof(struct bpf_sock_ops))
|
||||||
|
Reference in New Issue
Block a user