projects/linux·commit 9a431ef9

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

9a431ef9 · Linus Torvalds <[email protected]> · 2017-10-05 08:40:09 -07:00

Pull networking fixes from David Miller:

 1) Check iwlwifi 9000 reorder buffer out-of-space condition properly,
    from Sara Sharon.

 2) Fix RCU splat in qualcomm rmnet driver, from Subash Abhinov
    Kasiviswanathan.

 3) Fix session and tunnel release races in l2tp, from Guillaume Nault
    and Sabrina Dubroca.

 4) Fix endian bug in sctp_diag_dump(), from Dan Carpenter.

 5) Several mlx5 driver fixes from the Mellanox folks (max flow counters
    cap check, invalid memory access in IPoIB support, etc.)

 6) tun_get_user() should bail if skb->len is zero, from Alexander
    Potapenko.

 7) Fix RCU lookups in inetpeer, from Eric Dumazet.

 8) Fix locking in packet_do_bund().

 9) Handle cb->start() error properly in netlink dump code, from Jason
    A. Donenfeld.

10) Handle multicast properly in UDP socket early demux code. From Paolo
    Abeni.

11) Several erspan bug fixes in ip_gre, from Xin Long.

12) Fix use-after-free in socket filter code, in order to handle the
    fact that listener lock is no longer taken during the three-way TCP
    handshake. From Eric Dumazet.

13) Fix infoleak in RTM_GETSTATS, from Nikolay Aleksandrov.

14) Fix tail call generation in x86-64 BPF JIT, from Alexei Starovoitov.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (77 commits)
  net: 8021q: skip packets if the vlan is down
  bpf: fix bpf_tail_call() x64 JIT
  net: stmmac: dwmac-rk: Add RK3128 GMAC support
  rndis_host: support Novatel Verizon USB730L
  net: rtnetlink: fix info leak in RTM_GETSTATS call
  socket, bpf: fix possible use after free
  mlxsw: spectrum_router: Track RIF of IPIP next hops
  mlxsw: spectrum_router: Move VRF refcounting
  net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'
  net: mvpp2: Fix clock resource by adding an optional bus clock
  r8152: add Linksys USB3GIGV1 id
  l2tp: fix l2tp_eth module loading
  ip_gre: erspan device should keep dst
  ip_gre: set tunnel hlen properly in erspan_tunnel_init
  ip_gre: check packet length and mtu correctly in erspan_xmit
  ip_gre: get key from session_id correctly in erspan_rcv
  tipc: use only positive error codes in messages
  ppp: fix __percpu annotation
  udp: perform source validation for mcast early demux
  IPv4: early demux can return an error code
  ...
Commit
9a431ef9629fa6276aa8bd9ea87fb0728922bd6d
Parents
42b76d0e · e769fcec

Merge commit. Changes below are compared with the first parent: 42b76d0e.

Changes

91 files changed · +863 −388

