projects/linux·commit 180f3bcf

Merge tag 'net-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

180f3bcf · Linus Torvalds <[email protected]> · 2021-12-16 15:02:14 -08:00

Pull networking fixes from Jakub Kicinski:
 "Networking fixes, including fixes from mac80211, wifi, bpf.

  Relatively large batches of fixes from BPF and the WiFi stack, calm in
  general networking.

  Current release - regressions:

   - dpaa2-eth: fix buffer overrun when reporting ethtool statistics

  Current release - new code bugs:

   - bpf: fix incorrect state pruning for <8B spill/fill

   - iavf:
       - add missing unlocks in iavf_watchdog_task()
       - do not override the adapter state in the watchdog task (again)

   - mlxsw: spectrum_router: consolidate MAC profiles when possible

  Previous releases - regressions:

   - mac80211 fixes:
       - rate control, avoid driver crash for retransmitted frames
       - regression in SSN handling of addba tx
       - a memory leak where sta_info is not freed
       - marking TX-during-stop for TX in in_reconfig, prevent stall

   - cfg80211: acquire wiphy mutex on regulatory work

   - wifi drivers: fix build regressions and LED config dependency

   - virtio_net: fix rx_drops stat for small pkts

   - dsa: mv88e6xxx: unforce speed & duplex in mac_link_down()

  Previous releases - always broken:

   - bpf fixes:
       - kernel address leakage in atomic fetch
       - kernel address leakage in atomic cmpxchg's r0 aux reg
       - signed bounds propagation after mov32
       - extable fixup offset
       - extable address check

   - mac80211:
       - fix the size used for building probe request
       - send ADDBA requests using the tid/queue of the aggregation
         session
       - agg-tx: don't schedule_and_wake_txq() under sta->lock, avoid
         deadlocks
       - validate extended element ID is present

   - mptcp:
       - never allow the PM to close a listener subflow (null-defer)
       - clear 'kern' flag from fallback sockets, prevent crash
       - fix deadlock in __mptcp_push_pending()

   - inet_diag: fix kernel-infoleak for UDP sockets

   - xsk: do not sleep in poll() when need_wakeup set

   - smc: avoid very long waits in smc_release()

   - sch_ets: don't remove idle classes from the round-robin list

   - netdevsim:
       - zero-initialize memory for bpf map's value, prevent info leak
       - don't let user space overwrite read only (max) ethtool parms

   - ixgbe: set X550 MDIO speed before talking to PHY

   - stmmac:
       - fix null-deref in flower deletion w/ VLAN prio Rx steering
       - dwmac-rk: fix oob read in rk_gmac_setup

   - ice: time stamping fixes

   - systemport: add global locking for descriptor life cycle"

* tag 'net-5.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (89 commits)
  bpf, selftests: Fix racing issue in btf_skc_cls_ingress test
  selftest/bpf: Add a test that reads various addresses.
  bpf: Fix extable address check.
  bpf: Fix extable fixup offset.
  bpf, selftests: Add test case trying to taint map value pointer
  bpf: Make 32->64 bounds propagation slightly more robust
  bpf: Fix signed bounds propagation after mov32
  sit: do not call ipip6_dev_free() from sit_init_net()
  net: systemport: Add global locking for descriptor lifecycle
  net/smc: Prevent smc_release() from long blocking
  net: Fix double 0x prefix print in SKB dump
  virtio_net: fix rx_drops stat for small pkts
  dsa: mv88e6xxx: fix debug print for SPEED_UNFORCED
  sfc_ef100: potential dereference of null pointer
  net: stmmac: dwmac-rk: fix oob read in rk_gmac_setup
  net: usb: lan78xx: add Allied Telesis AT29M2-AF
  net/packet: rx_owner_map depends on pg_vec
  netdevsim: Zero-initialize memory for new map's value in function nsim_bpf_map_alloc
  dpaa2-eth: fix ethtool statistics
  ixgbe: set X550 MDIO speed before talking to PHY
  ...
Commit
180f3bcfe3622bb78307dcc4fe1f8f4a717ee0ba
Parents
93db8300 · 0c3e2474

Merge commit. Changes below are compared with the first parent: 93db8300.

Changes

81 files changed · +881 −198

