Alexei Starovoitov says: ==================== pull-request: bpf-next 2021-12-30 The following pull-request contains BPF updates for your *net-next* tree. We've added 72 non-merge commits during the last 20 day(s) which contain a total of 223 files changed, 3510 insertions(+), 1591 deletions(-). The main changes are: 1) Automatic setrlimit in libbpf when bpf is memcg's in the kernel, from Andrii. 2) Beautify and de-verbose verifier logs, from Christy. 3) Composable verifier types, from Hao. 4) bpf_strncmp helper, from Hou. 5) bpf.h header dependency cleanup, from Jakub. 6) get_func_[arg|ret|arg_cnt] helpers, from Jiri. 7) Sleepable local storage, from KP. 8) Extend kfunc with PTR_TO_CTX, PTR_TO_MEM argument support, from Kumar. ====================
Showing the changes to drivers (65 of 221 files). Show all
Unified · Split
| @@ -6,6 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | */ |
| 7 | 7 | #include <linux/module.h> |
| 8 | 8 | #include <linux/firmware.h> |
| 9 | +#include <linux/vmalloc.h> | |
| 9 | 10 | |
| 10 | 11 | #include <net/bluetooth/bluetooth.h> |
| 11 | 12 | #include <net/bluetooth/hci_core.h> |
| @@ -33,6 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | * SOFTWARE. |
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | +#include <linux/if_vlan.h> | |
| 36 | 37 | #include <linux/module.h> |
| 37 | 38 | #include <linux/errno.h> |
| 38 | 39 | #include <linux/slab.h> |
| @@ -1,5 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB |
| 2 | 2 | /* Copyright (c) 2015 - 2021 Intel Corporation */ |
| 3 | +#include <linux/etherdevice.h> | |
| 4 | + | |
| 3 | 5 | #include "osdep.h" |
| 4 | 6 | #include "status.h" |
| 5 | 7 | #include "hmc.h" |
| @@ -1,5 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB |
| 2 | 2 | /* Copyright (c) 2016 - 2021 Intel Corporation */ |
| 3 | +#include <linux/etherdevice.h> | |
| 4 | + | |
| 3 | 5 | #include "osdep.h" |
| 4 | 6 | #include "status.h" |
| 5 | 7 | #include "hmc.h" |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | #include <linux/kref.h> |
| 34 | 34 | #include <linux/slab.h> |
| 35 | +#include <linux/sched/mm.h> | |
| 35 | 36 | #include <rdma/ib_umem.h> |
| 36 | 37 | |
| 37 | 38 | #include "mlx5_ib.h" |
| @@ -30,6 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | * SOFTWARE. |
| 31 | 31 | */ |
| 32 | 32 | |
| 33 | +#include <linux/etherdevice.h> | |
| 33 | 34 | #include <linux/module.h> |
| 34 | 35 | #include <rdma/ib_umem.h> |
| 35 | 36 | #include <rdma/ib_cache.h> |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | #include <linux/net.h> |
| 12 | 12 | #include <linux/igmp.h> |
| 13 | 13 | #include <linux/workqueue.h> |
| 14 | +#include <net/sch_generic.h> | |
| 14 | 15 | #include <net/net_namespace.h> |
| 15 | 16 | #include <net/ip.h> |
| 16 | 17 | #include <net/udp.h> |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | * of the GNU General Public License, incorporated herein by reference. |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | +#include <linux/compat.h> | |
| 26 | 27 | #include <linux/module.h> |
| 27 | 28 | #include <linux/kernel.h> |
| 28 | 29 | #include <linux/init.h> |
| @@ -35,6 +35,7 @@ · 34 unmodified lines | ||
| 35 | 35 | #include <linux/module.h> |
| 36 | 36 | #include <linux/types.h> |
| 37 | 37 | #include <linux/fcntl.h> |
| 38 | +#include <linux/filter.h> | |
| 38 | 39 | #include <linux/interrupt.h> |
| 39 | 40 | #include <linux/ptrace.h> |
| 40 | 41 | #include <linux/ioport.h> |
| @@ -8,6 +8,7 @@ · 7 unmodified lines | ||
| 8 | 8 | * |
| 9 | 9 | * Many thanks to Klaus Hitschler <klaus.hitschler@gmx.de> |
| 10 | 10 | */ |
| 11 | +#include <asm/unaligned.h> | |
| 11 | 12 | #include <linux/netdevice.h> |
| 12 | 13 | #include <linux/usb.h> |
| 13 | 14 | #include <linux/module.h> |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <linux/delay.h> |
| 11 | 11 | #include <linux/export.h> |
| 12 | 12 | #include <linux/gpio.h> |
| 13 | +#include <linux/if_vlan.h> | |
| 13 | 14 | #include <linux/kernel.h> |
| 14 | 15 | #include <linux/module.h> |
| 15 | 16 | #include <linux/platform_data/microchip-ksz.h> |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | #include <net/dsa.h> |
| 8 | +#include <linux/etherdevice.h> | |
| 8 | 9 | #include <linux/if_bridge.h> |
| 9 | 10 | #include <linux/of_device.h> |
| 10 | 11 | #include <linux/netdev_features.h> |
| @@ -434,7 +434,7 @@ static int ena_xdp_execute(struct ena_ring *rx_ring, struct xdp_buff *xdp) · 433 unmodified lines | ||
| 434 | 434 | xdp_stat = &rx_ring->rx_stats.xdp_pass; |
| 435 | 435 | break; |
| 436 | 436 | default: |
| 437 | − bpf_warn_invalid_xdp_action(verdict); | |
| 437 | + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, verdict); | |
| 438 | 438 | xdp_stat = &rx_ring->rx_stats.xdp_invalid; |
| 439 | 439 | } |
| 440 | 440 | |
| @@ -14,6 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | #include <linux/interrupt.h> |
| 15 | 15 | #include <linux/netdevice.h> |
| 16 | 16 | #include <linux/skbuff.h> |
| 17 | +#include <uapi/linux/bpf.h> | |
| 17 | 18 | |
| 18 | 19 | #include "ena_com.h" |
| 19 | 20 | #include "ena_eth_com.h" |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | #include <linux/pci.h> |
| 11 | 11 | #include <linux/netdevice.h> |
| 12 | +#include <linux/vmalloc.h> | |
| 12 | 13 | #include <net/devlink.h> |
| 13 | 14 | #include "bnxt_hsi.h" |
| 14 | 15 | #include "bnxt.h" |
| @@ -195,7 +195,7 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons, · 194 unmodified lines | ||
| 195 | 195 | *event |= BNXT_REDIRECT_EVENT; |
| 196 | 196 | break; |
| 197 | 197 | default: |
| 198 | − bpf_warn_invalid_xdp_action(act); | |
| 198 | + bpf_warn_invalid_xdp_action(bp->dev, xdp_prog, act); | |
| 199 | 199 | fallthrough; |
| 200 | 200 | case XDP_ABORTED: |
| 201 | 201 | trace_xdp_exception(bp->dev, xdp_prog, act); |
| @@ -590,7 +590,7 @@ static inline bool nicvf_xdp_rx(struct nicvf *nic, struct bpf_prog *prog, · 589 unmodified lines | ||
| 590 | 590 | nicvf_xdp_sq_append_pkt(nic, sq, (u64)xdp.data, dma_addr, len); |
| 591 | 591 | return true; |
| 592 | 592 | default: |
| 593 | − bpf_warn_invalid_xdp_action(action); | |
| 593 | + bpf_warn_invalid_xdp_action(nic->netdev, prog, action); | |
| 594 | 594 | fallthrough; |
| 595 | 595 | case XDP_ABORTED: |
| 596 | 596 | trace_xdp_exception(nic->netdev, prog, action); |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <linux/iommu.h> |
| 11 | 11 | #include <net/ip.h> |
| 12 | 12 | #include <net/tso.h> |
| 13 | +#include <uapi/linux/bpf.h> | |
| 13 | 14 | |
| 14 | 15 | #include "nic_reg.h" |
| 15 | 16 | #include "nic.h" |
| @@ -2623,7 +2623,7 @@ static u32 dpaa_run_xdp(struct dpaa_priv *priv, struct qm_fd *fd, void *vaddr, · 2622 unmodified lines | ||
| 2623 | 2623 | } |
| 2624 | 2624 | break; |
| 2625 | 2625 | default: |
| 2626 | − bpf_warn_invalid_xdp_action(xdp_act); | |
| 2626 | + bpf_warn_invalid_xdp_action(priv->net_dev, xdp_prog, xdp_act); | |
| 2627 | 2627 | fallthrough; |
| 2628 | 2628 | case XDP_ABORTED: |
| 2629 | 2629 | trace_xdp_exception(priv->net_dev, xdp_prog, xdp_act); |
| @@ -374,7 +374,7 @@ static u32 dpaa2_eth_run_xdp(struct dpaa2_eth_priv *priv, · 373 unmodified lines | ||
| 374 | 374 | dpaa2_eth_xdp_enqueue(priv, ch, fd, vaddr, rx_fq->flowid); |
| 375 | 375 | break; |
| 376 | 376 | default: |
| 377 | − bpf_warn_invalid_xdp_action(xdp_act); | |
| 377 | + bpf_warn_invalid_xdp_action(priv->net_dev, xdp_prog, xdp_act); | |
| 378 | 378 | fallthrough; |
| 379 | 379 | case XDP_ABORTED: |
| 380 | 380 | trace_xdp_exception(priv->net_dev, xdp_prog, xdp_act); |
| @@ -1547,7 +1547,7 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, · 1546 unmodified lines | ||
| 1547 | 1547 | |
| 1548 | 1548 | switch (xdp_act) { |
| 1549 | 1549 | default: |
| 1550 | − bpf_warn_invalid_xdp_action(xdp_act); | |
| 1550 | + bpf_warn_invalid_xdp_action(rx_ring->ndev, prog, xdp_act); | |
| 1551 | 1551 | fallthrough; |
| 1552 | 1552 | case XDP_ABORTED: |
| 1553 | 1553 | trace_xdp_exception(rx_ring->ndev, prog, xdp_act); |
| @@ -4,6 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | * Copyright(c) 2017 Huawei Technologies Co., Ltd |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | +#include <linux/if_vlan.h> | |
| 7 | 8 | #include <linux/kernel.h> |
| 8 | 9 | #include <linux/netdevice.h> |
| 9 | 10 | #include <linux/u64_stats_sync.h> |
| @@ -2322,7 +2322,7 @@ static int i40e_run_xdp(struct i40e_ring *rx_ring, struct xdp_buff *xdp) · 2321 unmodified lines | ||
| 2322 | 2322 | result = I40E_XDP_REDIR; |
| 2323 | 2323 | break; |
| 2324 | 2324 | default: |
| 2325 | − bpf_warn_invalid_xdp_action(act); | |
| 2325 | + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); | |
| 2326 | 2326 | fallthrough; |
| 2327 | 2327 | case XDP_ABORTED: |
| 2328 | 2328 | out_failure: |
| @@ -176,7 +176,7 @@ static int i40e_run_xdp_zc(struct i40e_ring *rx_ring, struct xdp_buff *xdp) · 175 unmodified lines | ||
| 176 | 176 | goto out_failure; |
| 177 | 177 | break; |
| 178 | 178 | default: |
| 179 | − bpf_warn_invalid_xdp_action(act); | |
| 179 | + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); | |
| 180 | 180 | fallthrough; |
| 181 | 181 | case XDP_ABORTED: |
| 182 | 182 | out_failure: |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | struct i40e_vsi; |
| 24 | 24 | struct xsk_buff_pool; |
| 25 | −struct zero_copy_allocator; | |
| 26 | 25 | |
| 27 | 26 | int i40e_queue_pair_disable(struct i40e_vsi *vsi, int queue_pair); |
| 28 | 27 | int i40e_queue_pair_enable(struct i40e_vsi *vsi, int queue_pair); |
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | /* Copyright (c) 2020, Intel Corporation. */ |
| 3 | 3 | |
| 4 | +#include <linux/vmalloc.h> | |
| 5 | + | |
| 4 | 6 | #include "ice.h" |
| 5 | 7 | #include "ice_lib.h" |
| 6 | 8 | #include "ice_devlink.h" |
| @@ -576,7 +576,7 @@ ice_run_xdp(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp, · 575 unmodified lines | ||
| 576 | 576 | goto out_failure; |
| 577 | 577 | return ICE_XDP_REDIR; |
| 578 | 578 | default: |
| 579 | − bpf_warn_invalid_xdp_action(act); | |
| 579 | + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); | |
| 580 | 580 | fallthrough; |
| 581 | 581 | case XDP_ABORTED: |
| 582 | 582 | out_failure: |
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | /* Copyright (c) 2019, Intel Corporation. */ |
| 3 | 3 | |
| 4 | +#include <linux/filter.h> | |
| 5 | + | |
| 4 | 6 | #include "ice_txrx_lib.h" |
| 5 | 7 | #include "ice_eswitch.h" |
| 6 | 8 | #include "ice_lib.h" |
| @@ -481,7 +481,7 @@ ice_run_xdp_zc(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp, · 480 unmodified lines | ||
| 481 | 481 | goto out_failure; |
| 482 | 482 | break; |
| 483 | 483 | default: |
| 484 | − bpf_warn_invalid_xdp_action(act); | |
| 484 | + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); | |
| 485 | 485 | fallthrough; |
| 486 | 486 | case XDP_ABORTED: |
| 487 | 487 | out_failure: |
| @@ -8500,7 +8500,7 @@ static struct sk_buff *igb_run_xdp(struct igb_adapter *adapter, · 8499 unmodified lines | ||
| 8500 | 8500 | result = IGB_XDP_REDIR; |
| 8501 | 8501 | break; |
| 8502 | 8502 | default: |
| 8503 | − bpf_warn_invalid_xdp_action(act); | |
| 8503 | + bpf_warn_invalid_xdp_action(adapter->netdev, xdp_prog, act); | |
| 8504 | 8504 | fallthrough; |
| 8505 | 8505 | case XDP_ABORTED: |
| 8506 | 8506 | out_failure: |
| @@ -2241,7 +2241,7 @@ static int __igc_xdp_run_prog(struct igc_adapter *adapter, · 2240 unmodified lines | ||
| 2241 | 2241 | return IGC_XDP_REDIRECT; |
| 2242 | 2242 | break; |
| 2243 | 2243 | default: |
| 2244 | − bpf_warn_invalid_xdp_action(act); | |
| 2244 | + bpf_warn_invalid_xdp_action(adapter->netdev, prog, act); | |
| 2245 | 2245 | fallthrough; |
| 2246 | 2246 | case XDP_ABORTED: |
| 2247 | 2247 | out_failure: |
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | /* Copyright (c) 2020, Intel Corporation. */ |
| 3 | 3 | |
| 4 | +#include <linux/if_vlan.h> | |
| 4 | 5 | #include <net/xdp_sock_drv.h> |
| 5 | 6 | |
| 6 | 7 | #include "igc.h" |
| @@ -2235,7 +2235,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter, · 2234 unmodified lines | ||
| 2235 | 2235 | result = IXGBE_XDP_REDIR; |
| 2236 | 2236 | break; |
| 2237 | 2237 | default: |
| 2238 | − bpf_warn_invalid_xdp_action(act); | |
| 2238 | + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); | |
| 2239 | 2239 | fallthrough; |
| 2240 | 2240 | case XDP_ABORTED: |
| 2241 | 2241 | out_failure: |
| @@ -35,8 +35,6 @@ int ixgbe_xsk_pool_setup(struct ixgbe_adapter *adapter, · 34 unmodified lines | ||
| 35 | 35 | struct xsk_buff_pool *pool, |
| 36 | 36 | u16 qid); |
| 37 | 37 | |
| 38 | −void ixgbe_zca_free(struct zero_copy_allocator *alloc, unsigned long handle); | |
| 39 | − | |
| 40 | 38 | bool ixgbe_alloc_rx_buffers_zc(struct ixgbe_ring *rx_ring, u16 cleaned_count); |
| 41 | 39 | int ixgbe_clean_rx_irq_zc(struct ixgbe_q_vector *q_vector, |
| 42 | 40 | struct ixgbe_ring *rx_ring, |
| @@ -131,7 +131,7 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter, · 130 unmodified lines | ||
| 131 | 131 | goto out_failure; |
| 132 | 132 | break; |
| 133 | 133 | default: |
| 134 | − bpf_warn_invalid_xdp_action(act); | |
| 134 | + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); | |
| 135 | 135 | fallthrough; |
| 136 | 136 | case XDP_ABORTED: |
| 137 | 137 | out_failure: |
| @@ -1070,7 +1070,7 @@ static struct sk_buff *ixgbevf_run_xdp(struct ixgbevf_adapter *adapter, · 1069 unmodified lines | ||
| 1070 | 1070 | goto out_failure; |
| 1071 | 1071 | break; |
| 1072 | 1072 | default: |
| 1073 | − bpf_warn_invalid_xdp_action(act); | |
| 1073 | + bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); | |
| 1074 | 1074 | fallthrough; |
| 1075 | 1075 | case XDP_ABORTED: |
| 1076 | 1076 | out_failure: |
| @@ -2240,7 +2240,7 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 2239 unmodified lines | ||
| 2240 | 2240 | mvneta_xdp_put_buff(pp, rxq, xdp, sinfo, sync); |
| 2241 | 2241 | break; |
| 2242 | 2242 | default: |
| 2243 | − bpf_warn_invalid_xdp_action(act); | |
| 2243 | + bpf_warn_invalid_xdp_action(pp->dev, prog, act); | |
| 2244 | 2244 | fallthrough; |
| 2245 | 2245 | case XDP_ABORTED: |
| 2246 | 2246 | trace_xdp_exception(pp->dev, prog, act); |
| @@ -3823,7 +3823,7 @@ mvpp2_run_xdp(struct mvpp2_port *port, struct bpf_prog *prog, · 3822 unmodified lines | ||
| 3823 | 3823 | } |
| 3824 | 3824 | break; |
| 3825 | 3825 | default: |
| 3826 | − bpf_warn_invalid_xdp_action(act); | |
| 3826 | + bpf_warn_invalid_xdp_action(port->dev, prog, act); | |
| 3827 | 3827 | fallthrough; |
| 3828 | 3828 | case XDP_ABORTED: |
| 3829 | 3829 | trace_xdp_exception(port->dev, prog, act); |
| @@ -1198,7 +1198,7 @@ static bool otx2_xdp_rcv_pkt_handler(struct otx2_nic *pfvf, · 1197 unmodified lines | ||
| 1198 | 1198 | put_page(page); |
| 1199 | 1199 | break; |
| 1200 | 1200 | default: |
| 1201 | − bpf_warn_invalid_xdp_action(act); | |
| 1201 | + bpf_warn_invalid_xdp_action(pfvf->netdev, prog, act); | |
| 1202 | 1202 | break; |
| 1203 | 1203 | case XDP_ABORTED: |
| 1204 | 1204 | trace_xdp_exception(pfvf->netdev, prog, act); |
| @@ -33,6 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | #include <linux/bpf.h> |
| 35 | 35 | #include <linux/etherdevice.h> |
| 36 | +#include <linux/filter.h> | |
| 36 | 37 | #include <linux/tcp.h> |
| 37 | 38 | #include <linux/if_vlan.h> |
| 38 | 39 | #include <linux/delay.h> |
| @@ -812,7 +812,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud · 811 unmodified lines | ||
| 812 | 812 | trace_xdp_exception(dev, xdp_prog, act); |
| 813 | 813 | goto xdp_drop_no_cnt; /* Drop on xmit failure */ |
| 814 | 814 | default: |
| 815 | − bpf_warn_invalid_xdp_action(act); | |
| 815 | + bpf_warn_invalid_xdp_action(dev, xdp_prog, act); | |
| 816 | 816 | fallthrough; |
| 817 | 817 | case XDP_ABORTED: |
| 818 | 818 | trace_xdp_exception(dev, xdp_prog, act); |
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB |
| 2 | 2 | /* Copyright (c) 2020, Mellanox Technologies inc. All rights reserved. */ |
| 3 | +#include <net/sch_generic.h> | |
| 3 | 4 | |
| 4 | 5 | #include "en.h" |
| 5 | 6 | #include "params.h" |
| @@ -151,7 +151,7 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di, · 150 unmodified lines | ||
| 151 | 151 | rq->stats->xdp_redirect++; |
| 152 | 152 | return true; |
| 153 | 153 | default: |
| 154 | − bpf_warn_invalid_xdp_action(act); | |
| 154 | + bpf_warn_invalid_xdp_action(rq->netdev, prog, act); | |
| 155 | 155 | fallthrough; |
| 156 | 156 | case XDP_ABORTED: |
| 157 | 157 | xdp_abort: |
| @@ -60,7 +60,7 @@ u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq, · 59 unmodified lines | ||
| 60 | 60 | break; |
| 61 | 61 | |
| 62 | 62 | default: |
| 63 | − bpf_warn_invalid_xdp_action(act); | |
| 63 | + bpf_warn_invalid_xdp_action(ndev, prog, act); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | out: |
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause |
| 2 | 2 | /* Copyright (c) 2021, Microsoft Corporation. */ |
| 3 | 3 | |
| 4 | +#include <uapi/linux/bpf.h> | |
| 5 | + | |
| 4 | 6 | #include <linux/inetdevice.h> |
| 5 | 7 | #include <linux/etherdevice.h> |
| 6 | 8 | #include <linux/ethtool.h> |
| @@ -1944,7 +1944,7 @@ static int nfp_net_rx(struct nfp_net_rx_ring *rx_ring, int budget) · 1943 unmodified lines | ||
| 1944 | 1944 | xdp_prog, act); |
| 1945 | 1945 | continue; |
| 1946 | 1946 | default: |
| 1947 | − bpf_warn_invalid_xdp_action(act); | |
| 1947 | + bpf_warn_invalid_xdp_action(dp->netdev, xdp_prog, act); | |
| 1948 | 1948 | fallthrough; |
| 1949 | 1949 | case XDP_ABORTED: |
| 1950 | 1950 | trace_xdp_exception(dp->netdev, xdp_prog, act); |
| @@ -1153,7 +1153,7 @@ static bool qede_rx_xdp(struct qede_dev *edev, · 1152 unmodified lines | ||
| 1153 | 1153 | qede_rx_bd_ring_consume(rxq); |
| 1154 | 1154 | break; |
| 1155 | 1155 | default: |
| 1156 | − bpf_warn_invalid_xdp_action(act); | |
| 1156 | + bpf_warn_invalid_xdp_action(edev->ndev, prog, act); | |
| 1157 | 1157 | fallthrough; |
| 1158 | 1158 | case XDP_ABORTED: |
| 1159 | 1159 | trace_xdp_exception(edev->ndev, prog, act); |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | * Copyright 2005-2013 Solarflare Communications Inc. |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | +#include <linux/filter.h> | |
| 8 | 9 | #include <linux/module.h> |
| 9 | 10 | #include <linux/pci.h> |
| 10 | 11 | #include <linux/netdevice.h> |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | |
| 11 | 11 | #include "net_driver.h" |
| 12 | 12 | #include <linux/module.h> |
| 13 | +#include <linux/filter.h> | |
| 13 | 14 | #include "efx_channels.h" |
| 14 | 15 | #include "efx.h" |
| 15 | 16 | #include "efx_common.h" |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include "net_driver.h" |
| 12 | +#include <linux/filter.h> | |
| 12 | 13 | #include <linux/module.h> |
| 13 | 14 | #include <linux/netdevice.h> |
| 14 | 15 | #include <net/gre.h> |
| @@ -338,7 +338,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel, · 337 unmodified lines | ||
| 338 | 338 | break; |
| 339 | 339 | |
| 340 | 340 | default: |
| 341 | − bpf_warn_invalid_xdp_action(xdp_act); | |
| 341 | + bpf_warn_invalid_xdp_action(efx->net_dev, xdp_prog, xdp_act); | |
| 342 | 342 | efx_free_rx_buffers(rx_queue, rx_buf, 1); |
| 343 | 343 | channel->n_rx_xdp_bad_drops++; |
| 344 | 344 | trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act); |
| @@ -933,7 +933,7 @@ static u32 netsec_run_xdp(struct netsec_priv *priv, struct bpf_prog *prog, · 932 unmodified lines | ||
| 933 | 933 | } |
| 934 | 934 | break; |
| 935 | 935 | default: |
| 936 | − bpf_warn_invalid_xdp_action(act); | |
| 936 | + bpf_warn_invalid_xdp_action(priv->ndev, prog, act); | |
| 937 | 937 | fallthrough; |
| 938 | 938 | case XDP_ABORTED: |
| 939 | 939 | trace_xdp_exception(priv->ndev, prog, act); |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <linux/net_tstamp.h> |
| 23 | 23 | #include <linux/reset.h> |
| 24 | 24 | #include <net/page_pool.h> |
| 25 | +#include <uapi/linux/bpf.h> | |
| 25 | 26 | |
| 26 | 27 | struct stmmac_resources { |
| 27 | 28 | void __iomem *addr; |
| @@ -4723,7 +4723,7 @@ static int __stmmac_xdp_run_prog(struct stmmac_priv *priv, · 4722 unmodified lines | ||
| 4723 | 4723 | res = STMMAC_XDP_REDIRECT; |
| 4724 | 4724 | break; |
| 4725 | 4725 | default: |
| 4726 | − bpf_warn_invalid_xdp_action(act); | |
| 4726 | + bpf_warn_invalid_xdp_action(priv->dev, prog, act); | |
| 4727 | 4727 | fallthrough; |
| 4728 | 4728 | case XDP_ABORTED: |
| 4729 | 4729 | trace_xdp_exception(priv->dev, prog, act); |
| @@ -1362,7 +1362,7 @@ int cpsw_run_xdp(struct cpsw_priv *priv, int ch, struct xdp_buff *xdp, · 1361 unmodified lines | ||
| 1362 | 1362 | xdp_do_flush_map(); |
| 1363 | 1363 | break; |
| 1364 | 1364 | default: |
| 1365 | − bpf_warn_invalid_xdp_action(act); | |
| 1365 | + bpf_warn_invalid_xdp_action(ndev, prog, act); | |
| 1366 | 1366 | fallthrough; |
| 1367 | 1367 | case XDP_ABORTED: |
| 1368 | 1368 | trace_xdp_exception(ndev, prog, act); |
| @@ -6,6 +6,8 @@ · 5 unmodified lines | ||
| 6 | 6 | #ifndef DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ |
| 7 | 7 | #define DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ |
| 8 | 8 | |
| 9 | +#include <uapi/linux/bpf.h> | |
| 10 | + | |
| 9 | 11 | #include "davinci_cpdma.h" |
| 10 | 12 | |
| 11 | 13 | #define CPSW_DEBUG (NETIF_MSG_HW | NETIF_MSG_WOL | \ |
| @@ -30,6 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | /*****************************************************************************/ |
| 31 | 31 | |
| 32 | 32 | #include <linux/capability.h> |
| 33 | +#include <linux/compat.h> | |
| 33 | 34 | #include <linux/module.h> |
| 34 | 35 | #include <linux/types.h> |
| 35 | 36 | #include <linux/net.h> |
| @@ -148,6 +148,7 @@ · 147 unmodified lines | ||
| 148 | 148 | |
| 149 | 149 | /* ----------------------------------------------------------------------- */ |
| 150 | 150 | |
| 151 | +#include <linux/compat.h> | |
| 151 | 152 | #include <linux/module.h> |
| 152 | 153 | #include <linux/errno.h> |
| 153 | 154 | #include <linux/signal.h> |
| @@ -68,7 +68,7 @@ u32 netvsc_run_xdp(struct net_device *ndev, struct netvsc_channel *nvchan, · 67 unmodified lines | ||
| 68 | 68 | break; |
| 69 | 69 | |
| 70 | 70 | default: |
| 71 | − bpf_warn_invalid_xdp_action(act); | |
| 71 | + bpf_warn_invalid_xdp_action(ndev, prog, act); | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | out: |
| @@ -44,6 +44,7 @@ · 43 unmodified lines | ||
| 44 | 44 | #include <linux/etherdevice.h> |
| 45 | 45 | #include <linux/skbuff.h> |
| 46 | 46 | #include <linux/ethtool.h> |
| 47 | +#include <net/sch_generic.h> | |
| 47 | 48 | #include <net/sock.h> |
| 48 | 49 | #include <net/checksum.h> |
| 49 | 50 | #include <linux/if_ether.h> /* For the statistics structure. */ |
| @@ -1602,7 +1602,7 @@ static int tun_xdp_act(struct tun_struct *tun, struct bpf_prog *xdp_prog, · 1601 unmodified lines | ||
| 1602 | 1602 | case XDP_PASS: |
| 1603 | 1603 | break; |
| 1604 | 1604 | default: |
| 1605 | − bpf_warn_invalid_xdp_action(act); | |
| 1605 | + bpf_warn_invalid_xdp_action(tun->dev, xdp_prog, act); | |
| 1606 | 1606 | fallthrough; |
| 1607 | 1607 | case XDP_ABORTED: |
| 1608 | 1608 | trace_xdp_exception(tun->dev, xdp_prog, act); |
| @@ -644,7 +644,7 @@ static struct xdp_frame *veth_xdp_rcv_one(struct veth_rq *rq, · 643 unmodified lines | ||
| 644 | 644 | rcu_read_unlock(); |
| 645 | 645 | goto xdp_xmit; |
| 646 | 646 | default: |
| 647 | − bpf_warn_invalid_xdp_action(act); | |
| 647 | + bpf_warn_invalid_xdp_action(rq->dev, xdp_prog, act); | |
| 648 | 648 | fallthrough; |
| 649 | 649 | case XDP_ABORTED: |
| 650 | 650 | trace_xdp_exception(rq->dev, xdp_prog, act); |
| @@ -794,7 +794,7 @@ static struct sk_buff *veth_xdp_rcv_skb(struct veth_rq *rq, · 143 unmodified lines | ||
| 794 | 794 | rcu_read_unlock(); |
| 795 | 795 | goto xdp_xmit; |
| 796 | 796 | default: |
| 797 | − bpf_warn_invalid_xdp_action(act); | |
| 797 | + bpf_warn_invalid_xdp_action(rq->dev, xdp_prog, act); | |
| 798 | 798 | fallthrough; |
| 799 | 799 | case XDP_ABORTED: |
| 800 | 800 | trace_xdp_exception(rq->dev, xdp_prog, act); |
| @@ -812,7 +812,7 @@ static struct sk_buff *receive_small(struct net_device *dev, · 811 unmodified lines | ||
| 812 | 812 | rcu_read_unlock(); |
| 813 | 813 | goto xdp_xmit; |
| 814 | 814 | default: |
| 815 | − bpf_warn_invalid_xdp_action(act); | |
| 815 | + bpf_warn_invalid_xdp_action(vi->dev, xdp_prog, act); | |
| 816 | 816 | fallthrough; |
| 817 | 817 | case XDP_ABORTED: |
| 818 | 818 | trace_xdp_exception(vi->dev, xdp_prog, act); |
| @@ -1022,7 +1022,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, · 203 unmodified lines | ||
| 1022 | 1022 | rcu_read_unlock(); |
| 1023 | 1023 | goto xdp_xmit; |
| 1024 | 1024 | default: |
| 1025 | − bpf_warn_invalid_xdp_action(act); | |
| 1025 | + bpf_warn_invalid_xdp_action(vi->dev, xdp_prog, act); | |
| 1026 | 1026 | fallthrough; |
| 1027 | 1027 | case XDP_ABORTED: |
| 1028 | 1028 | trace_xdp_exception(vi->dev, xdp_prog, act); |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #include <net/addrconf.h> |
| 35 | 35 | #include <net/l3mdev.h> |
| 36 | 36 | #include <net/fib_rules.h> |
| 37 | +#include <net/sch_generic.h> | |
| 37 | 38 | #include <net/netns/generic.h> |
| 38 | 39 | #include <net/netfilter/nf_conntrack.h> |
| 39 | 40 | |
| @@ -948,7 +948,7 @@ static u32 xennet_run_xdp(struct netfront_queue *queue, struct page *pdata, · 947 unmodified lines | ||
| 948 | 948 | break; |
| 949 | 949 | |
| 950 | 950 | default: |
| 951 | − bpf_warn_invalid_xdp_action(act); | |
| 951 | + bpf_warn_invalid_xdp_action(queue->info->netdev, prog, act); | |
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | return act; |