FileStatusAddDelContent
Documentation/devicetree/bindings/net/marvell-pp2.txtmodified+6−4View file
Documentation/devicetree/bindings/net/rockchip-dwmac.txtmodified+1−0View file
arch/x86/net/bpf_jit_comp.cmodified+2−2View file
drivers/net/dsa/mv88e6xxx/chip.cmodified+6−0View file
drivers/net/ethernet/aquantia/atlantic/aq_cfg.hmodified+4−0View file
drivers/net/ethernet/aquantia/atlantic/aq_nic.cmodified+68−77View file
drivers/net/ethernet/aquantia/atlantic/aq_nic.hmodified+0−2View file
drivers/net/ethernet/aquantia/atlantic/aq_ring.cmodified+45−8View file
drivers/net/ethernet/aquantia/atlantic/aq_ring.hmodified+8−2View file
drivers/net/ethernet/aquantia/atlantic/aq_vec.cmodified+2−6View file
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.hmodified+1−1View file
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.cmodified+1−2View file
drivers/net/ethernet/broadcom/cnic.cmodified+1−1View file
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.cmodified+2−1View file
drivers/net/ethernet/marvell/mvpp2.cmodified+35−11View file
drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.hmodified+2−2View file
drivers/net/ethernet/mellanox/mlx5/core/en_fs.cmodified+2−2View file
drivers/net/ethernet/mellanox/mlx5/core/en_main.cmodified+5−8View file
drivers/net/ethernet/mellanox/mlx5/core/en_rx.cmodified+3−0View file
drivers/net/ethernet/mellanox/mlx5/core/en_stats.hmodified+6−0View file
drivers/net/ethernet/mellanox/mlx5/core/en_tc.cmodified+83−8View file
drivers/net/ethernet/mellanox/mlx5/core/en_tx.cmodified+1−0View file
drivers/net/ethernet/mellanox/mlx5/core/fpga/cmd.cmodified+2−2View file
drivers/net/ethernet/mellanox/mlx5/core/fpga/cmd.hmodified+1−1View file
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.cmodified+1−2View file
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.cmodified+8−0View file
drivers/net/ethernet/mellanox/mlx5/core/fs_core.hmodified+11−0View file
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.cmodified+2−1View file
drivers/net/ethernet/mellanox/mlx5/core/sriov.cmodified+1−1View file
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.cmodified+14−4View file
drivers/net/ethernet/qualcomm/emac/emac-mac.cmodified+2−1View file
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.cmodified+1−4View file
drivers/net/ethernet/rocker/rocker_tlv.hmodified+30−18View file
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.cmodified+1−0View file
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.cmodified+112−0View file
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.cmodified+7−0View file
drivers/net/ppp/ppp_generic.cmodified+1−1View file
drivers/net/tun.cmodified+5−3View file
drivers/net/usb/cdc_ether.cmodified+20−1View file
drivers/net/usb/r8152.cmodified+2−0View file
drivers/net/usb/rndis_host.cmodified+4−0View file
drivers/net/wireless/ath/ath10k/pci.cmodified+2−5View file
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.cmodified+19−18View file
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.hmodified+5−0View file
drivers/net/wireless/intel/iwlwifi/mvm/d3.cmodified+1−1View file
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.cmodified+59−3View file
drivers/net/wireless/intel/iwlwifi/mvm/rs.cmodified+2−1View file
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.cmodified+4−3View file
drivers/net/wireless/intel/iwlwifi/mvm/scan.cmodified+1−1View file
drivers/net/wireless/intel/iwlwifi/mvm/sta.cmodified+5−3View file
drivers/net/wireless/intel/iwlwifi/mvm/sta.hmodified+2−0View file
drivers/net/wireless/intel/iwlwifi/mvm/tt.cmodified+1−0View file
drivers/net/wireless/intel/iwlwifi/mvm/tx.cmodified+5−5View file
drivers/net/wireless/quantenna/qtnfmac/cfg80211.cmodified+6−3View file
drivers/net/wireless/quantenna/qtnfmac/cfg80211.hmodified+3−0View file
drivers/net/wireless/quantenna/qtnfmac/event.cmodified+0−2View file
drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.cmodified+8−1View file
drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.hmodified+2−0View file
include/linux/mlx5/device.hmodified+2−3View file
include/linux/mlx5/driver.hmodified+1−0View file
include/linux/mlx5/mlx5_ifc.hmodified+2−1View file
include/net/netlink.hmodified+55−18View file
include/net/protocol.hmodified+2−2View file
include/net/route.hmodified+3−1View file
include/net/tcp.hmodified+1−1View file
include/net/udp.hmodified+1−1View file
include/uapi/linux/bpf.hmodified+1−1View file
kernel/bpf/core.cmodified+1−1View file
net/8021q/vlan_core.cmodified+6−0View file
net/core/filter.cmodified+8−4View file
net/core/rtnetlink.cmodified+3−0View file
net/core/sock.cmodified+6−1View file
net/dsa/slave.cmodified+18−13View file
net/ipv4/inetpeer.cmodified+2−2View file
net/ipv4/ip_gre.cmodified+7−5View file
net/ipv4/ip_input.cmodified+15−10View file
net/ipv4/ip_vti.cmodified+2−1View file
net/ipv4/route.cmodified+26−20View file
net/ipv4/tcp_ipv4.cmodified+5−4View file
net/ipv4/udp.cmodified+18−6View file
net/ipv6/ip6_gre.cmodified+1−0View file
net/ipv6/ip6_tunnel.cmodified+3−2View file
net/ipv6/ip6_vti.cmodified+2−1View file
net/l2tp/l2tp_core.cmodified+10−6View file
net/l2tp/l2tp_core.hmodified+5−1View file
net/l2tp/l2tp_eth.cmodified+2−49View file
net/l2tp/l2tp_ppp.cmodified+4−4View file
net/netlink/af_netlink.cmodified+5−2View file
net/packet/af_packet.cmodified+8−4View file
net/sctp/sctp_diag.cmodified+3−1View file
net/tipc/msg.cmodified+1−1View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/net/marvell-pp2.txt