FileStatusAddDelContent
Documentation/networking/device_drivers/ethernet/intel/ixgbe.rstmodified+16−0View file
MAINTAINERSmodified+6−6View file
arch/x86/net/bpf_jit_comp.cmodified+43−8View file
drivers/net/dsa/mv88e6xxx/chip.cmodified+4−0View file
drivers/net/dsa/mv88e6xxx/port.cmodified+2−2View file
drivers/net/ethernet/broadcom/bcmsysport.cmodified+4−1View file
drivers/net/ethernet/broadcom/bcmsysport.hmodified+1−0View file
drivers/net/ethernet/broadcom/genet/bcmmii.cmodified+2−2View file
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.hmodified+2−0View file
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.cmodified+1−1View file
drivers/net/ethernet/hisilicon/hns3/hnae3.hmodified+2−0View file
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.cmodified+14−6View file
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.cmodified+2−1View file
drivers/net/ethernet/intel/iavf/iavf_main.cmodified+2−3View file
drivers/net/ethernet/intel/ice/ice_ptp.cmodified+5−8View file
drivers/net/ethernet/intel/ice/ice_ptp.hmodified+6−0View file
drivers/net/ethernet/intel/igb/igb_main.cmodified+14−14View file
drivers/net/ethernet/intel/igbvf/netdev.cmodified+1−0View file
drivers/net/ethernet/intel/igc/igc_i225.cmodified+1−1View file
drivers/net/ethernet/intel/ixgbe/ixgbe_main.cmodified+4−0View file
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.cmodified+3−0View file
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.cmodified+2−1View file
drivers/net/ethernet/sfc/ef100_nic.cmodified+3−0View file
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.cmodified+3−1View file
drivers/net/ethernet/stmicro/stmmac/stmmac.hmodified+17−0View file
drivers/net/ethernet/stmicro/stmmac/stmmac_main.cmodified+12−4View file
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.cmodified+73−13View file
drivers/net/ethernet/ti/am65-cpsw-nuss.cmodified+20−9View file
drivers/net/netdevsim/bpf.cmodified+1−0View file
drivers/net/netdevsim/ethtool.cmodified+4−1View file
drivers/net/phy/mdio_bus.cmodified+3−0View file
drivers/net/usb/lan78xx.cmodified+6−0View file
drivers/net/usb/qmi_wwan.cmodified+1−0View file
drivers/net/virtio_net.cmodified+3−6View file
drivers/net/wireless/broadcom/brcm80211/Kconfigmodified+9−5View file
drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefilemodified+1−1View file
drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.hmodified+1−1View file
drivers/net/wireless/intel/iwlegacy/Kconfigmodified+2−2View file
drivers/net/wireless/intel/iwlwifi/Kconfigmodified+1−1View file
drivers/net/wireless/intel/iwlwifi/mvm/tx.cmodified+3−2View file
drivers/net/wireless/mediatek/mt76/Makefilemodified+1−1View file
include/uapi/linux/mptcp.hmodified+10−8View file
kernel/bpf/verifier.cmodified+36−17View file
net/core/skbuff.cmodified+1−1View file
net/ipv4/inet_diag.cmodified+1−3View file
net/ipv6/sit.cmodified+0−1View file
net/mac80211/agg-rx.cmodified+3−2View file
net/mac80211/agg-tx.cmodified+11−5View file
net/mac80211/driver-ops.hmodified+4−1View file
net/mac80211/mlme.cmodified+10−3View file
net/mac80211/rx.cmodified+1−0View file
net/mac80211/sta_info.cmodified+12−9View file
net/mac80211/sta_info.hmodified+2−0View file
net/mac80211/tx.cmodified+5−5View file
net/mac80211/util.cmodified+14−9View file
net/mptcp/pm_netlink.cmodified+3−0View file
net/mptcp/protocol.cmodified+4−2View file
net/mptcp/sockopt.cmodified+0−1View file
net/packet/af_packet.cmodified+3−2View file
net/phonet/pep.cmodified+1−0View file
net/rds/connection.cmodified+1−0View file
net/sched/cls_api.cmodified+1−0View file
net/sched/sch_cake.cmodified+1−5View file
net/sched/sch_ets.cmodified+2−2View file
net/smc/af_smc.cmodified+3−1View file
net/wireless/reg.cmodified+28−2View file
net/xdp/xsk.cmodified+2−2View file
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.cmodified+20−0View file
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.cmodified+14−2View file
tools/testing/selftests/bpf/progs/test_module_attach.cmodified+12−0View file
tools/testing/selftests/bpf/test_verifier.cmodified+1−1View file
tools/testing/selftests/bpf/verifier/atomic_cmpxchg.cmodified+86−0View file
tools/testing/selftests/bpf/verifier/atomic_fetch.cmodified+94−0View file
tools/testing/selftests/bpf/verifier/search_pruning.cmodified+71−0View file
tools/testing/selftests/bpf/verifier/spill_fill.cmodified+32−0View file
tools/testing/selftests/bpf/verifier/value_ptr_arith.cmodified+23−0View file
tools/testing/selftests/drivers/net/mlxsw/rif_mac_profiles_occ.shmodified+30−0View file
tools/testing/selftests/net/fcnal-test.shmodified+34−11View file
tools/testing/selftests/net/forwarding/forwarding.config.samplemodified+2−0View file
tools/testing/selftests/net/icmp_redirect.shmodified+1−1View file
tools/testing/selftests/net/toeplitz.cmodified+1−1View file

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

