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 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 8 | #include <linux/firmware.h> | 8 | #include <linux/firmware.h> |
| 9 | #include <linux/vmalloc.h> | ||
| 9 | 10 | ||
| 10 | #include <net/bluetooth/bluetooth.h> | 11 | #include <net/bluetooth/bluetooth.h> |
| 11 | #include <net/bluetooth/hci_core.h> | 12 | #include <net/bluetooth/hci_core.h> |
| @@ -33,6 +33,7 @@ · 32 unmodified lines | |||
| 33 | * SOFTWARE. | 33 | * SOFTWARE. |
| 34 | */ | 34 | */ |
| 35 | 35 | ||
| 36 | #include <linux/if_vlan.h> | ||
| 36 | #include <linux/module.h> | 37 | #include <linux/module.h> |
| 37 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
| 38 | #include <linux/slab.h> | 39 | #include <linux/slab.h> |
| @@ -1,5 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB | 1 | // SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB |
| 2 | /* Copyright (c) 2015 - 2021 Intel Corporation */ | 2 | /* Copyright (c) 2015 - 2021 Intel Corporation */ |
| 3 | #include <linux/etherdevice.h> | ||
| 4 | |||
| 3 | #include "osdep.h" | 5 | #include "osdep.h" |
| 4 | #include "status.h" | 6 | #include "status.h" |
| 5 | #include "hmc.h" | 7 | #include "hmc.h" |
| @@ -1,5 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB | 1 | // SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB |
| 2 | /* Copyright (c) 2016 - 2021 Intel Corporation */ | 2 | /* Copyright (c) 2016 - 2021 Intel Corporation */ |
| 3 | #include <linux/etherdevice.h> | ||
| 4 | |||
| 3 | #include "osdep.h" | 5 | #include "osdep.h" |
| 4 | #include "status.h" | 6 | #include "status.h" |
| 5 | #include "hmc.h" | 7 | #include "hmc.h" |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | |||
| 32 | 32 | ||
| 33 | #include <linux/kref.h> | 33 | #include <linux/kref.h> |
| 34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
| 35 | #include <linux/sched/mm.h> | ||
| 35 | #include <rdma/ib_umem.h> | 36 | #include <rdma/ib_umem.h> |
| 36 | 37 | ||
| 37 | #include "mlx5_ib.h" | 38 | #include "mlx5_ib.h" |
| @@ -30,6 +30,7 @@ · 29 unmodified lines | |||
| 30 | * SOFTWARE. | 30 | * SOFTWARE. |
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| 33 | #include <linux/etherdevice.h> | ||
| 33 | #include <linux/module.h> | 34 | #include <linux/module.h> |
| 34 | #include <rdma/ib_umem.h> | 35 | #include <rdma/ib_umem.h> |
| 35 | #include <rdma/ib_cache.h> | 36 | #include <rdma/ib_cache.h> |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | |||
| 11 | #include <linux/net.h> | 11 | #include <linux/net.h> |
| 12 | #include <linux/igmp.h> | 12 | #include <linux/igmp.h> |
| 13 | #include <linux/workqueue.h> | 13 | #include <linux/workqueue.h> |
| 14 | #include <net/sch_generic.h> | ||
| 14 | #include <net/net_namespace.h> | 15 | #include <net/net_namespace.h> |
| 15 | #include <net/ip.h> | 16 | #include <net/ip.h> |
| 16 | #include <net/udp.h> | 17 | #include <net/udp.h> |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | * of the GNU General Public License, incorporated herein by reference. | 23 | * of the GNU General Public License, incorporated herein by reference. |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include <linux/compat.h> | ||
| 26 | #include <linux/module.h> | 27 | #include <linux/module.h> |
| 27 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 28 | #include <linux/init.h> | 29 | #include <linux/init.h> |
| @@ -35,6 +35,7 @@ · 34 unmodified lines | |||
| 35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
| 36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
| 37 | #include <linux/fcntl.h> | 37 | #include <linux/fcntl.h> |
| 38 | #include <linux/filter.h> | ||
| 38 | #include <linux/interrupt.h> | 39 | #include <linux/interrupt.h> |
| 39 | #include <linux/ptrace.h> | 40 | #include <linux/ptrace.h> |
| 40 | #include <linux/ioport.h> | 41 | #include <linux/ioport.h> |
| @@ -8,6 +8,7 @@ · 7 unmodified lines | |||
| 8 | * | 8 | * |
| 9 | * Many thanks to Klaus Hitschler <klaus.hitschler@gmx.de> | 9 | * Many thanks to Klaus Hitschler <klaus.hitschler@gmx.de> |
| 10 | */ | 10 | */ |
| 11 | #include <asm/unaligned.h> | ||
| 11 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
| 12 | #include <linux/usb.h> | 13 | #include <linux/usb.h> |
| 13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | #include <linux/delay.h> | 10 | #include <linux/delay.h> |
| 11 | #include <linux/export.h> | 11 | #include <linux/export.h> |
| 12 | #include <linux/gpio.h> | 12 | #include <linux/gpio.h> |
| 13 | #include <linux/if_vlan.h> | ||
| 13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 15 | #include <linux/platform_data/microchip-ksz.h> | 16 | #include <linux/platform_data/microchip-ksz.h> |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | |||
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <net/dsa.h> | 7 | #include <net/dsa.h> |
| 8 | #include <linux/etherdevice.h> | ||
| 8 | #include <linux/if_bridge.h> | 9 | #include <linux/if_bridge.h> |
| 9 | #include <linux/of_device.h> | 10 | #include <linux/of_device.h> |
| 10 | #include <linux/netdev_features.h> | 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 | xdp_stat = &rx_ring->rx_stats.xdp_pass; | 434 | xdp_stat = &rx_ring->rx_stats.xdp_pass; |
| 435 | break; | 435 | break; |
| 436 | default: | 436 | default: |
| 437 | bpf_warn_invalid_xdp_action(verdict); | 437 | bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, verdict); |
| 438 | xdp_stat = &rx_ring->rx_stats.xdp_invalid; | 438 | xdp_stat = &rx_ring->rx_stats.xdp_invalid; |
| 439 | } | 439 | } |
| 440 | 440 | ||
| @@ -14,6 +14,7 @@ · 13 unmodified lines | |||
| 14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
| 16 | #include <linux/skbuff.h> | 16 | #include <linux/skbuff.h> |
| 17 | #include <uapi/linux/bpf.h> | ||
| 17 | 18 | ||
| 18 | #include "ena_com.h" | 19 | #include "ena_com.h" |
| 19 | #include "ena_eth_com.h" | 20 | #include "ena_eth_com.h" |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | |||
| 9 | 9 | ||
| 10 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
| 11 | #include <linux/netdevice.h> | 11 | #include <linux/netdevice.h> |
| 12 | #include <linux/vmalloc.h> | ||
| 12 | #include <net/devlink.h> | 13 | #include <net/devlink.h> |
| 13 | #include "bnxt_hsi.h" | 14 | #include "bnxt_hsi.h" |
| 14 | #include "bnxt.h" | 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 | *event |= BNXT_REDIRECT_EVENT; | 195 | *event |= BNXT_REDIRECT_EVENT; |
| 196 | break; | 196 | break; |
| 197 | default: | 197 | default: |
| 198 | bpf_warn_invalid_xdp_action(act); | 198 | bpf_warn_invalid_xdp_action(bp->dev, xdp_prog, act); |
| 199 | fallthrough; | 199 | fallthrough; |
| 200 | case XDP_ABORTED: | 200 | case XDP_ABORTED: |
| 201 | trace_xdp_exception(bp->dev, xdp_prog, act); | 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 | nicvf_xdp_sq_append_pkt(nic, sq, (u64)xdp.data, dma_addr, len); | 590 | nicvf_xdp_sq_append_pkt(nic, sq, (u64)xdp.data, dma_addr, len); |
| 591 | return true; | 591 | return true; |
| 592 | default: | 592 | default: |
| 593 | bpf_warn_invalid_xdp_action(action); | 593 | bpf_warn_invalid_xdp_action(nic->netdev, prog, action); |
| 594 | fallthrough; | 594 | fallthrough; |
| 595 | case XDP_ABORTED: | 595 | case XDP_ABORTED: |
| 596 | trace_xdp_exception(nic->netdev, prog, action); | 596 | trace_xdp_exception(nic->netdev, prog, action); |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | #include <linux/iommu.h> | 10 | #include <linux/iommu.h> |
| 11 | #include <net/ip.h> | 11 | #include <net/ip.h> |
| 12 | #include <net/tso.h> | 12 | #include <net/tso.h> |
| 13 | #include <uapi/linux/bpf.h> | ||
| 13 | 14 | ||
| 14 | #include "nic_reg.h" | 15 | #include "nic_reg.h" |
| 15 | #include "nic.h" | 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 | break; | 2624 | break; |
| 2625 | default: | 2625 | default: |
| 2626 | bpf_warn_invalid_xdp_action(xdp_act); | 2626 | bpf_warn_invalid_xdp_action(priv->net_dev, xdp_prog, xdp_act); |
| 2627 | fallthrough; | 2627 | fallthrough; |
| 2628 | case XDP_ABORTED: | 2628 | case XDP_ABORTED: |
| 2629 | trace_xdp_exception(priv->net_dev, xdp_prog, xdp_act); | 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 | dpaa2_eth_xdp_enqueue(priv, ch, fd, vaddr, rx_fq->flowid); | 374 | dpaa2_eth_xdp_enqueue(priv, ch, fd, vaddr, rx_fq->flowid); |
| 375 | break; | 375 | break; |
| 376 | default: | 376 | default: |
| 377 | bpf_warn_invalid_xdp_action(xdp_act); | 377 | bpf_warn_invalid_xdp_action(priv->net_dev, xdp_prog, xdp_act); |
| 378 | fallthrough; | 378 | fallthrough; |
| 379 | case XDP_ABORTED: | 379 | case XDP_ABORTED: |
| 380 | trace_xdp_exception(priv->net_dev, xdp_prog, xdp_act); | 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 | switch (xdp_act) { | 1548 | switch (xdp_act) { |
| 1549 | default: | 1549 | default: |
| 1550 | bpf_warn_invalid_xdp_action(xdp_act); | 1550 | bpf_warn_invalid_xdp_action(rx_ring->ndev, prog, xdp_act); |
| 1551 | fallthrough; | 1551 | fallthrough; |
| 1552 | case XDP_ABORTED: | 1552 | case XDP_ABORTED: |
| 1553 | trace_xdp_exception(rx_ring->ndev, prog, xdp_act); | 1553 | trace_xdp_exception(rx_ring->ndev, prog, xdp_act); |
| @@ -4,6 +4,7 @@ · 3 unmodified lines | |||
| 4 | * Copyright(c) 2017 Huawei Technologies Co., Ltd | 4 | * Copyright(c) 2017 Huawei Technologies Co., Ltd |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <linux/if_vlan.h> | ||
| 7 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
| 8 | #include <linux/netdevice.h> | 9 | #include <linux/netdevice.h> |
| 9 | #include <linux/u64_stats_sync.h> | 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 | result = I40E_XDP_REDIR; | 2322 | result = I40E_XDP_REDIR; |
| 2323 | break; | 2323 | break; |
| 2324 | default: | 2324 | default: |
| 2325 | bpf_warn_invalid_xdp_action(act); | 2325 | bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); |
| 2326 | fallthrough; | 2326 | fallthrough; |
| 2327 | case XDP_ABORTED: | 2327 | case XDP_ABORTED: |
| 2328 | out_failure: | 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 | goto out_failure; | 176 | goto out_failure; |
| 177 | break; | 177 | break; |
| 178 | default: | 178 | default: |
| 179 | bpf_warn_invalid_xdp_action(act); | 179 | bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); |
| 180 | fallthrough; | 180 | fallthrough; |
| 181 | case XDP_ABORTED: | 181 | case XDP_ABORTED: |
| 182 | out_failure: | 182 | out_failure: |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | struct i40e_vsi; | 23 | struct i40e_vsi; |
| 24 | struct xsk_buff_pool; | 24 | struct xsk_buff_pool; |
| 25 | struct zero_copy_allocator; | ||
| 26 | 25 | ||
| 27 | int i40e_queue_pair_disable(struct i40e_vsi *vsi, int queue_pair); | 26 | int i40e_queue_pair_disable(struct i40e_vsi *vsi, int queue_pair); |
| 28 | int i40e_queue_pair_enable(struct i40e_vsi *vsi, int queue_pair); | 27 | int i40e_queue_pair_enable(struct i40e_vsi *vsi, int queue_pair); |
| @@ -1,6 +1,8 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* Copyright (c) 2020, Intel Corporation. */ | 2 | /* Copyright (c) 2020, Intel Corporation. */ |
| 3 | 3 | ||
| 4 | #include <linux/vmalloc.h> | ||
| 5 | |||
| 4 | #include "ice.h" | 6 | #include "ice.h" |
| 5 | #include "ice_lib.h" | 7 | #include "ice_lib.h" |
| 6 | #include "ice_devlink.h" | 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 | goto out_failure; | 576 | goto out_failure; |
| 577 | return ICE_XDP_REDIR; | 577 | return ICE_XDP_REDIR; |
| 578 | default: | 578 | default: |
| 579 | bpf_warn_invalid_xdp_action(act); | 579 | bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); |
| 580 | fallthrough; | 580 | fallthrough; |
| 581 | case XDP_ABORTED: | 581 | case XDP_ABORTED: |
| 582 | out_failure: | 582 | out_failure: |
| @@ -1,6 +1,8 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* Copyright (c) 2019, Intel Corporation. */ | 2 | /* Copyright (c) 2019, Intel Corporation. */ |
| 3 | 3 | ||
| 4 | #include <linux/filter.h> | ||
| 5 | |||
| 4 | #include "ice_txrx_lib.h" | 6 | #include "ice_txrx_lib.h" |
| 5 | #include "ice_eswitch.h" | 7 | #include "ice_eswitch.h" |
| 6 | #include "ice_lib.h" | 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 | goto out_failure; | 481 | goto out_failure; |
| 482 | break; | 482 | break; |
| 483 | default: | 483 | default: |
| 484 | bpf_warn_invalid_xdp_action(act); | 484 | bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); |
| 485 | fallthrough; | 485 | fallthrough; |
| 486 | case XDP_ABORTED: | 486 | case XDP_ABORTED: |
| 487 | out_failure: | 487 | out_failure: |
| @@ -8500,7 +8500,7 @@ static struct sk_buff *igb_run_xdp(struct igb_adapter *adapter, · 8499 unmodified lines | |||
| 8500 | result = IGB_XDP_REDIR; | 8500 | result = IGB_XDP_REDIR; |
| 8501 | break; | 8501 | break; |
| 8502 | default: | 8502 | default: |
| 8503 | bpf_warn_invalid_xdp_action(act); | 8503 | bpf_warn_invalid_xdp_action(adapter->netdev, xdp_prog, act); |
| 8504 | fallthrough; | 8504 | fallthrough; |
| 8505 | case XDP_ABORTED: | 8505 | case XDP_ABORTED: |
| 8506 | out_failure: | 8506 | out_failure: |
| @@ -2241,7 +2241,7 @@ static int __igc_xdp_run_prog(struct igc_adapter *adapter, · 2240 unmodified lines | |||
| 2241 | return IGC_XDP_REDIRECT; | 2241 | return IGC_XDP_REDIRECT; |
| 2242 | break; | 2242 | break; |
| 2243 | default: | 2243 | default: |
| 2244 | bpf_warn_invalid_xdp_action(act); | 2244 | bpf_warn_invalid_xdp_action(adapter->netdev, prog, act); |
| 2245 | fallthrough; | 2245 | fallthrough; |
| 2246 | case XDP_ABORTED: | 2246 | case XDP_ABORTED: |
| 2247 | out_failure: | 2247 | out_failure: |
| @@ -1,6 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* Copyright (c) 2020, Intel Corporation. */ | 2 | /* Copyright (c) 2020, Intel Corporation. */ |
| 3 | 3 | ||
| 4 | #include <linux/if_vlan.h> | ||
| 4 | #include <net/xdp_sock_drv.h> | 5 | #include <net/xdp_sock_drv.h> |
| 5 | 6 | ||
| 6 | #include "igc.h" | 7 | #include "igc.h" |
| @@ -2235,7 +2235,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter, · 2234 unmodified lines | |||
| 2235 | result = IXGBE_XDP_REDIR; | 2235 | result = IXGBE_XDP_REDIR; |
| 2236 | break; | 2236 | break; |
| 2237 | default: | 2237 | default: |
| 2238 | bpf_warn_invalid_xdp_action(act); | 2238 | bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); |
| 2239 | fallthrough; | 2239 | fallthrough; |
| 2240 | case XDP_ABORTED: | 2240 | case XDP_ABORTED: |
| 2241 | out_failure: | 2241 | out_failure: |
| @@ -35,8 +35,6 @@ int ixgbe_xsk_pool_setup(struct ixgbe_adapter *adapter, · 34 unmodified lines | |||
| 35 | struct xsk_buff_pool *pool, | 35 | struct xsk_buff_pool *pool, |
| 36 | u16 qid); | 36 | u16 qid); |
| 37 | 37 | ||
| 38 | void ixgbe_zca_free(struct zero_copy_allocator *alloc, unsigned long handle); | ||
| 39 | |||
| 40 | bool ixgbe_alloc_rx_buffers_zc(struct ixgbe_ring *rx_ring, u16 cleaned_count); | 38 | bool ixgbe_alloc_rx_buffers_zc(struct ixgbe_ring *rx_ring, u16 cleaned_count); |
| 41 | int ixgbe_clean_rx_irq_zc(struct ixgbe_q_vector *q_vector, | 39 | int ixgbe_clean_rx_irq_zc(struct ixgbe_q_vector *q_vector, |
| 42 | struct ixgbe_ring *rx_ring, | 40 | struct ixgbe_ring *rx_ring, |
| @@ -131,7 +131,7 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter, · 130 unmodified lines | |||
| 131 | goto out_failure; | 131 | goto out_failure; |
| 132 | break; | 132 | break; |
| 133 | default: | 133 | default: |
| 134 | bpf_warn_invalid_xdp_action(act); | 134 | bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); |
| 135 | fallthrough; | 135 | fallthrough; |
| 136 | case XDP_ABORTED: | 136 | case XDP_ABORTED: |
| 137 | out_failure: | 137 | out_failure: |
| @@ -1070,7 +1070,7 @@ static struct sk_buff *ixgbevf_run_xdp(struct ixgbevf_adapter *adapter, · 1069 unmodified lines | |||
| 1070 | goto out_failure; | 1070 | goto out_failure; |
| 1071 | break; | 1071 | break; |
| 1072 | default: | 1072 | default: |
| 1073 | bpf_warn_invalid_xdp_action(act); | 1073 | bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act); |
| 1074 | fallthrough; | 1074 | fallthrough; |
| 1075 | case XDP_ABORTED: | 1075 | case XDP_ABORTED: |
| 1076 | out_failure: | 1076 | out_failure: |
| @@ -2240,7 +2240,7 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 2239 unmodified lines | |||
| 2240 | mvneta_xdp_put_buff(pp, rxq, xdp, sinfo, sync); | 2240 | mvneta_xdp_put_buff(pp, rxq, xdp, sinfo, sync); |
| 2241 | break; | 2241 | break; |
| 2242 | default: | 2242 | default: |
| 2243 | bpf_warn_invalid_xdp_action(act); | 2243 | bpf_warn_invalid_xdp_action(pp->dev, prog, act); |
| 2244 | fallthrough; | 2244 | fallthrough; |
| 2245 | case XDP_ABORTED: | 2245 | case XDP_ABORTED: |
| 2246 | trace_xdp_exception(pp->dev, prog, act); | 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 | break; | 3824 | break; |
| 3825 | default: | 3825 | default: |
| 3826 | bpf_warn_invalid_xdp_action(act); | 3826 | bpf_warn_invalid_xdp_action(port->dev, prog, act); |
| 3827 | fallthrough; | 3827 | fallthrough; |
| 3828 | case XDP_ABORTED: | 3828 | case XDP_ABORTED: |
| 3829 | trace_xdp_exception(port->dev, prog, act); | 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 | put_page(page); | 1198 | put_page(page); |
| 1199 | break; | 1199 | break; |
| 1200 | default: | 1200 | default: |
| 1201 | bpf_warn_invalid_xdp_action(act); | 1201 | bpf_warn_invalid_xdp_action(pfvf->netdev, prog, act); |
| 1202 | break; | 1202 | break; |
| 1203 | case XDP_ABORTED: | 1203 | case XDP_ABORTED: |
| 1204 | trace_xdp_exception(pfvf->netdev, prog, act); | 1204 | trace_xdp_exception(pfvf->netdev, prog, act); |
| @@ -33,6 +33,7 @@ · 32 unmodified lines | |||
| 33 | 33 | ||
| 34 | #include <linux/bpf.h> | 34 | #include <linux/bpf.h> |
| 35 | #include <linux/etherdevice.h> | 35 | #include <linux/etherdevice.h> |
| 36 | #include <linux/filter.h> | ||
| 36 | #include <linux/tcp.h> | 37 | #include <linux/tcp.h> |
| 37 | #include <linux/if_vlan.h> | 38 | #include <linux/if_vlan.h> |
| 38 | #include <linux/delay.h> | 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 | trace_xdp_exception(dev, xdp_prog, act); | 812 | trace_xdp_exception(dev, xdp_prog, act); |
| 813 | goto xdp_drop_no_cnt; /* Drop on xmit failure */ | 813 | goto xdp_drop_no_cnt; /* Drop on xmit failure */ |
| 814 | default: | 814 | default: |
| 815 | bpf_warn_invalid_xdp_action(act); | 815 | bpf_warn_invalid_xdp_action(dev, xdp_prog, act); |
| 816 | fallthrough; | 816 | fallthrough; |
| 817 | case XDP_ABORTED: | 817 | case XDP_ABORTED: |
| 818 | trace_xdp_exception(dev, xdp_prog, act); | 818 | trace_xdp_exception(dev, xdp_prog, act); |
| @@ -1,5 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB | 1 | // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB |
| 2 | /* Copyright (c) 2020, Mellanox Technologies inc. All rights reserved. */ | 2 | /* Copyright (c) 2020, Mellanox Technologies inc. All rights reserved. */ |
| 3 | #include <net/sch_generic.h> | ||
| 3 | 4 | ||
| 4 | #include "en.h" | 5 | #include "en.h" |
| 5 | #include "params.h" | 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 | rq->stats->xdp_redirect++; | 151 | rq->stats->xdp_redirect++; |
| 152 | return true; | 152 | return true; |
| 153 | default: | 153 | default: |
| 154 | bpf_warn_invalid_xdp_action(act); | 154 | bpf_warn_invalid_xdp_action(rq->netdev, prog, act); |
| 155 | fallthrough; | 155 | fallthrough; |
| 156 | case XDP_ABORTED: | 156 | case XDP_ABORTED: |
| 157 | xdp_abort: | 157 | xdp_abort: |
| @@ -60,7 +60,7 @@ u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq, · 59 unmodified lines | |||
| 60 | break; | 60 | break; |
| 61 | 61 | ||
| 62 | default: | 62 | default: |
| 63 | bpf_warn_invalid_xdp_action(act); | 63 | bpf_warn_invalid_xdp_action(ndev, prog, act); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | out: | 66 | out: |
| @@ -1,6 +1,8 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause | 1 | // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause |
| 2 | /* Copyright (c) 2021, Microsoft Corporation. */ | 2 | /* Copyright (c) 2021, Microsoft Corporation. */ |
| 3 | 3 | ||
| 4 | #include <uapi/linux/bpf.h> | ||
| 5 | |||
| 4 | #include <linux/inetdevice.h> | 6 | #include <linux/inetdevice.h> |
| 5 | #include <linux/etherdevice.h> | 7 | #include <linux/etherdevice.h> |
| 6 | #include <linux/ethtool.h> | 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 | xdp_prog, act); | 1944 | xdp_prog, act); |
| 1945 | continue; | 1945 | continue; |
| 1946 | default: | 1946 | default: |
| 1947 | bpf_warn_invalid_xdp_action(act); | 1947 | bpf_warn_invalid_xdp_action(dp->netdev, xdp_prog, act); |
| 1948 | fallthrough; | 1948 | fallthrough; |
| 1949 | case XDP_ABORTED: | 1949 | case XDP_ABORTED: |
| 1950 | trace_xdp_exception(dp->netdev, xdp_prog, act); | 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 | qede_rx_bd_ring_consume(rxq); | 1153 | qede_rx_bd_ring_consume(rxq); |
| 1154 | break; | 1154 | break; |
| 1155 | default: | 1155 | default: |
| 1156 | bpf_warn_invalid_xdp_action(act); | 1156 | bpf_warn_invalid_xdp_action(edev->ndev, prog, act); |
| 1157 | fallthrough; | 1157 | fallthrough; |
| 1158 | case XDP_ABORTED: | 1158 | case XDP_ABORTED: |
| 1159 | trace_xdp_exception(edev->ndev, prog, act); | 1159 | trace_xdp_exception(edev->ndev, prog, act); |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | |||
| 5 | * Copyright 2005-2013 Solarflare Communications Inc. | 5 | * Copyright 2005-2013 Solarflare Communications Inc. |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/filter.h> | ||
| 8 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 9 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
| 10 | #include <linux/netdevice.h> | 11 | #include <linux/netdevice.h> |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | 10 | ||
| 11 | #include "net_driver.h" | 11 | #include "net_driver.h" |
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/filter.h> | ||
| 13 | #include "efx_channels.h" | 14 | #include "efx_channels.h" |
| 14 | #include "efx.h" | 15 | #include "efx.h" |
| 15 | #include "efx_common.h" | 16 | #include "efx_common.h" |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include "net_driver.h" | 11 | #include "net_driver.h" |
| 12 | #include <linux/filter.h> | ||
| 12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 13 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
| 14 | #include <net/gre.h> | 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 | break; | 338 | break; |
| 339 | 339 | ||
| 340 | default: | 340 | default: |
| 341 | bpf_warn_invalid_xdp_action(xdp_act); | 341 | bpf_warn_invalid_xdp_action(efx->net_dev, xdp_prog, xdp_act); |
| 342 | efx_free_rx_buffers(rx_queue, rx_buf, 1); | 342 | efx_free_rx_buffers(rx_queue, rx_buf, 1); |
| 343 | channel->n_rx_xdp_bad_drops++; | 343 | channel->n_rx_xdp_bad_drops++; |
| 344 | trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act); | 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 | break; | 934 | break; |
| 935 | default: | 935 | default: |
| 936 | bpf_warn_invalid_xdp_action(act); | 936 | bpf_warn_invalid_xdp_action(priv->ndev, prog, act); |
| 937 | fallthrough; | 937 | fallthrough; |
| 938 | case XDP_ABORTED: | 938 | case XDP_ABORTED: |
| 939 | trace_xdp_exception(priv->ndev, prog, act); | 939 | trace_xdp_exception(priv->ndev, prog, act); |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include <linux/net_tstamp.h> | 22 | #include <linux/net_tstamp.h> |
| 23 | #include <linux/reset.h> | 23 | #include <linux/reset.h> |
| 24 | #include <net/page_pool.h> | 24 | #include <net/page_pool.h> |
| 25 | #include <uapi/linux/bpf.h> | ||
| 25 | 26 | ||
| 26 | struct stmmac_resources { | 27 | struct stmmac_resources { |
| 27 | void __iomem *addr; | 28 | void __iomem *addr; |
| @@ -4723,7 +4723,7 @@ static int __stmmac_xdp_run_prog(struct stmmac_priv *priv, · 4722 unmodified lines | |||
| 4723 | res = STMMAC_XDP_REDIRECT; | 4723 | res = STMMAC_XDP_REDIRECT; |
| 4724 | break; | 4724 | break; |
| 4725 | default: | 4725 | default: |
| 4726 | bpf_warn_invalid_xdp_action(act); | 4726 | bpf_warn_invalid_xdp_action(priv->dev, prog, act); |
| 4727 | fallthrough; | 4727 | fallthrough; |
| 4728 | case XDP_ABORTED: | 4728 | case XDP_ABORTED: |
| 4729 | trace_xdp_exception(priv->dev, prog, act); | 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 | xdp_do_flush_map(); | 1362 | xdp_do_flush_map(); |
| 1363 | break; | 1363 | break; |
| 1364 | default: | 1364 | default: |
| 1365 | bpf_warn_invalid_xdp_action(act); | 1365 | bpf_warn_invalid_xdp_action(ndev, prog, act); |
| 1366 | fallthrough; | 1366 | fallthrough; |
| 1367 | case XDP_ABORTED: | 1367 | case XDP_ABORTED: |
| 1368 | trace_xdp_exception(ndev, prog, act); | 1368 | trace_xdp_exception(ndev, prog, act); |
| @@ -6,6 +6,8 @@ · 5 unmodified lines | |||
| 6 | #ifndef DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ | 6 | #ifndef DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ |
| 7 | #define DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ | 7 | #define DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ |
| 8 | 8 | ||
| 9 | #include <uapi/linux/bpf.h> | ||
| 10 | |||
| 9 | #include "davinci_cpdma.h" | 11 | #include "davinci_cpdma.h" |
| 10 | 12 | ||
| 11 | #define CPSW_DEBUG (NETIF_MSG_HW | NETIF_MSG_WOL | \ | 13 | #define CPSW_DEBUG (NETIF_MSG_HW | NETIF_MSG_WOL | \ |
| @@ -30,6 +30,7 @@ · 29 unmodified lines | |||
| 30 | /*****************************************************************************/ | 30 | /*****************************************************************************/ |
| 31 | 31 | ||
| 32 | #include <linux/capability.h> | 32 | #include <linux/capability.h> |
| 33 | #include <linux/compat.h> | ||
| 33 | #include <linux/module.h> | 34 | #include <linux/module.h> |
| 34 | #include <linux/types.h> | 35 | #include <linux/types.h> |
| 35 | #include <linux/net.h> | 36 | #include <linux/net.h> |
| @@ -148,6 +148,7 @@ · 147 unmodified lines | |||
| 148 | 148 | ||
| 149 | /* ----------------------------------------------------------------------- */ | 149 | /* ----------------------------------------------------------------------- */ |
| 150 | 150 | ||
| 151 | #include <linux/compat.h> | ||
| 151 | #include <linux/module.h> | 152 | #include <linux/module.h> |
| 152 | #include <linux/errno.h> | 153 | #include <linux/errno.h> |
| 153 | #include <linux/signal.h> | 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 | break; | 68 | break; |
| 69 | 69 | ||
| 70 | default: | 70 | default: |
| 71 | bpf_warn_invalid_xdp_action(act); | 71 | bpf_warn_invalid_xdp_action(ndev, prog, act); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | out: | 74 | out: |
| @@ -44,6 +44,7 @@ · 43 unmodified lines | |||
| 44 | #include <linux/etherdevice.h> | 44 | #include <linux/etherdevice.h> |
| 45 | #include <linux/skbuff.h> | 45 | #include <linux/skbuff.h> |
| 46 | #include <linux/ethtool.h> | 46 | #include <linux/ethtool.h> |
| 47 | #include <net/sch_generic.h> | ||
| 47 | #include <net/sock.h> | 48 | #include <net/sock.h> |
| 48 | #include <net/checksum.h> | 49 | #include <net/checksum.h> |
| 49 | #include <linux/if_ether.h> /* For the statistics structure. */ | 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 | case XDP_PASS: | 1602 | case XDP_PASS: |
| 1603 | break; | 1603 | break; |
| 1604 | default: | 1604 | default: |
| 1605 | bpf_warn_invalid_xdp_action(act); | 1605 | bpf_warn_invalid_xdp_action(tun->dev, xdp_prog, act); |
| 1606 | fallthrough; | 1606 | fallthrough; |
| 1607 | case XDP_ABORTED: | 1607 | case XDP_ABORTED: |
| 1608 | trace_xdp_exception(tun->dev, xdp_prog, act); | 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 | rcu_read_unlock(); | 644 | rcu_read_unlock(); |
| 645 | goto xdp_xmit; | 645 | goto xdp_xmit; |
| 646 | default: | 646 | default: |
| 647 | bpf_warn_invalid_xdp_action(act); | 647 | bpf_warn_invalid_xdp_action(rq->dev, xdp_prog, act); |
| 648 | fallthrough; | 648 | fallthrough; |
| 649 | case XDP_ABORTED: | 649 | case XDP_ABORTED: |
| 650 | trace_xdp_exception(rq->dev, xdp_prog, act); | 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 | rcu_read_unlock(); | 794 | rcu_read_unlock(); |
| 795 | goto xdp_xmit; | 795 | goto xdp_xmit; |
| 796 | default: | 796 | default: |
| 797 | bpf_warn_invalid_xdp_action(act); | 797 | bpf_warn_invalid_xdp_action(rq->dev, xdp_prog, act); |
| 798 | fallthrough; | 798 | fallthrough; |
| 799 | case XDP_ABORTED: | 799 | case XDP_ABORTED: |
| 800 | trace_xdp_exception(rq->dev, xdp_prog, act); | 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 | rcu_read_unlock(); | 812 | rcu_read_unlock(); |
| 813 | goto xdp_xmit; | 813 | goto xdp_xmit; |
| 814 | default: | 814 | default: |
| 815 | bpf_warn_invalid_xdp_action(act); | 815 | bpf_warn_invalid_xdp_action(vi->dev, xdp_prog, act); |
| 816 | fallthrough; | 816 | fallthrough; |
| 817 | case XDP_ABORTED: | 817 | case XDP_ABORTED: |
| 818 | trace_xdp_exception(vi->dev, xdp_prog, act); | 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 | rcu_read_unlock(); | 1022 | rcu_read_unlock(); |
| 1023 | goto xdp_xmit; | 1023 | goto xdp_xmit; |
| 1024 | default: | 1024 | default: |
| 1025 | bpf_warn_invalid_xdp_action(act); | 1025 | bpf_warn_invalid_xdp_action(vi->dev, xdp_prog, act); |
| 1026 | fallthrough; | 1026 | fallthrough; |
| 1027 | case XDP_ABORTED: | 1027 | case XDP_ABORTED: |
| 1028 | trace_xdp_exception(vi->dev, xdp_prog, act); | 1028 | trace_xdp_exception(vi->dev, xdp_prog, act); |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | |||
| 34 | #include <net/addrconf.h> | 34 | #include <net/addrconf.h> |
| 35 | #include <net/l3mdev.h> | 35 | #include <net/l3mdev.h> |
| 36 | #include <net/fib_rules.h> | 36 | #include <net/fib_rules.h> |
| 37 | #include <net/sch_generic.h> | ||
| 37 | #include <net/netns/generic.h> | 38 | #include <net/netns/generic.h> |
| 38 | #include <net/netfilter/nf_conntrack.h> | 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 | break; | 948 | break; |
| 949 | 949 | ||
| 950 | default: | 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 | return act; | 954 | return act; |