View file
diff --git a/Documentation/devicetree/bindings/net/marvell-pp2.txt b/Documentation/devicetree/bindings/net/marvell-pp2.txt
index 7e2dad0..1814fa1 100644
--- a/Documentation/devicetree/bindings/net/marvell-pp2.txt
+++ b/Documentation/devicetree/bindings/net/marvell-pp2.txt
@@ -21,8 +21,9 @@ Required properties:
- main controller clock (for both armada-375-pp2 and armada-7k-pp2)
- GOP clock (for both armada-375-pp2 and armada-7k-pp2)
- MG clock (only for armada-7k-pp2)
-- clock-names: names of used clocks, must be "pp_clk", "gop_clk" and
- "mg_clk" (the latter only for armada-7k-pp2).
+ - AXI clock (only for armada-7k-pp2)
+- clock-names: names of used clocks, must be "pp_clk", "gop_clk", "mg_clk"
+ and "axi_clk" (the 2 latter only for armada-7k-pp2).
The ethernet ports are represented by subnodes. At least one port is
required.
@@ -78,8 +79,9 @@ Example for marvell,armada-7k-pp2:
cpm_ethernet: ethernet@0 {
compatible = "marvell,armada-7k-pp22";
reg = <0x0 0x100000>, <0x129000 0xb000>;
- clocks = <&cpm_syscon0 1 3>, <&cpm_syscon0 1 9>, <&cpm_syscon0 1 5>;
- clock-names = "pp_clk", "gop_clk", "gp_clk";
+ clocks = <&cpm_syscon0 1 3>, <&cpm_syscon0 1 9>,
+ <&cpm_syscon0 1 5>, <&cpm_syscon0 1 18>;
+ clock-names = "pp_clk", "gop_clk", "gp_clk", "axi_clk";
eth0: eth0 {
interrupts = <ICU_GRP_NSR 39 IRQ_TYPE_LEVEL_HIGH>,

Documentation/devicetree/bindings/net/rockchip-dwmac.txt

View file
diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.txt b/Documentation/devicetree/bindings/net/rockchip-dwmac.txt
index 6af8eed..9c16ee2 100644
--- a/Documentation/devicetree/bindings/net/rockchip-dwmac.txt
+++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.txt
@@ -4,6 +4,7 @@ The device node has following properties.
Required properties:
- compatible: should be "rockchip,<name>-gamc"
+ "rockchip,rk3128-gmac": found on RK312x SoCs
"rockchip,rk3228-gmac": found on RK322x SoCs
"rockchip,rk3288-gmac": found on RK3288 SoCs
"rockchip,rk3328-gmac": found on RK3328 SoCs

arch/x86/net/bpf_jit_comp.c

View file
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 8c95736..0554e8a 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -284,9 +284,9 @@ static void emit_bpf_tail_call(u8 **pprog)
/* if (index >= array->map.max_entries)
* goto out;
*/
- EMIT4(0x48, 0x8B, 0x46, /* mov rax, qword ptr [rsi + 16] */
+ EMIT2(0x89, 0xD2); /* mov edx, edx */
+ EMIT3(0x39, 0x56, /* cmp dword ptr [rsi + 16], edx */
offsetof(struct bpf_array, map.max_entries));
- EMIT3(0x48, 0x39, 0xD0); /* cmp rax, rdx */
#define OFFSET1 43 /* number of bytes to jump */
EMIT2(X86_JBE, OFFSET1); /* jbe out */
label1 = cnt;

drivers/net/dsa/mv88e6xxx/chip.c

View file
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index c6678aa..d74c733 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1100,6 +1100,10 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
};
int i, err;
+ /* DSA and CPU ports have to be members of multiple vlans */
+ if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
+ return 0;
+
if (!vid_begin)
return -EOPNOTSUPP;
@@ -3947,7 +3951,9 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev)
if (chip->irq > 0) {
if (chip->info->g2_irqs > 0)
mv88e6xxx_g2_irq_free(chip);
+ mutex_lock(&chip->reg_lock);
mv88e6xxx_g1_irq_free(chip);
+ mutex_unlock(&chip->reg_lock);
}
}

drivers/net/ethernet/aquantia/atlantic/aq_cfg.h