Documentation/networking/device_drivers/ethernet/intel/ixgbe.rst

View file
diff --git a/Documentation/networking/device_drivers/ethernet/intel/ixgbe.rst b/Documentation/networking/device_drivers/ethernet/intel/ixgbe.rst
index f1d5233..0a233b1 100644
--- a/Documentation/networking/device_drivers/ethernet/intel/ixgbe.rst
+++ b/Documentation/networking/device_drivers/ethernet/intel/ixgbe.rst
@@ -440,6 +440,22 @@ NOTE: For 82599-based network connections, if you are enabling jumbo frames in
a virtual function (VF), jumbo frames must first be enabled in the physical
function (PF). The VF MTU setting cannot be larger than the PF MTU.
+NBASE-T Support
+---------------
+The ixgbe driver supports NBASE-T on some devices. However, the advertisement
+of NBASE-T speeds is suppressed by default, to accommodate broken network
+switches which cannot cope with advertised NBASE-T speeds. Use the ethtool
+command to enable advertising NBASE-T speeds on devices which support it::
+
+ ethtool -s eth? advertise 0x1800000001028
+
+On Linux systems with INTERFACES(5), this can be specified as a pre-up command
+in /etc/network/interfaces so that the interface is always brought up with
+NBASE-T support, e.g.::
+
+ iface eth? inet dhcp
+ pre-up ethtool -s eth? advertise 0x1800000001028 || true
+
Generic Receive Offload, aka GRO
--------------------------------
The driver supports the in-kernel software implementation of GRO. GRO has

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 13f9a84..8b7a98d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3066,7 +3066,7 @@ F: Documentation/devicetree/bindings/phy/phy-ath79-usb.txt
F: drivers/phy/qualcomm/phy-ath79-usb.c
ATHEROS ATH GENERIC UTILITIES
-M: Kalle Valo <[email protected]>
+M: Kalle Valo <[email protected]>
S: Supported
F: drivers/net/wireless/ath/*
@@ -3081,7 +3081,7 @@ W: https://wireless.wiki.kernel.org/en/users/Drivers/ath5k
F: drivers/net/wireless/ath/ath5k/
ATHEROS ATH6KL WIRELESS DRIVER
-M: Kalle Valo <[email protected]>
+M: Kalle Valo <[email protected]>
S: Supported
W: https://wireless.wiki.kernel.org/en/users/Drivers/ath6kl
@@ -13248,7 +13248,7 @@ F: include/uapi/linux/if_*
F: include/uapi/linux/netdevice.h
NETWORKING DRIVERS (WIRELESS)
-M: Kalle Valo <[email protected]>
+M: Kalle Valo <[email protected]>
S: Maintained
Q: http://patchwork.kernel.org/project/linux-wireless/list/
@@ -15704,7 +15704,7 @@ T: git git://linuxtv.org/anttip/media_tree.git
F: drivers/media/tuners/qt1010*
QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
-M: Kalle Valo <[email protected]>
+M: Kalle Valo <[email protected]>
S: Supported
W: https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
@@ -15712,7 +15712,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
F: drivers/net/wireless/ath/ath10k/
QUALCOMM ATHEROS ATH11K WIRELESS DRIVER
-M: Kalle Valo <[email protected]>
+M: Kalle Valo <[email protected]>
S: Supported
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
@@ -15885,7 +15885,7 @@ F: Documentation/devicetree/bindings/media/*venus*
F: drivers/media/platform/qcom/venus/
QUALCOMM WCN36XX WIRELESS DRIVER
-M: Kalle Valo <[email protected]>
+M: Kalle Valo <[email protected]>
S: Supported
W: https://wireless.wiki.kernel.org/en/users/Drivers/wcn36xx

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 726700f..bafe36e 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -1252,19 +1252,54 @@ st: if (is_imm8(insn->off))
case BPF_LDX | BPF_MEM | BPF_DW:
case BPF_LDX | BPF_PROBE_MEM | BPF_DW:
if (BPF_MODE(insn->code) == BPF_PROBE_MEM) {
- /* test src_reg, src_reg */
- maybe_emit_mod(&prog, src_reg, src_reg, true); /* always 1 byte */
- EMIT2(0x85, add_2reg(0xC0, src_reg, src_reg));
- /* jne start_of_ldx */
- EMIT2(X86_JNE, 0);
+ /* Though the verifier prevents negative insn->off in BPF_PROBE_MEM
+ * add abs(insn->off) to the limit to make sure that negative
+ * offset won't be an issue.
+ * insn->off is s16, so it won't affect valid pointers.
+ */
+ u64 limit = TASK_SIZE_MAX + PAGE_SIZE + abs(insn->off);
+ u8 *end_of_jmp1, *end_of_jmp2;
+
+ /* Conservatively check that src_reg + insn->off is a kernel address:
+ * 1. src_reg + insn->off >= limit
+ * 2. src_reg + insn->off doesn't become small positive.
+ * Cannot do src_reg + insn->off >= limit in one branch,
+ * since it needs two spare registers, but JIT has only one.
+ */
+
+ /* movabsq r11, limit */
+ EMIT2(add_1mod(0x48, AUX_REG), add_1reg(0xB8, AUX_REG));
+ EMIT((u32)limit, 4);
+ EMIT(limit >> 32, 4);
+ /* cmp src_reg, r11 */
+ maybe_emit_mod(&prog, src_reg, AUX_REG, true);
+ EMIT2(0x39, add_2reg(0xC0, src_reg, AUX_REG));
+ /* if unsigned '<' goto end_of_jmp2 */
+ EMIT2(X86_JB, 0);
+ end_of_jmp1 = prog;
+
+ /* mov r11, src_reg */
+ emit_mov_reg(&prog, true, AUX_REG, src_reg);
+ /* add r11, insn->off */
+ maybe_emit_1mod(&prog, AUX_REG, true);
+ EMIT2_off32(0x81, add_1reg(0xC0, AUX_REG), insn->off);
+ /* jmp if not carry to start_of_ldx
+ * Otherwise ERR_PTR(-EINVAL) + 128 will be the user addr
+ * that has to be rejected.
+ */
+ EMIT2(0x73 /* JNC */, 0);
+ end_of_jmp2 = prog;
+
/* xor dst_reg, dst_reg */
emit_mov_imm32(&prog, false, dst_reg, 0);
/* jmp byte_after_ldx */
EMIT2(0xEB, 0);
- /* populate jmp_offset for JNE above */
- temp[4] = prog - temp - 5 /* sizeof(test + jne) */;
+ /* populate jmp_offset for JB above to jump to xor dst_reg */
+ end_of_jmp1[-1] = end_of_jmp2 - end_of_jmp1;
+ /* populate jmp_offset for JNC above to jump to start_of_ldx */
start_of_ldx = prog;
+ end_of_jmp2[-1] = start_of_ldx - end_of_jmp2;
}
emit_ldx(&prog, BPF_SIZE(insn->code), dst_reg, src_reg, insn->off);
if (BPF_MODE(insn->code) == BPF_PROBE_MEM) {
@@ -1305,7 +1340,7 @@ st: if (is_imm8(insn->off))
* End result: x86 insn "mov rbx, qword ptr [rax+0x14]"
* of 4 bytes will be ignored and rbx will be zero inited.
*/
- ex->fixup = (prog - temp) | (reg2pt_regs[dst_reg] << 8);
+ ex->fixup = (prog - start_of_ldx) | (reg2pt_regs[dst_reg] << 8);
}
break;

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 14f87f6..cd8462d 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -768,6 +768,10 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port,
if ((!mv88e6xxx_port_ppu_updates(chip, port) ||
mode == MLO_AN_FIXED) && ops->port_sync_link)
err = ops->port_sync_link(chip, port, mode, false);
+
+ if (!err && ops->port_set_speed_duplex)
+ err = ops->port_set_speed_duplex(chip, port, SPEED_UNFORCED,
+ DUPLEX_UNFORCED);
mv88e6xxx_reg_unlock(chip);
if (err)

