.. | .. |
---|
31 | 31 | * |
---|
32 | 32 | */ |
---|
33 | 33 | |
---|
34 | | -#include <net/busy_poll.h> |
---|
35 | 34 | #include <linux/bpf.h> |
---|
36 | 35 | #include <linux/bpf_trace.h> |
---|
37 | 36 | #include <linux/mlx4/cq.h> |
---|
.. | .. |
---|
44 | 43 | #include <linux/vmalloc.h> |
---|
45 | 44 | #include <linux/irq.h> |
---|
46 | 45 | |
---|
| 46 | +#include <net/ip.h> |
---|
47 | 47 | #if IS_ENABLED(CONFIG_IPV6) |
---|
48 | 48 | #include <net/ip6_checksum.h> |
---|
49 | 49 | #endif |
---|
.. | .. |
---|
271 | 271 | |
---|
272 | 272 | ring = kzalloc_node(sizeof(*ring), GFP_KERNEL, node); |
---|
273 | 273 | if (!ring) { |
---|
274 | | - ring = kzalloc(sizeof(*ring), GFP_KERNEL); |
---|
275 | | - if (!ring) { |
---|
276 | | - en_err(priv, "Failed to allocate RX ring structure\n"); |
---|
277 | | - return -ENOMEM; |
---|
278 | | - } |
---|
| 274 | + en_err(priv, "Failed to allocate RX ring structure\n"); |
---|
| 275 | + return -ENOMEM; |
---|
279 | 276 | } |
---|
280 | 277 | |
---|
281 | 278 | ring->prod = 0; |
---|
.. | .. |
---|
686 | 683 | rcu_read_lock(); |
---|
687 | 684 | xdp_prog = rcu_dereference(ring->xdp_prog); |
---|
688 | 685 | xdp.rxq = &ring->xdp_rxq; |
---|
| 686 | + xdp.frame_sz = priv->frag_info[0].frag_stride; |
---|
689 | 687 | doorbell_pending = 0; |
---|
690 | 688 | |
---|
691 | 689 | /* We assume a 1:1 mapping between CQEs and Rx descriptors, so Rx |
---|
.. | .. |
---|
707 | 705 | |
---|
708 | 706 | frags = ring->rx_info + (index << priv->log_rx_info); |
---|
709 | 707 | va = page_address(frags[0].page) + frags[0].page_offset; |
---|
710 | | - prefetchw(va); |
---|
| 708 | + net_prefetchw(va); |
---|
711 | 709 | /* |
---|
712 | 710 | * make sure we read the CQE after we read the ownership bit |
---|
713 | 711 | */ |
---|
.. | .. |
---|
808 | 806 | goto xdp_drop_no_cnt; /* Drop on xmit failure */ |
---|
809 | 807 | default: |
---|
810 | 808 | bpf_warn_invalid_xdp_action(act); |
---|
811 | | - /* fall through */ |
---|
| 809 | + fallthrough; |
---|
812 | 810 | case XDP_ABORTED: |
---|
813 | 811 | trace_xdp_exception(dev, xdp_prog, act); |
---|
814 | | - /* fall through */ |
---|
| 812 | + fallthrough; |
---|
815 | 813 | case XDP_DROP: |
---|
816 | 814 | ring->xdp_drop++; |
---|
817 | 815 | xdp_drop_no_cnt: |
---|
.. | .. |
---|
893 | 891 | skb->data_len = length; |
---|
894 | 892 | napi_gro_frags(&cq->napi); |
---|
895 | 893 | } else { |
---|
896 | | - skb->vlan_tci = 0; |
---|
| 894 | + __vlan_hwaccel_clear_tag(skb); |
---|
897 | 895 | skb_clear_hash(skb); |
---|
898 | 896 | } |
---|
899 | 897 | next: |
---|
.. | .. |
---|
952 | 950 | xdp_tx_cq = priv->tx_cq[TX_XDP][cq->ring]; |
---|
953 | 951 | if (xdp_tx_cq->xdp_busy) { |
---|
954 | 952 | clean_complete = mlx4_en_process_tx_cq(dev, xdp_tx_cq, |
---|
955 | | - budget); |
---|
| 953 | + budget) < budget; |
---|
956 | 954 | xdp_tx_cq->xdp_busy = !clean_complete; |
---|
957 | 955 | } |
---|
958 | 956 | } |
---|