View file
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h
index 2149864..0fdaaa6 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h
@@ -51,6 +51,10 @@
#define AQ_CFG_SKB_FRAGS_MAX 32U
+/* Number of descriptors available in one ring to resume this ring queue
+ */
+#define AQ_CFG_RESTART_DESC_THRES (AQ_CFG_SKB_FRAGS_MAX * 2)
+
#define AQ_CFG_NAPI_WEIGHT 64U
#define AQ_CFG_MULTICAST_ADDRESS_MAX 32U

drivers/net/ethernet/aquantia/atlantic/aq_nic.c

View file
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index 6ac9e26..0a5bb41 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -119,6 +119,35 @@ int aq_nic_cfg_start(struct aq_nic_s *self)
return 0;
}
+static int aq_nic_update_link_status(struct aq_nic_s *self)
+{
+ int err = self->aq_hw_ops.hw_get_link_status(self->aq_hw);
+
+ if (err)
+ return err;
+
+ if (self->link_status.mbps != self->aq_hw->aq_link_status.mbps)
+ pr_info("%s: link change old %d new %d\n",
+ AQ_CFG_DRV_NAME, self->link_status.mbps,
+ self->aq_hw->aq_link_status.mbps);
+
+ self->link_status = self->aq_hw->aq_link_status;
+ if (!netif_carrier_ok(self->ndev) && self->link_status.mbps) {
+ aq_utils_obj_set(&self->header.flags,
+ AQ_NIC_FLAG_STARTED);
+ aq_utils_obj_clear(&self->header.flags,
+ AQ_NIC_LINK_DOWN);
+ netif_carrier_on(self->ndev);
+ netif_tx_wake_all_queues(self->ndev);
+ }
+ if (netif_carrier_ok(self->ndev) && !self->link_status.mbps) {
+ netif_carrier_off(self->ndev);
+ netif_tx_disable(self->ndev);
+ aq_utils_obj_set(&self->header.flags, AQ_NIC_LINK_DOWN);
+ }
+ return 0;
+}
+
static void aq_nic_service_timer_cb(unsigned long param)
{
struct aq_nic_s *self = (struct aq_nic_s *)param;
@@ -131,26 +160,13 @@ static void aq_nic_service_timer_cb(unsigned long param)
if (aq_utils_obj_test(&self->header.flags, AQ_NIC_FLAGS_IS_NOT_READY))
goto err_exit;
- err = self->aq_hw_ops.hw_get_link_status(self->aq_hw);
- if (err < 0)
+ err = aq_nic_update_link_status(self);
+ if (err)
goto err_exit;
- self->link_status = self->aq_hw->aq_link_status;
-
self->aq_hw_ops.hw_interrupt_moderation_set(self->aq_hw,
self->aq_nic_cfg.is_interrupt_moderation);
- if (self->link_status.mbps) {
- aq_utils_obj_set(&self->header.flags,
- AQ_NIC_FLAG_STARTED);
- aq_utils_obj_clear(&self->header.flags,
- AQ_NIC_LINK_DOWN);
- netif_carrier_on(self->ndev);
- } else {
- netif_carrier_off(self->ndev);
- aq_utils_obj_set(&self->header.flags, AQ_NIC_LINK_DOWN);
- }
-
memset(&stats_rx, 0U, sizeof(struct aq_ring_stats_rx_s));
memset(&stats_tx, 0U, sizeof(struct aq_ring_stats_tx_s));
for (i = AQ_DIMOF(self->aq_vec); i--;) {
@@ -214,7 +230,6 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops,
SET_NETDEV_DEV(ndev, dev);
ndev->if_port = port;
- ndev->min_mtu = ETH_MIN_MTU;
self->ndev = ndev;
self->aq_pci_func = aq_pci_func;
@@ -241,7 +256,6 @@ err_exit:
int aq_nic_ndev_register(struct aq_nic_s *self)
{
int err = 0;
- unsigned int i = 0U;
if (!self->ndev) {
err = -EINVAL;
@@ -263,8 +277,7 @@ int aq_nic_ndev_register(struct aq_nic_s *self)
netif_carrier_off(self->ndev);
- for (i = AQ_CFG_VECS_MAX; i--;)
- aq_nic_ndev_queue_stop(self, i);
+ netif_tx_disable(self->ndev);
err = register_netdev(self->ndev);
if (err < 0)
@@ -283,6 +296,7 @@ int aq_nic_ndev_init(struct aq_nic_s *self)
self->ndev->features = aq_hw_caps->hw_features;
self->ndev->priv_flags = aq_hw_caps->hw_priv_flags;
self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN;
+ self->ndev->max_mtu = self->aq_hw_caps.mtu - ETH_FCS_LEN - ETH_HLEN;
return 0;
}
@@ -318,12 +332,8 @@ struct aq_nic_s *aq_nic_alloc_hot(struct net_device *ndev)
err = -EINVAL;
goto err_exit;
}
- if (netif_running(ndev)) {
- unsigned int i;
-
- for (i = AQ_CFG_VECS_MAX; i--;)
- netif_stop_subqueue(ndev, i);
- }
+ if (netif_running(ndev))
+ netif_tx_disable(ndev);
for (self->aq_vecs = 0; self->aq_vecs < self->aq_nic_cfg.vecs;
self->aq_vecs++) {
@@ -383,16 +393,6 @@ err_exit:
return err;
}
-void aq_nic_ndev_queue_start(struct aq_nic_s *self, unsigned int idx)
-{
- netif_start_subqueue(self->ndev, idx);
-}
-
-void aq_nic_ndev_queue_stop(struct aq_nic_s *self, unsigned int idx)
-{
- netif_stop_subqueue(self->ndev, idx);
-}
-
int aq_nic_start(struct aq_nic_s *self)
{
struct aq_vec_s *aq_vec = NULL;
@@ -451,10 +451,6 @@ int aq_nic_start(struct aq_nic_s *self)
goto err_exit;
}
- for (i = 0U, aq_vec = self->aq_vec[0];
- self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i])
- aq_nic_ndev_queue_start(self, i);
-
err = netif_set_real_num_tx_queues(self->ndev, self->aq_vecs);
if (err < 0)
goto err_exit;
@@ -463,6 +459,8 @@ int aq_nic_start(struct aq_nic_s *self)
if (err < 0)
goto err_exit;
+ netif_tx_start_all_queues(self->ndev);
+
err_exit:
return err;
}
@@ -475,6 +473,7 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self,
unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
unsigned int frag_count = 0U;
unsigned int dx = ring->sw_tail;
+ struct aq_ring_buff_s *first = NULL;
struct aq_ring_buff_s *dx_buff = &ring->buff_ring[dx];
if (unlikely(skb_is_gso(skb))) {
@@ -485,6 +484,7 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self,
dx_buff->len_l4 = tcp_hdrlen(skb);
dx_buff->mss = skb_shinfo(skb)->gso_size;
dx_buff->is_txc = 1U;
+ dx_buff->eop_index = 0xffffU;
dx_buff->is_ipv6 =
(ip_hdr(skb)->version == 6) ? 1U : 0U;
@@ -504,6 +504,7 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self,
if (unlikely(dma_mapping_error(aq_nic_get_dev(self), dx_buff->pa)))
goto exit;
+ first = dx_buff;
dx_buff->len_pkt = skb->len;
dx_buff->is_sop = 1U;
dx_buff->is_mapped = 1U;
@@ -532,40 +533,46 @@ static unsigned int aq_nic_map_skb(struct aq_nic_s *self,
for (; nr_frags--; ++frag_count) {
unsigned int frag_len = 0U;
+ unsigned int buff_offset = 0U;
+ unsigned int buff_size = 0U;
dma_addr_t frag_pa;
skb_frag_t *frag = &skb_shinfo(skb)->frags[frag_count];
frag_len = skb_frag_size(frag);
- frag_pa = skb_frag_dma_map(aq_nic_get_dev(self), frag, 0,
- frag_len, DMA_TO_DEVICE);
- if (unlikely(dma_mapping_error(aq_nic_get_dev(self), frag_pa)))
- goto mapping_error;
+ while (frag_len) {
+ if (frag_len > AQ_CFG_TX_FRAME_MAX)
+ buff_size = AQ_CFG_TX_FRAME_MAX;
+ else
+ buff_size = frag_len;
+
+ frag_pa = skb_frag_dma_map(aq_nic_get_dev(self),
+ frag,
+ buff_offset,
+ buff_size,
+ DMA_TO_DEVICE);
+
+ if (unlikely(dma_mapping_error(aq_nic_get_dev(self),
+ frag_pa)))
+ goto mapping_error;
- while (frag_len > AQ_CFG_TX_FRAME_MAX) {
dx = aq_ring_next_dx(ring, dx);
dx_buff = &ring->buff_ring[dx];
dx_buff->flags = 0U;
- dx_buff->len = AQ_CFG_TX_FRAME_MAX;
+ dx_buff->len = buff_size;
dx_buff->pa = frag_pa;
dx_buff->is_mapped = 1U;
+ dx_buff->eop_index = 0xffffU;
+
+ frag_len -= buff_size;
+ buff_offset += buff_size;
- frag_len -= AQ_CFG_TX_FRAME_MAX;
- frag_pa += AQ_CFG_TX_FRAME_MAX;
++ret;
}
-
- dx = aq_ring_next_dx(ring, dx);
- dx_buff = &ring->buff_ring[dx];
-
- dx_buff->flags = 0U;
- dx_buff->len = frag_len;
- dx_buff->pa = frag_pa;
- dx_buff->is_mapped = 1U;
- ++ret;
}
+ first->eop_index = dx;
dx_buff->is_eop = 1U;
dx_buff->skb = skb;
goto exit;
@@ -602,7 +609,6 @@ int aq_nic_xmit(struct aq_nic_s *self, struct sk_buff *skb)
unsigned int vec = skb->queue_mapping % self->aq_nic_cfg.vecs;
unsigned int tc = 0U;
int err = NETDEV_TX_OK;
- bool is_nic_in_bad_state;
frags = skb_shinfo(skb)->nr_frags + 1;
@@ -613,13 +619,10 @@ int aq_nic_xmit(struct aq_nic_s *self, struct sk_buff *skb)
goto err_exit;
}
- is_nic_in_bad_state = aq_utils_obj_test(&self->header.flags,
- AQ_NIC_FLAGS_IS_NOT_TX_READY) ||
- (aq_ring_avail_dx(ring) <
- AQ_CFG_SKB_FRAGS_MAX);
+ aq_ring_update_queue_state(ring);
- if (is_nic_in_bad_state) {
- aq_nic_ndev_queue_stop(self, ring->idx);
+ /* Above status update may stop the queue. Check this. */
+ if (__netif_subqueue_stopped(self->ndev, ring->idx)) {
err = NETDEV_TX_BUSY;
goto err_exit;
}
@@ -631,9 +634,6 @@ int aq_nic_xmit(struct aq_nic_s *self, struct sk_buff *skb)
ring,
frags);
if (err >= 0) {
- if (aq_ring_avail_dx(ring) < AQ_CFG_SKB_FRAGS_MAX + 1)
- aq_nic_ndev_queue_stop(self, ring->idx);
-
++ring->stats.tx.packets;
ring->stats.tx.bytes += skb->len;
}
@@ -693,16 +693,9 @@ int aq_nic_set_multicast_list(struct aq_nic_s *self, struct net_device *ndev)
int aq_nic_set_mtu(struct aq_nic_s *self, int new_mtu)
{
- int err = 0;
-
- if (new_mtu > self->aq_hw_caps.mtu) {
- err = -EINVAL;
- goto err_exit;
- }
self->aq_nic_cfg.mtu = new_mtu;
-err_exit:
- return err;
+ return 0;
}
int aq_nic_set_mac(struct aq_nic_s *self, struct net_device *ndev)
@@ -905,9 +898,7 @@ int aq_nic_stop(struct aq_nic_s *self)
struct aq_vec_s *aq_vec = NULL;
unsigned int i = 0U;
- for (i = 0U, aq_vec = self->aq_vec[0];
- self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i])
- aq_nic_ndev_queue_stop(self, i);
+ netif_tx_disable(self->ndev);
del_timer_sync(&self->service_timer);

drivers/net/ethernet/aquantia/atlantic/aq_nic.h

View file
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
index 7fc2a5e..0ddd556 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
@@ -83,8 +83,6 @@ struct net_device *aq_nic_get_ndev(struct aq_nic_s *self);
int aq_nic_init(struct aq_nic_s *self);
int aq_nic_cfg_start(struct aq_nic_s *self);
int aq_nic_ndev_register(struct aq_nic_s *self);
-void aq_nic_ndev_queue_start(struct aq_nic_s *self, unsigned int idx);
-void aq_nic_ndev_queue_stop(struct aq_nic_s *self, unsigned int idx);
void aq_nic_ndev_free(struct aq_nic_s *self);
int aq_nic_start(struct aq_nic_s *self);
int aq_nic_xmit(struct aq_nic_s *self, struct sk_buff *skb);

drivers/net/ethernet/aquantia/atlantic/aq_ring.c

View file
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
index 4eee199..0654e0c 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.c
@@ -104,6 +104,38 @@ int aq_ring_init(struct aq_ring_s *self)
return 0;
}
+static inline bool aq_ring_dx_in_range(unsigned int h, unsigned int i,
+ unsigned int t)
+{
+ return (h < t) ? ((h < i) && (i < t)) : ((h < i) || (i < t));
+}
+
+void aq_ring_update_queue_state(struct aq_ring_s *ring)
+{
+ if (aq_ring_avail_dx(ring) <= AQ_CFG_SKB_FRAGS_MAX)
+ aq_ring_queue_stop(ring);
+ else if (aq_ring_avail_dx(ring) > AQ_CFG_RESTART_DESC_THRES)
+ aq_ring_queue_wake(ring);
+}
+
+void aq_ring_queue_wake(struct aq_ring_s *ring)
+{
+ struct net_device *ndev = aq_nic_get_ndev(ring->aq_nic);
+
+ if (__netif_subqueue_stopped(ndev, ring->idx)) {
+ netif_wake_subqueue(ndev, ring->idx);
+ ring->stats.tx.queue_restarts++;
+ }
+}
+
+void aq_ring_queue_stop(struct aq_ring_s *ring)
+{
+ struct net_device *ndev = aq_nic_get_ndev(ring->aq_nic);
+
+ if (!__netif_subqueue_stopped(ndev, ring->idx))
+ netif_stop_subqueue(ndev, ring->idx);
+}
+
void aq_ring_tx_clean(struct aq_ring_s *self)
{
struct device *dev = aq_nic_get_dev(self->aq_nic);
@@ -113,23 +145,28 @@ void aq_ring_tx_clean(struct aq_ring_s *self)
struct aq_ring_buff_s *buff = &self->buff_ring[self->sw_head];
if (likely(buff->is_mapped)) {
- if (unlikely(buff->is_sop))
+ if (unlikely(buff->is_sop)) {
+ if (!buff->is_eop &&
+ buff->eop_index != 0xffffU &&
+ (!aq_ring_dx_in_range(self->sw_head,
+ buff->eop_index,
+ self->hw_head)))
+ break;
+
dma_unmap_single(dev, buff->pa, buff->len,
DMA_TO_DEVICE);
- else
+ } else {
dma_unmap_page(dev, buff->pa, buff->len,
DMA_TO_DEVICE);
+ }
}
if (unlikely(buff->is_eop))
dev_kfree_skb_any(buff->skb);
- }
-}
-static inline unsigned int aq_ring_dx_in_range(unsigned int h, unsigned int i,
- unsigned int t)
-{
- return (h < t) ? ((h < i) && (i < t)) : ((h < i) || (i < t));
+ buff->pa = 0U;
+ buff->eop_index = 0xffffU;
+ }
}
#define AQ_SKB_ALIGN SKB_DATA_ALIGN(sizeof(struct skb_shared_info))