drivers/net/dsa/mv88e6xxx/port.c

View file
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index d9817b2..ab41619 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -283,7 +283,7 @@ static int mv88e6xxx_port_set_speed_duplex(struct mv88e6xxx_chip *chip,
if (err)
return err;
- if (speed)
+ if (speed != SPEED_UNFORCED)
dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);
else
dev_dbg(chip->dev, "p%d: Speed unforced\n", port);
@@ -516,7 +516,7 @@ int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
if (err)
return err;
- if (speed)
+ if (speed != SPEED_UNFORCED)
dev_dbg(chip->dev, "p%d: Speed set to %d Mbps\n", port, speed);
else
dev_dbg(chip->dev, "p%d: Speed unforced\n", port);

drivers/net/ethernet/broadcom/bcmsysport.c

View file
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 40933bf..60dde29 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1309,11 +1309,11 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
struct bcm_sysport_priv *priv = netdev_priv(dev);
struct device *kdev = &priv->pdev->dev;
struct bcm_sysport_tx_ring *ring;
+ unsigned long flags, desc_flags;
struct bcm_sysport_cb *cb;
struct netdev_queue *txq;
u32 len_status, addr_lo;
unsigned int skb_len;
- unsigned long flags;
dma_addr_t mapping;
u16 queue;
int ret;
@@ -1373,8 +1373,10 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
ring->desc_count--;
/* Ports are latched, so write upper address first */
+ spin_lock_irqsave(&priv->desc_lock, desc_flags);
tdma_writel(priv, len_status, TDMA_WRITE_PORT_HI(ring->index));
tdma_writel(priv, addr_lo, TDMA_WRITE_PORT_LO(ring->index));
+ spin_unlock_irqrestore(&priv->desc_lock, desc_flags);
/* Check ring space and update SW control flow */
if (ring->desc_count == 0)
@@ -2013,6 +2015,7 @@ static int bcm_sysport_open(struct net_device *dev)
}
/* Initialize both hardware and software ring */
+ spin_lock_init(&priv->desc_lock);
for (i = 0; i < dev->num_tx_queues; i++) {
ret = bcm_sysport_init_tx_ring(priv, i);
if (ret) {

drivers/net/ethernet/broadcom/bcmsysport.h

View file
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h
index 984f76e..16b73bb 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.h
+++ b/drivers/net/ethernet/broadcom/bcmsysport.h
@@ -711,6 +711,7 @@ struct bcm_sysport_priv {
int wol_irq;
/* Transmit rings */
+ spinlock_t desc_lock;
struct bcm_sysport_tx_ring *tx_rings;
/* Receive queue */

drivers/net/ethernet/broadcom/genet/bcmmii.c

View file
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 5f25964..c888dde 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -589,9 +589,9 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
* Internal or external PHY with MDIO access
*/
phydev = phy_attach(priv->dev, phy_name, pd->phy_interface);
- if (!phydev) {
+ if (IS_ERR(phydev)) {
dev_err(kdev, "failed to register PHY device\n");
- return -ENODEV;
+ return PTR_ERR(phydev);
}
} else {
/*

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h

View file
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
index 2085844..e54e70e 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
@@ -388,6 +388,8 @@ struct dpaa2_eth_ch_stats {
__u64 bytes_per_cdan;
};
+#define DPAA2_ETH_CH_STATS 7
+
/* Maximum number of queues associated with a DPNI */
#define DPAA2_ETH_MAX_TCS 8
#define DPAA2_ETH_MAX_RX_QUEUES_PER_TC 16

drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c

View file
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
index adb8ce5..3fdbf87 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
@@ -278,7 +278,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev,
/* Per-channel stats */
for (k = 0; k < priv->num_channels; k++) {
ch_stats = &priv->channel[k]->stats;
- for (j = 0; j < sizeof(*ch_stats) / sizeof(__u64) - 1; j++)
+ for (j = 0; j < DPAA2_ETH_CH_STATS; j++)
*((__u64 *)data + i + j) += *((__u64 *)ch_stats + j);
}
i += j;

drivers/net/ethernet/hisilicon/hns3/hnae3.h

View file
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index 3f7a9a4..63f5abc 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -839,6 +839,8 @@ struct hnae3_handle {
u8 netdev_flags;
struct dentry *hnae3_dbgfs;
+ /* protects concurrent contention between debugfs commands */
+ struct mutex dbgfs_lock;
/* Network interface message level enabled bits */
u32 msg_enable;

drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c

View file
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 081295b..c381f8a 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -1226,6 +1226,7 @@ static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer,
if (ret)
return ret;
+ mutex_lock(&handle->dbgfs_lock);
save_buf = &hns3_dbg_cmd[index].buf;
if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||
@@ -1238,15 +1239,15 @@ static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer,
read_buf = *save_buf;
} else {
read_buf = kvzalloc(hns3_dbg_cmd[index].buf_len, GFP_KERNEL);
- if (!read_buf)
- return -ENOMEM;
+ if (!read_buf) {
+ ret = -ENOMEM;
+ goto out;
+ }
/* save the buffer addr until the last read operation */
*save_buf = read_buf;
- }
- /* get data ready for the first time to read */
- if (!*ppos) {
+ /* get data ready for the first time to read */
ret = hns3_dbg_read_cmd(dbg_data, hns3_dbg_cmd[index].cmd,
read_buf, hns3_dbg_cmd[index].buf_len);
if (ret)
@@ -1255,8 +1256,10 @@ static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer,
size = simple_read_from_buffer(buffer, count, ppos, read_buf,
strlen(read_buf));
- if (size > 0)
+ if (size > 0) {
+ mutex_unlock(&handle->dbgfs_lock);
return size;
+ }
out:
/* free the buffer for the last read operation */
@@ -1265,6 +1268,7 @@ out:
*save_buf = NULL;
}
+ mutex_unlock(&handle->dbgfs_lock);
return ret;
}
@@ -1337,6 +1341,8 @@ int hns3_dbg_init(struct hnae3_handle *handle)
debugfs_create_dir(hns3_dbg_dentry[i].name,
handle->hnae3_dbgfs);
+ mutex_init(&handle->dbgfs_lock);
+
for (i = 0; i < ARRAY_SIZE(hns3_dbg_cmd); i++) {
if ((hns3_dbg_cmd[i].cmd == HNAE3_DBG_CMD_TM_NODES &&
ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2) ||
@@ -1363,6 +1369,7 @@ int hns3_dbg_init(struct hnae3_handle *handle)
return 0;
out:
+ mutex_destroy(&handle->dbgfs_lock);
debugfs_remove_recursive(handle->hnae3_dbgfs);
handle->hnae3_dbgfs = NULL;
return ret;
@@ -1378,6 +1385,7 @@ void hns3_dbg_uninit(struct hnae3_handle *handle)
hns3_dbg_cmd[i].buf = NULL;
}
+ mutex_destroy(&handle->dbgfs_lock);
debugfs_remove_recursive(handle->hnae3_dbgfs);
handle->hnae3_dbgfs = NULL;
}

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c

View file
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
index fdc66fa..c5ac6ec 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
@@ -114,7 +114,8 @@ int hclgevf_send_mbx_msg(struct hclgevf_dev *hdev,
memcpy(&req->msg, send_msg, sizeof(struct hclge_vf_to_pf_msg));
- trace_hclge_vf_mbx_send(hdev, req);
+ if (test_bit(HCLGEVF_STATE_NIC_REGISTERED, &hdev->state))
+ trace_hclge_vf_mbx_send(hdev, req);
/* synchronous send */
if (need_resp) {

drivers/net/ethernet/intel/iavf/iavf_main.c

View file
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index cfdbf8c..4e7c040 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -2046,6 +2046,7 @@ static void iavf_watchdog_task(struct work_struct *work)
}
adapter->aq_required = 0;
adapter->current_op = VIRTCHNL_OP_UNKNOWN;
+ mutex_unlock(&adapter->crit_lock);
queue_delayed_work(iavf_wq,
&adapter->watchdog_task,
msecs_to_jiffies(10));
@@ -2076,16 +2077,14 @@ static void iavf_watchdog_task(struct work_struct *work)
iavf_detect_recover_hung(&adapter->vsi);
break;
case __IAVF_REMOVE:
- mutex_unlock(&adapter->crit_lock);
- return;
default:
+ mutex_unlock(&adapter->crit_lock);
return;
}
/* check for hw reset */
reg_val = rd32(hw, IAVF_VF_ARQLEN1) & IAVF_VF_ARQLEN1_ARQENABLE_MASK;
if (!reg_val) {
- iavf_change_state(adapter, __IAVF_RESETTING);
adapter->flags |= IAVF_FLAG_RESET_PENDING;
adapter->aq_required = 0;
adapter->current_op = VIRTCHNL_OP_UNKNOWN;

drivers/net/ethernet/intel/ice/ice_ptp.c

View file
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index bf7247c..442b031 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -705,7 +705,7 @@ static int ice_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm)
scaled_ppm = -scaled_ppm;
}
- while ((u64)scaled_ppm > div_u64(U64_MAX, incval)) {
+ while ((u64)scaled_ppm > div64_u64(U64_MAX, incval)) {
/* handle overflow by scaling down the scaled_ppm and
* the divisor, losing some precision
*/
@@ -1540,19 +1540,16 @@ static void ice_ptp_tx_tstamp_work(struct kthread_work *work)
if (err)
continue;
- /* Check if the timestamp is valid */
- if (!(raw_tstamp & ICE_PTP_TS_VALID))
+ /* Check if the timestamp is invalid or stale */
+ if (!(raw_tstamp & ICE_PTP_TS_VALID) ||
+ raw_tstamp == tx->tstamps[idx].cached_tstamp)
continue;
- /* clear the timestamp register, so that it won't show valid
- * again when re-used.
- */
- ice_clear_phy_tstamp(hw, tx->quad, phy_idx);
-
/* The timestamp is valid, so we'll go ahead and clear this
* index and then send the timestamp up to the stack.
*/
spin_lock(&tx->lock);
+ tx->tstamps[idx].cached_tstamp = raw_tstamp;
clear_bit(idx, tx->in_use);
skb = tx->tstamps[idx].skb;
tx->tstamps[idx].skb = NULL;

drivers/net/ethernet/intel/ice/ice_ptp.h

View file
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h
index f71ad31..53c15fc 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.h
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.h
@@ -55,15 +55,21 @@ struct ice_perout_channel {
* struct ice_tx_tstamp - Tracking for a single Tx timestamp
* @skb: pointer to the SKB for this timestamp request
* @start: jiffies when the timestamp was first requested
+ * @cached_tstamp: last read timestamp
*
* This structure tracks a single timestamp request. The SKB pointer is
* provided when initiating a request. The start time is used to ensure that
* we discard old requests that were not fulfilled within a 2 second time
* window.
+ * Timestamp values in the PHY are read only and do not get cleared except at
+ * hardware reset or when a new timestamp value is captured. The cached_tstamp
+ * field is used to detect the case where a new timestamp has not yet been
+ * captured, ensuring that we avoid sending stale timestamp data to the stack.
*/
struct ice_tx_tstamp {
struct sk_buff *skb;
unsigned long start;
+ u64 cached_tstamp;
};
/**

drivers/net/ethernet/intel/igb/igb_main.c

View file
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index fd54d3e..b597b8b 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7648,6 +7648,20 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf,
struct vf_mac_filter *entry = NULL;
int ret = 0;
+ if ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) &&
+ !vf_data->trusted) {
+ dev_warn(&pdev->dev,
+ "VF %d requested MAC filter but is administratively denied\n",
+ vf);
+ return -EINVAL;
+ }
+ if (!is_valid_ether_addr(addr)) {
+ dev_warn(&pdev->dev,
+ "VF %d attempted to set invalid MAC filter\n",
+ vf);
+ return -EINVAL;
+ }
+
switch (info) {
case E1000_VF_MAC_FILTER_CLR:
/* remove all unicast MAC filters related to the current VF */
@@ -7661,20 +7675,6 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf,
}
break;
case E1000_VF_MAC_FILTER_ADD:
- if ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) &&
- !vf_data->trusted) {
- dev_warn(&pdev->dev,
- "VF %d requested MAC filter but is administratively denied\n",
- vf);
- return -EINVAL;
- }
- if (!is_valid_ether_addr(addr)) {
- dev_warn(&pdev->dev,
- "VF %d attempted to set invalid MAC filter\n",
- vf);
- return -EINVAL;
- }
-
/* try to find empty slot in the list */
list_for_each(pos, &adapter->vf_macs.l) {
entry = list_entry(pos, struct vf_mac_filter, l);

drivers/net/ethernet/intel/igbvf/netdev.c

View file
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 74ccd62..4d988da 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2859,6 +2859,7 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;
err_hw_init:
+ netif_napi_del(&adapter->rx_ring->napi);
kfree(adapter->tx_ring);
kfree(adapter->rx_ring);
err_sw_init:

drivers/net/ethernet/intel/igc/igc_i225.c

View file
diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c
index b2ef9fd..b6807e1 100644
--- a/drivers/net/ethernet/intel/igc/igc_i225.c
+++ b/drivers/net/ethernet/intel/igc/igc_i225.c
@@ -636,7 +636,7 @@ s32 igc_set_ltr_i225(struct igc_hw *hw, bool link)
ltrv = rd32(IGC_LTRMAXV);
if (ltr_max != (ltrv & IGC_LTRMAXV_LTRV_MASK)) {
ltrv = IGC_LTRMAXV_LSNP_REQ | ltr_max |
- (scale_min << IGC_LTRMAXV_SCALE_SHIFT);
+ (scale_max << IGC_LTRMAXV_SCALE_SHIFT);
wr32(IGC_LTRMAXV, ltrv);
}
}

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

View file
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 0f9f022..45e2ec4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -5531,6 +5531,10 @@ static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
if (!speed && hw->mac.ops.get_link_capabilities) {
ret = hw->mac.ops.get_link_capabilities(hw, &speed,
&autoneg);
+ /* remove NBASE-T speeds from default autonegotiation
+ * to accommodate broken network switches in the field
+ * which cannot cope with advertised NBASE-T speeds
+ */
speed &= ~(IXGBE_LINK_SPEED_5GB_FULL |
IXGBE_LINK_SPEED_2_5GB_FULL);
}

drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

View file
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index 9724ffb..e4b50c7 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -3405,6 +3405,9 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
/* flush pending Tx transactions */
ixgbe_clear_tx_pending(hw);
+ /* set MDIO speed before talking to the PHY in case it's the 1st time */
+ ixgbe_set_mdio_speed(hw);
+
/* PHY ops must be identified and initialized prior to reset */
status = hw->phy.ops.init(hw);
if (status == IXGBE_ERR_SFP_NOT_SUPPORTED ||

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

View file
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 217e3b3..c34833f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -8494,7 +8494,8 @@ mlxsw_sp_rif_mac_profile_replace(struct mlxsw_sp *mlxsw_sp,
u8 mac_profile;
int err;
- if (!mlxsw_sp_rif_mac_profile_is_shared(rif))
+ if (!mlxsw_sp_rif_mac_profile_is_shared(rif) &&
+ !mlxsw_sp_rif_mac_profile_find(mlxsw_sp, new_mac))
return mlxsw_sp_rif_mac_profile_edit(rif, new_mac);
err = mlxsw_sp_rif_mac_profile_get(mlxsw_sp, new_mac,

drivers/net/ethernet/sfc/ef100_nic.c

View file
diff --git a/drivers/net/ethernet/sfc/ef100_nic.c b/drivers/net/ethernet/sfc/ef100_nic.c

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/stmmac.h

View file

This diff is incomplete. Download the complete patch.

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

View file

This diff is incomplete. Download the complete patch.

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

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/ti/am65-cpsw-nuss.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/netdevsim/bpf.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/netdevsim/ethtool.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/mdio_bus.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/lan78xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/qmi_wwan.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/virtio_net.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/broadcom/brcm80211/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlegacy/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/intel/iwlwifi/Kconfig

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/mediatek/mt76/Makefile

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/mptcp.h

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/verifier.c

View file

This diff is incomplete. Download the complete patch.

net/core/skbuff.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/inet_diag.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/sit.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/agg-rx.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/agg-tx.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/driver-ops.h

View file

This diff is incomplete. Download the complete patch.

net/mac80211/mlme.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/rx.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/sta_info.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/sta_info.h

View file

This diff is incomplete. Download the complete patch.

net/mac80211/tx.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/util.c

View file

This diff is incomplete. Download the complete patch.

net/mptcp/pm_netlink.c

View file

This diff is incomplete. Download the complete patch.

net/mptcp/protocol.c

View file

This diff is incomplete. Download the complete patch.

net/mptcp/sockopt.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/phonet/pep.c

View file

This diff is incomplete. Download the complete patch.

net/rds/connection.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_api.c

View file

This diff is incomplete. Download the complete patch.

net/sched/sch_cake.c

View file

This diff is incomplete. Download the complete patch.

net/sched/sch_ets.c

View file

This diff is incomplete. Download the complete patch.

net/smc/af_smc.c

View file

This diff is incomplete. Download the complete patch.

net/wireless/reg.c

View file

This diff is incomplete. Download the complete patch.

net/xdp/xsk.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_module_attach.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_verifier.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/verifier/atomic_fetch.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/verifier/search_pruning.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/verifier/spill_fill.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/verifier/value_ptr_arith.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/drivers/net/mlxsw/rif_mac_profiles_occ.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/fcnal-test.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/forwarding/forwarding.config.sample

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/icmp_redirect.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/toeplitz.c

View file

This diff is incomplete. Download the complete patch.