drivers/net/ethernet/aquantia/atlantic/aq_ring.h

View file
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
index 782176c..5844078 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h
@@ -65,7 +65,7 @@ struct __packed aq_ring_buff_s {
};
union {
struct {
- u32 len:16;
+ u16 len;
u32 is_ip_cso:1;
u32 is_udp_cso:1;
u32 is_tcp_cso:1;
@@ -77,8 +77,10 @@ struct __packed aq_ring_buff_s {
u32 is_cleaned:1;
u32 is_error:1;
u32 rsvd3:6;
+ u16 eop_index;
+ u16 rsvd4;
};
- u32 flags;
+ u64 flags;
};
};
@@ -94,6 +96,7 @@ struct aq_ring_stats_tx_s {
u64 errors;
u64 packets;
u64 bytes;
+ u64 queue_restarts;
};
union aq_ring_stats_s {
@@ -147,6 +150,9 @@ struct aq_ring_s *aq_ring_rx_alloc(struct aq_ring_s *self,
int aq_ring_init(struct aq_ring_s *self);
void aq_ring_rx_deinit(struct aq_ring_s *self);
void aq_ring_free(struct aq_ring_s *self);
+void aq_ring_update_queue_state(struct aq_ring_s *ring);
+void aq_ring_queue_wake(struct aq_ring_s *ring);
+void aq_ring_queue_stop(struct aq_ring_s *ring);
void aq_ring_tx_clean(struct aq_ring_s *self);
int aq_ring_rx_clean(struct aq_ring_s *self,
struct napi_struct *napi,

drivers/net/ethernet/aquantia/atlantic/aq_vec.c

View file
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
index ebf5880..305ff8f 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_vec.c
@@ -59,12 +59,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget)
if (ring[AQ_VEC_TX_ID].sw_head !=
ring[AQ_VEC_TX_ID].hw_head) {
aq_ring_tx_clean(&ring[AQ_VEC_TX_ID]);
-
- if (aq_ring_avail_dx(&ring[AQ_VEC_TX_ID]) >
- AQ_CFG_SKB_FRAGS_MAX) {
- aq_nic_ndev_queue_start(self->aq_nic,
- ring[AQ_VEC_TX_ID].idx);
- }
+ aq_ring_update_queue_state(&ring[AQ_VEC_TX_ID]);
was_tx_cleaned = true;
}
@@ -364,6 +359,7 @@ void aq_vec_add_stats(struct aq_vec_s *self,
stats_tx->packets += tx->packets;
stats_tx->bytes += tx->bytes;
stats_tx->errors += tx->errors;
+ stats_tx->queue_restarts += tx->queue_restarts;
}
}

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h

View file
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
index f3957e9..fcf89e2 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h
@@ -16,7 +16,7 @@
#include "../aq_common.h"
-#define HW_ATL_B0_MTU_JUMBO (16000U)
+#define HW_ATL_B0_MTU_JUMBO 16352U
#define HW_ATL_B0_MTU 1514U
#define HW_ATL_B0_TX_RINGS 4U

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c

View file
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
index 4f5ec9a..bf734b3 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
@@ -351,8 +351,7 @@ int hw_atl_utils_mpi_get_link_status(struct aq_hw_s *self)
break;
default:
- link_status->mbps = 0U;
- break;
+ return -EBUSY;
}
}

drivers/net/ethernet/broadcom/cnic.c

View file
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index cec94bb..8bc126a 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -1278,7 +1278,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev)
ret = cnic_alloc_dma(dev, kwq_16_dma, pages, 0);
if (ret)

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/marvell/mvpp2.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en_fs.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en_stats.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en_tx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/fpga/cmd.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/fpga/cmd.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/fs_core.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/sriov.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/qualcomm/emac/emac-mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/rocker/rocker_tlv.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ppp/ppp_generic.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/tun.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/cdc_ether.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/r8152.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/rndis_host.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/ath/ath10k/pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/d3.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/rs.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/scan.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/sta.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/sta.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/tt.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/mvm/tx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/quantenna/qtnfmac/cfg80211.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/quantenna/qtnfmac/event.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/quantenna/qtnfmac/pearl/pcie_bus_priv.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mlx5/device.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mlx5/driver.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mlx5/mlx5_ifc.h

View file

This diff is incomplete. Download the complete patch.

include/net/netlink.h

View file

This diff is incomplete. Download the complete patch.

include/net/protocol.h

View file

This diff is incomplete. Download the complete patch.

include/net/route.h

View file

This diff is incomplete. Download the complete patch.

include/net/tcp.h

View file

This diff is incomplete. Download the complete patch.

include/net/udp.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/bpf.h

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/core.c

View file

This diff is incomplete. Download the complete patch.

net/8021q/vlan_core.c

View file

This diff is incomplete. Download the complete patch.

net/core/filter.c

View file

This diff is incomplete. Download the complete patch.

net/core/rtnetlink.c

View file

This diff is incomplete. Download the complete patch.

net/core/sock.c

View file

This diff is incomplete. Download the complete patch.

net/dsa/slave.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/inetpeer.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ip_gre.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ip_input.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ip_vti.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/route.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_ipv4.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/udp.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/ip6_gre.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/ip6_tunnel.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/ip6_vti.c

View file

This diff is incomplete. Download the complete patch.

net/l2tp/l2tp_core.c

View file

This diff is incomplete. Download the complete patch.

net/l2tp/l2tp_core.h

View file

This diff is incomplete. Download the complete patch.

net/l2tp/l2tp_eth.c

View file

This diff is incomplete. Download the complete patch.

net/l2tp/l2tp_ppp.c

View file

This diff is incomplete. Download the complete patch.

net/netlink/af_netlink.c

View file

This diff is incomplete. Download the complete patch.

net/packet/af_packet.c

View file

This diff is incomplete. Download the complete patch.

net/sctp/sctp_diag.c

View file

This diff is incomplete. Download the complete patch.

net/tipc/msg.c

View file

This diff is incomplete. Download the complete patch.