projects/linux·commit c2933b2b

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

c2933b2b · Linus Torvalds <[email protected]> · 2025-01-30 12:24:20 -08:00

Pull networking fixes from Jakub Kicinski:
 "Including fixes from IPSec, netfilter and Bluetooth.

  Nothing really stands out, but as usual there's a slight concentration
  of fixes for issues added in the last two weeks before the merge
  window, and driver bugs from 6.13 which tend to get discovered upon
  wider distribution.

  Current release - regressions:

   - net: revert RTNL changes in unregister_netdevice_many_notify()

   - Bluetooth: fix possible infinite recursion of btusb_reset

   - eth: adjust locking in some old drivers which protect their state
     with spinlocks to avoid sleeping in atomic; core protects netdev
     state with a mutex now

  Previous releases - regressions:

   - eth:
      - mlx5e: make sure we pass node ID, not CPU ID to kvzalloc_node()
      - bgmac: reduce max frame size to support just 1500 bytes; the
        jumbo frame support would previously cause OOB writes, but now
        fails outright

   - mptcp: blackhole only if 1st SYN retrans w/o MPC is accepted, avoid
     false detection of MPTCP blackholing

  Previous releases - always broken:

   - mptcp: handle fastopen disconnect correctly

   - xfrm:
      - make sure skb->sk is a full sock before accessing its fields
      - fix taking a lock with preempt disabled for RT kernels

   - usb: ipheth: improve safety of packet metadata parsing; prevent
     potential OOB accesses

   - eth: renesas: fix missing rtnl lock in suspend/resume path"

* tag 'net-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (88 commits)
  MAINTAINERS: add Neal to TCP maintainers
  net: revert RTNL changes in unregister_netdevice_many_notify()
  net: hsr: fix fill_frame_info() regression vs VLAN packets
  doc: mptcp: sysctl: blackhole_timeout is per-netns
  mptcp: blackhole only if 1st SYN retrans w/o MPC is accepted
  netfilter: nf_tables: reject mismatching sum of field_len with set key length
  net: sh_eth: Fix missing rtnl lock in suspend/resume path
  net: ravb: Fix missing rtnl lock in suspend/resume path
  selftests/net: Add test for loading devbound XDP program in generic mode
  net: xdp: Disallow attaching device-bound programs in generic mode
  tcp: correct handling of extreme memory squeeze
  bgmac: reduce max frame size to support just MTU 1500
  vsock/test: Add test for connect() retries
  vsock/test: Add test for UAF due to socket unbinding
  vsock/test: Introduce vsock_connect_fd()
  vsock/test: Introduce vsock_bind()
  vsock: Allow retrying on connect() failure
  vsock: Keep the binding until socket destruction
  Bluetooth: L2CAP: accept zero as a special value for MTU auto-selection
  Bluetooth: btnxpuart: Fix glitches seen in dual A2DP streaming
  ...
Commit
c2933b2befe25309f4c5cfbea0ca80909735fd76
Parents
b4b08811 · dfffaccf

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

Changes

103 files changed · +877 −420

FileStatusAddDelContent
Documentation/ABI/stable/sysfs-class-bluetoothadded+9−0View file
Documentation/devicetree/bindings/net/qcom,ethqos.yamlmodified+4−4View file
Documentation/networking/can.rstmodified+2−2View file
Documentation/networking/mptcp-sysctl.rstmodified+1−1View file
Documentation/networking/napi.rstmodified+1−1View file
MAINTAINERSmodified+3−0View file
drivers/bluetooth/btnxpuart.cmodified+1−2View file
drivers/bluetooth/btusb.cmodified+7−5View file
drivers/net/bonding/bond_main.cmodified+10−9View file
drivers/net/ethernet/broadcom/bgmac.hmodified+1−2View file
drivers/net/ethernet/broadcom/tg3.cmodified+31−4View file
drivers/net/ethernet/davicom/dm9000.cmodified+2−1View file
drivers/net/ethernet/freescale/fec_main.cmodified+30−1View file
drivers/net/ethernet/hisilicon/hns3/hnae3.cmodified+15−0View file
drivers/net/ethernet/hisilicon/hns3/hnae3.hmodified+2−0View file
drivers/net/ethernet/hisilicon/hns3/hns3_enet.cmodified+2−0View file
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.cmodified+2−0View file
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.cmodified+2−0View file
drivers/net/ethernet/intel/iavf/iavf_main.cmodified+17−2View file
drivers/net/ethernet/intel/ice/ice_adminq_cmd.hmodified+0−1View file
drivers/net/ethernet/intel/ice/ice_ethtool.cmodified+0−1View file
drivers/net/ethernet/intel/ice/ice_ethtool.hmodified+0−1View file
drivers/net/ethernet/intel/ice/ice_parser.hmodified+2−4View file
drivers/net/ethernet/intel/ice/ice_parser_rt.cmodified+5−7View file
drivers/net/ethernet/intel/idpf/idpf_controlq.cmodified+6−0View file
drivers/net/ethernet/intel/idpf/idpf_main.cmodified+10−5View file
drivers/net/ethernet/intel/idpf/idpf_virtchnl.cmodified+19−6View file
drivers/net/ethernet/marvell/mvneta.cmodified+1−0View file
drivers/net/ethernet/mediatek/airoha_eth.cmodified+2−2View file
drivers/net/ethernet/mellanox/mlx5/core/en_main.cmodified+1−1View file
drivers/net/ethernet/nvidia/forcedeth.cmodified+10−22View file
drivers/net/ethernet/realtek/8139too.cmodified+3−1View file
drivers/net/ethernet/renesas/ravb_main.cmodified+14−8View file
drivers/net/ethernet/renesas/sh_eth.cmodified+4−0View file
drivers/net/ethernet/stmicro/stmmac/stmmac_main.cmodified+44−13View file
drivers/net/ethernet/sun/niu.cmodified+9−1View file
drivers/net/ethernet/via/via-rhine.cmodified+10−1View file
drivers/net/netdevsim/ethtool.cmodified+1−1View file
drivers/net/netdevsim/netdevsim.hmodified+1−0View file
drivers/net/netdevsim/udp_tunnels.cmodified+14−9View file
drivers/net/phy/marvell-88q2xxx.cmodified+26−7View file
drivers/net/phy/nxp-c45-tja11xx.cmodified+2−0View file
drivers/net/usb/ipheth.cmodified+45−24View file
drivers/net/usb/rtl8150.cmodified+22−0View file
drivers/net/vxlan/vxlan_vnifilter.cmodified+5−0View file
drivers/net/wireless/mediatek/mt76/mt7603/mac.cmodified+4−5View file
drivers/net/wireless/mediatek/mt76/mt7615/pci.cmodified+6−2View file
drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.cmodified+5−3View file
drivers/net/wireless/mediatek/mt76/mt76x0/pci.cmodified+5−3View file
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.cmodified+5−3View file
drivers/net/wireless/mediatek/mt76/mt76x2/pci.cmodified+5−2View file
drivers/net/wireless/mediatek/mt76/mt7915/mac.cmodified+13−4View file
drivers/net/wireless/mediatek/mt76/mt7921/pci.cmodified+5−2View file
drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.cmodified+5−2View file
drivers/net/wireless/mediatek/mt76/mt7925/pci.cmodified+5−2View file
drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.cmodified+5−2View file
drivers/net/wireless/mediatek/mt76/mt7996/mac.cmodified+6−6View file
drivers/ptp/ptp_chardev.cmodified+4−0View file
drivers/ptp/ptp_clock.cmodified+8−0View file
include/linux/netdevice.hmodified+2−2View file
include/net/page_pool/types.hmodified+0−1View file
include/net/xfrm.hmodified+13−3View file
net/bluetooth/l2cap_sock.cmodified+2−2View file
net/core/dev.cmodified+8−31View file
net/core/page_pool.cmodified+2−0View file
net/core/page_pool_priv.hmodified+2−0View file
net/core/page_pool_user.cmodified+9−6View file
net/ethtool/ioctl.cmodified+1−1View file
net/hsr/hsr_forward.cmodified+5−2View file
net/ipv4/esp4.cmodified+1−1View file
net/ipv4/ipmr_base.cmodified+0−3View file
net/ipv4/tcp_output.cmodified+6−3View file
net/ipv6/esp6.cmodified+1−1View file
net/ipv6/xfrm6_output.cmodified+2−2View file
net/mptcp/ctrl.cmodified+2−2View file
net/mptcp/options.cmodified+5−8View file
net/mptcp/pm_netlink.cmodified+2−1View file
net/mptcp/protocol.cmodified+3−1View file
net/mptcp/protocol.hmodified+16−14View file
net/ncsi/ncsi-manage.cmodified+7−6View file
net/ncsi/ncsi-rsp.cmodified+8−10View file
net/netfilter/nf_tables_api.cmodified+4−4View file
net/nfc/nci/hci.cmodified+2−0View file
net/rose/rose_timer.cmodified+15−0View file
net/rxrpc/peer_event.cmodified+8−8View file
net/rxrpc/peer_object.cmodified+6−6View file
net/sched/sch_ets.cmodified+2−0View file
net/vmw_vsock/af_vsock.cmodified+11−2View file
net/xfrm/xfrm_interface_core.cmodified+1−1View file
net/xfrm/xfrm_output.cmodified+4−3View file
net/xfrm/xfrm_policy.cmodified+1−1View file
net/xfrm/xfrm_replay.cmodified+6−4View file
net/xfrm/xfrm_state.cmodified+71−22View file
tools/net/ynl/lib/ynl.cmodified+1−1View file
tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.shmodified+8−8View file
tools/testing/selftests/net/bpf_offload.pymodified+13−1View file
tools/testing/selftests/net/lib/Makefilemodified+1−1View file
tools/testing/selftests/net/mptcp/Makefilemodified+1−1View file
tools/testing/selftests/net/openvswitch/Makefilemodified+1−1View file
tools/testing/selftests/net/packetdrill/ksft_runner.shmodified+3−1View file
tools/testing/vsock/util.cmodified+34−54View file
tools/testing/vsock/util.hmodified+2−0View file
tools/testing/vsock/vsock_test.cmodified+106−16View file

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

Documentation/ABI/stable/sysfs-class-bluetooth

View file
diff --git a/Documentation/ABI/stable/sysfs-class-bluetooth b/Documentation/ABI/stable/sysfs-class-bluetooth
new file mode 100644
index 0000000..36be024
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-class-bluetooth
@@ -0,0 +1,9 @@
+What: /sys/class/bluetooth/hci<index>/reset
+Date: 14-Jan-2025
+KernelVersion: 6.13
+Description: This write-only attribute allows users to trigger the vendor reset
+ method on the Bluetooth device when arbitrary data is written.
+ The reset may or may not be done through the device transport
+ (e.g., UART/USB), and can also be done through an out-of-band
+ approach such as GPIO.

Documentation/devicetree/bindings/net/qcom,ethqos.yaml

View file
diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
index f117471..e7ee0d9 100644
--- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
+++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
@@ -22,12 +22,12 @@ properties:
oneOf:
- items:
- enum:
- - qcom,qcs8300-ethqos
- - const: qcom,sa8775p-ethqos
+ - qcom,qcs615-ethqos
+ - const: qcom,qcs404-ethqos
- items:
- enum:
- - qcom,qcs615-ethqos
- - const: qcom,sm8150-ethqos
+ - qcom,qcs8300-ethqos
+ - const: qcom,sa8775p-ethqos
- enum:
- qcom,qcs404-ethqos
- qcom,sa8775p-ethqos

Documentation/networking/can.rst

View file
diff --git a/Documentation/networking/can.rst b/Documentation/networking/can.rst
index 62519d3..b018ce3 100644
--- a/Documentation/networking/can.rst
+++ b/Documentation/networking/can.rst
@@ -699,10 +699,10 @@ RAW socket option CAN_RAW_JOIN_FILTERS
The CAN_RAW socket can set multiple CAN identifier specific filters that
lead to multiple filters in the af_can.c filter processing. These filters
-are indenpendent from each other which leads to logical OR'ed filters when
+are independent from each other which leads to logical OR'ed filters when
applied (see :ref:`socketcan-rawfilter`).
-This socket option joines the given CAN filters in the way that only CAN
+This socket option joins the given CAN filters in the way that only CAN
frames are passed to user space that matched *all* given CAN filters. The
semantic for the applied filters is therefore changed to a logical AND.

Documentation/networking/mptcp-sysctl.rst

View file
diff --git a/Documentation/networking/mptcp-sysctl.rst b/Documentation/networking/mptcp-sysctl.rst
index dc45c02..03e1d36 100644
--- a/Documentation/networking/mptcp-sysctl.rst
+++ b/Documentation/networking/mptcp-sysctl.rst
@@ -41,7 +41,7 @@ blackhole_timeout - INTEGER (seconds)
MPTCP is re-enabled and will reset to the initial value when the
blackhole issue goes away.
- 0 to disable the blackhole detection.
+ 0 to disable the blackhole detection. This is a per-namespace sysctl.
Default: 3600

Documentation/networking/napi.rst

View file
diff --git a/Documentation/networking/napi.rst b/Documentation/networking/napi.rst
index 6083210..f970a2b 100644
--- a/Documentation/networking/napi.rst
+++ b/Documentation/networking/napi.rst
@@ -362,7 +362,7 @@ It is expected that ``irq-suspend-timeout`` will be set to a value much larger
than ``gro_flush_timeout`` as ``irq-suspend-timeout`` should suspend IRQs for
the duration of one userland processing cycle.
-While it is not stricly necessary to use ``napi_defer_hard_irqs`` and
+While it is not strictly necessary to use ``napi_defer_hard_irqs`` and
``gro_flush_timeout`` to use IRQ suspension, their use is strongly
recommended.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index bc8ce7a..d1086e5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4102,6 +4102,7 @@ S: Supported
W: http://www.bluez.org/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
+F: Documentation/ABI/stable/sysfs-class-bluetooth
F: include/net/bluetooth/
F: net/bluetooth/
@@ -16277,6 +16278,7 @@ F: drivers/scsi/sun3_scsi_vme.c
NCSI LIBRARY
M: Samuel Mendoza-Jonas <[email protected]>
+R: Paul Fertser <[email protected]>
S: Maintained
F: net/ncsi/
@@ -16611,6 +16613,7 @@ F: tools/testing/selftests/net/mptcp/
NETWORKING [TCP]
M: Eric Dumazet <[email protected]>
+M: Neal Cardwell <[email protected]>
S: Maintained
F: Documentation/networking/net_cachelines/tcp_sock.rst

drivers/bluetooth/btnxpuart.c

View file
diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 1230045..aa5ec1d 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1381,13 +1381,12 @@ static void btnxpuart_tx_work(struct work_struct *work)
while ((skb = nxp_dequeue(nxpdev))) {
len = serdev_device_write_buf(serdev, skb->data, skb->len);
- serdev_device_wait_until_sent(serdev, 0);
hdev->stat.byte_tx += len;
skb_pull(skb, len);
if (skb->len > 0) {
skb_queue_head(&nxpdev->txq, skb);
- break;
+ continue;
}
switch (hci_skb_pkt_type(skb)) {

drivers/bluetooth/btusb.c

View file
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 9aa018d..90966df 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -899,11 +899,6 @@ static void btusb_reset(struct hci_dev *hdev)
struct btusb_data *data;
int err;
- if (hdev->reset) {
- hdev->reset(hdev);
- return;
- }
-
data = hci_get_drvdata(hdev);
/* This is not an unbalanced PM reference since the device will reset */
err = usb_autopm_get_interface(data->intf);
@@ -2639,8 +2634,15 @@ static void btusb_mtk_claim_iso_intf(struct btusb_data *data)
struct btmtk_data *btmtk_data = hci_get_priv(data->hdev);
int err;
+ /*
+ * The function usb_driver_claim_interface() is documented to need
+ * locks held if it's not called from a probe routine. The code here
+ * is called from the hci_power_on workqueue, so grab the lock.
+ */
+ device_lock(&btmtk_data->isopkt_intf->dev);
err = usb_driver_claim_interface(&btusb_driver,
btmtk_data->isopkt_intf, data);
+ device_unlock(&btmtk_data->isopkt_intf->dev);
if (err < 0) {
btmtk_data->isopkt_intf = NULL;
bt_dev_err(data->hdev, "Failed to claim iso interface");

drivers/net/bonding/bond_main.c

View file
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7b78c2b..e45bba2 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1538,17 +1538,20 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
NETIF_F_HIGHDMA | NETIF_F_LRO)
#define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
- NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE)
+ NETIF_F_RXCSUM | NETIF_F_GSO_SOFTWARE | \
+ NETIF_F_GSO_PARTIAL)
#define BOND_MPLS_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
NETIF_F_GSO_SOFTWARE)
+#define BOND_GSO_PARTIAL_FEATURES (NETIF_F_GSO_ESP)
+
static void bond_compute_features(struct bonding *bond)
{
+ netdev_features_t gso_partial_features = BOND_GSO_PARTIAL_FEATURES;
unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE |
IFF_XMIT_DST_RELEASE_PERM;
- netdev_features_t gso_partial_features = NETIF_F_GSO_ESP;
netdev_features_t vlan_features = BOND_VLAN_FEATURES;
netdev_features_t enc_features = BOND_ENC_FEATURES;
#ifdef CONFIG_XFRM_OFFLOAD
@@ -1582,8 +1585,9 @@ static void bond_compute_features(struct bonding *bond)
BOND_XFRM_FEATURES);
#endif /* CONFIG_XFRM_OFFLOAD */
- if (slave->dev->hw_enc_features & NETIF_F_GSO_PARTIAL)
- gso_partial_features &= slave->dev->gso_partial_features;
+ gso_partial_features = netdev_increment_features(gso_partial_features,
+ slave->dev->gso_partial_features,
+ BOND_GSO_PARTIAL_FEATURES);
mpls_features = netdev_increment_features(mpls_features,
slave->dev->mpls_features,
@@ -1598,12 +1602,8 @@ static void bond_compute_features(struct bonding *bond)
}
bond_dev->hard_header_len = max_hard_header_len;
- if (gso_partial_features & NETIF_F_GSO_ESP)
- bond_dev->gso_partial_features |= NETIF_F_GSO_ESP;
- else
- bond_dev->gso_partial_features &= ~NETIF_F_GSO_ESP;
-
done:
+ bond_dev->gso_partial_features = gso_partial_features;
bond_dev->vlan_features = vlan_features;
bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL |
NETIF_F_HW_VLAN_CTAG_TX |
@@ -6046,6 +6046,7 @@ void bond_setup(struct net_device *bond_dev)
bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
bond_dev->features |= bond_dev->hw_features;
bond_dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
+ bond_dev->features |= NETIF_F_GSO_PARTIAL;
#ifdef CONFIG_XFRM_OFFLOAD
bond_dev->hw_features |= BOND_XFRM_FEATURES;
/* Only enable XFRM features if this is an active-backup config */

drivers/net/ethernet/broadcom/bgmac.h

View file
diff --git a/drivers/net/ethernet/broadcom/bgmac.h b/drivers/net/ethernet/broadcom/bgmac.h
index d73ef26..6fee9a4 100644
--- a/drivers/net/ethernet/broadcom/bgmac.h
+++ b/drivers/net/ethernet/broadcom/bgmac.h
@@ -328,8 +328,7 @@
#define BGMAC_RX_FRAME_OFFSET 30 /* There are 2 unused bytes between header and real data */
#define BGMAC_RX_BUF_OFFSET (NET_SKB_PAD + NET_IP_ALIGN - \
BGMAC_RX_FRAME_OFFSET)
-/* Jumbo frame size with FCS */
-#define BGMAC_RX_MAX_FRAME_SIZE 9724
+#define BGMAC_RX_MAX_FRAME_SIZE 1536
#define BGMAC_RX_BUF_SIZE (BGMAC_RX_FRAME_OFFSET + BGMAC_RX_MAX_FRAME_SIZE)
#define BGMAC_RX_ALLOC_SIZE (SKB_DATA_ALIGN(BGMAC_RX_BUF_SIZE + BGMAC_RX_BUF_OFFSET) + \
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))

drivers/net/ethernet/broadcom/tg3.c

View file
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 9cc8db1..1c94bf1 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7424,7 +7424,7 @@ static void tg3_napi_enable(struct tg3 *tp)
for (i = 0; i < tp->irq_cnt; i++) {
tnapi = &tp->napi[i];
- napi_enable(&tnapi->napi);
+ napi_enable_locked(&tnapi->napi);
if (tnapi->tx_buffers) {
netif_queue_set_napi(tp->dev, txq_idx,
NETDEV_QUEUE_TYPE_TX,
@@ -7445,9 +7445,10 @@ static void tg3_napi_init(struct tg3 *tp)
int i;
for (i = 0; i < tp->irq_cnt; i++) {
- netif_napi_add(tp->dev, &tp->napi[i].napi,
- i ? tg3_poll_msix : tg3_poll);
- netif_napi_set_irq(&tp->napi[i].napi, tp->napi[i].irq_vec);
+ netif_napi_add_locked(tp->dev, &tp->napi[i].napi,
+ i ? tg3_poll_msix : tg3_poll);
+ netif_napi_set_irq_locked(&tp->napi[i].napi,
+ tp->napi[i].irq_vec);
}
}
@@ -11259,6 +11260,8 @@ static void tg3_timer_stop(struct tg3 *tp)
static int tg3_restart_hw(struct tg3 *tp, bool reset_phy)
__releases(tp->lock)
__acquires(tp->lock)
+ __releases(tp->dev->lock)
+ __acquires(tp->dev->lock)
{
int err;
@@ -11271,7 +11274,9 @@ static int tg3_restart_hw(struct tg3 *tp, bool reset_phy)
tg3_timer_stop(tp);
tp->irq_sync = 0;
tg3_napi_enable(tp);
+ netdev_unlock(tp->dev);
dev_close(tp->dev);
+ netdev_lock(tp->dev);
tg3_full_lock(tp, 0);
}
return err;
@@ -11299,6 +11304,7 @@ static void tg3_reset_task(struct work_struct *work)
tg3_netif_stop(tp);
+ netdev_lock(tp->dev);
tg3_full_lock(tp, 1);
if (tg3_flag(tp, TX_RECOVERY_PENDING)) {
@@ -11318,12 +11324,14 @@ static void tg3_reset_task(struct work_struct *work)
* call cancel_work_sync() and wait forever.
*/
tg3_flag_clear(tp, RESET_TASK_PENDING);
+ netdev_unlock(tp->dev);
dev_close(tp->dev);
goto out;
}
tg3_netif_start(tp);
tg3_full_unlock(tp);
+ netdev_unlock(tp->dev);
tg3_phy_start(tp);
tg3_flag_clear(tp, RESET_TASK_PENDING);
out:
@@ -11683,9 +11691,11 @@ static int tg3_start(struct tg3 *tp, bool reset_phy, bool test_irq,
if (err)
goto out_ints_fini;
+ netdev_lock(dev);
tg3_napi_init(tp);
tg3_napi_enable(tp);
+ netdev_unlock(dev);
for (i = 0; i < tp->irq_cnt; i++) {
err = tg3_request_irq(tp, i);
@@ -12569,6 +12579,7 @@ static int tg3_set_ringparam(struct net_device *dev,
irq_sync = 1;
}
+ netdev_lock(dev);
tg3_full_lock(tp, irq_sync);
tp->rx_pending = ering->rx_pending;
@@ -12597,6 +12608,7 @@ static int tg3_set_ringparam(struct net_device *dev,
}
tg3_full_unlock(tp);
+ netdev_unlock(dev);
if (irq_sync && !err)
tg3_phy_start(tp);
@@ -12678,6 +12690,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
irq_sync = 1;
}
+ netdev_lock(dev);
tg3_full_lock(tp, irq_sync);
if (epause->autoneg)
@@ -12707,6 +12720,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
}
tg3_full_unlock(tp);
+ netdev_unlock(dev);
}
tp->phy_flags |= TG3_PHYFLG_USER_CONFIGURED;
@@ -13911,6 +13925,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
data[TG3_INTERRUPT_TEST] = 1;
}
+ netdev_lock(dev);
tg3_full_lock(tp, 0);
tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
@@ -13922,6 +13937,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
}
tg3_full_unlock(tp);
+ netdev_unlock(dev);
if (irq_sync && !err2)
tg3_phy_start(tp);
@@ -14365,6 +14381,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
tg3_set_mtu(dev, tp, new_mtu);
+ netdev_lock(dev);
tg3_full_lock(tp, 1);
tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
@@ -14384,6 +14401,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
tg3_netif_start(tp);
tg3_full_unlock(tp);
+ netdev_unlock(dev);
if (!err)
tg3_phy_start(tp);
@@ -18164,6 +18182,7 @@ static int tg3_resume(struct device *device)
netif_device_attach(dev);
+ netdev_lock(dev);
tg3_full_lock(tp, 0);
tg3_ape_driver_state_change(tp, RESET_KIND_INIT);
@@ -18180,6 +18199,7 @@ static int tg3_resume(struct device *device)
out:
tg3_full_unlock(tp);
+ netdev_unlock(dev);
if (!err)
tg3_phy_start(tp);
@@ -18260,7 +18280,9 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,
done:
if (state == pci_channel_io_perm_failure) {
if (netdev) {
+ netdev_lock(netdev);
tg3_napi_enable(tp);
+ netdev_unlock(netdev);
dev_close(netdev);
}
err = PCI_ERS_RESULT_DISCONNECT;
@@ -18314,7 +18336,9 @@ static pci_ers_result_t tg3_io_slot_reset(struct pci_dev *pdev)
done:
if (rc != PCI_ERS_RESULT_RECOVERED && netdev && netif_running(netdev)) {
+ netdev_lock(netdev);
tg3_napi_enable(tp);
+ netdev_unlock(netdev);
dev_close(netdev);
}
rtnl_unlock();
@@ -18340,12 +18364,14 @@ static void tg3_io_resume(struct pci_dev *pdev)
if (!netdev || !netif_running(netdev))
goto done;
+ netdev_lock(netdev);
tg3_full_lock(tp, 0);
tg3_ape_driver_state_change(tp, RESET_KIND_INIT);
tg3_flag_set(tp, INIT_COMPLETE);
err = tg3_restart_hw(tp, true);
if (err) {
tg3_full_unlock(tp);
+ netdev_unlock(netdev);
netdev_err(netdev, "Cannot restart hardware after reset.\n");
goto done;
}
@@ -18357,6 +18383,7 @@ static void tg3_io_resume(struct pci_dev *pdev)
tg3_netif_start(tp);
tg3_full_unlock(tp);
+ netdev_unlock(netdev);
tg3_phy_start(tp);

drivers/net/ethernet/davicom/dm9000.c

View file
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 8735e33..b87eaf0 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1777,10 +1777,11 @@ static void dm9000_drv_remove(struct platform_device *pdev)
unregister_netdev(ndev);
dm9000_release_board(pdev, dm);
- free_netdev(ndev); /* free device structure */
if (dm->power_supply)
regulator_disable(dm->power_supply);
+ free_netdev(ndev); /* free device structure */
+
dev_dbg(&pdev->dev, "released and freed device\n");
}

drivers/net/ethernet/freescale/fec_main.c

View file
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 6872550..f7c4ce8 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -840,6 +840,8 @@ static int fec_enet_txq_submit_tso(struct fec_enet_priv_tx_q *txq,
struct fec_enet_private *fep = netdev_priv(ndev);
int hdr_len, total_len, data_left;
struct bufdesc *bdp = txq->bd.cur;
+ struct bufdesc *tmp_bdp;
+ struct bufdesc_ex *ebdp;
struct tso_t tso;
unsigned int index = 0;
int ret;
@@ -913,7 +915,34 @@ static int fec_enet_txq_submit_tso(struct fec_enet_priv_tx_q *txq,
return 0;
err_release:
- /* TODO: Release all used data descriptors for TSO */
+ /* Release all used data descriptors for TSO */
+ tmp_bdp = txq->bd.cur;
+
+ while (tmp_bdp != bdp) {
+ /* Unmap data buffers */
+ if (tmp_bdp->cbd_bufaddr &&
+ !IS_TSO_HEADER(txq, fec32_to_cpu(tmp_bdp->cbd_bufaddr)))
+ dma_unmap_single(&fep->pdev->dev,
+ fec32_to_cpu(tmp_bdp->cbd_bufaddr),
+ fec16_to_cpu(tmp_bdp->cbd_datlen),
+ DMA_TO_DEVICE);
+
+ /* Clear standard buffer descriptor fields */
+ tmp_bdp->cbd_sc = 0;
+ tmp_bdp->cbd_datlen = 0;
+ tmp_bdp->cbd_bufaddr = 0;
+
+ /* Handle extended descriptor if enabled */
+ if (fep->bufdesc_ex) {
+ ebdp = (struct bufdesc_ex *)tmp_bdp;
+ ebdp->cbd_esc = 0;
+ }
+
+ tmp_bdp = fec_enet_get_nextdesc(tmp_bdp, &txq->bd);
+ }
+
+ dev_kfree_skb_any(skb);
+
return ret;
}

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

View file
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
index 9a63fbc..b25fb40 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
@@ -40,6 +40,21 @@ EXPORT_SYMBOL(hnae3_unregister_ae_algo_prepare);
*/
static DEFINE_MUTEX(hnae3_common_lock);
+/* ensure the drivers being unloaded one by one */
+static DEFINE_MUTEX(hnae3_unload_lock);
+
+void hnae3_acquire_unload_lock(void)
+{
+ mutex_lock(&hnae3_unload_lock);
+}
+EXPORT_SYMBOL(hnae3_acquire_unload_lock);
+
+void hnae3_release_unload_lock(void)
+{
+ mutex_unlock(&hnae3_unload_lock);
+}
+EXPORT_SYMBOL(hnae3_release_unload_lock);
+
static bool hnae3_client_match(enum hnae3_client_type client_type)
{
if (client_type == HNAE3_CLIENT_KNIC ||

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 12ba380..4e44f28 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -963,4 +963,6 @@ int hnae3_register_client(struct hnae3_client *client);
void hnae3_set_client_init_flag(struct hnae3_client *client,
struct hnae3_ae_dev *ae_dev,
unsigned int inited);
+void hnae3_acquire_unload_lock(void);
+void hnae3_release_unload_lock(void);
#endif

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

View file
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index a7e3b22..9ff797f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -6002,9 +6002,11 @@ module_init(hns3_init_module);
*/
static void __exit hns3_exit_module(void)
{
+ hnae3_acquire_unload_lock();
pci_unregister_driver(&hns3_driver);
hnae3_unregister_client(&client);
hns3_dbg_unregister_debugfs();
+ hnae3_release_unload_lock();
}
module_exit(hns3_exit_module);

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

View file
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index db78450..3f17b30 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -12919,9 +12919,11 @@ static int __init hclge_init(void)
static void __exit hclge_exit(void)
{
+ hnae3_acquire_unload_lock();
hnae3_unregister_ae_algo_prepare(&ae_algo);
hnae3_unregister_ae_algo(&ae_algo);
destroy_workqueue(hclge_wq);
+ hnae3_release_unload_lock();
}
module_init(hclge_init);
module_exit(hclge_exit);

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

View file
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 163c6e5..9ba7677 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -3410,8 +3410,10 @@ static int __init hclgevf_init(void)
static void __exit hclgevf_exit(void)
{
+ hnae3_acquire_unload_lock();
hnae3_unregister_ae_algo(&ae_algovf);
destroy_workqueue(hclgevf_wq);
+ hnae3_release_unload_lock();
}
module_init(hclgevf_init);
module_exit(hclgevf_exit);

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 cbfaaa5..2d7a18f 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -773,6 +773,11 @@ iavf_vlan_filter *iavf_add_vlan(struct iavf_adapter *adapter,
f->state = IAVF_VLAN_ADD;
adapter->num_vlan_filters++;
iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_VLAN_FILTER);
+ } else if (f->state == IAVF_VLAN_REMOVE) {
+ /* IAVF_VLAN_REMOVE means that VLAN wasn't yet removed.
+ * We can safely only change the state here.
+ */
+ f->state = IAVF_VLAN_ACTIVE;

This diff is incomplete. Download the complete patch.

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

View file

This diff is incomplete. Download the complete patch.

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

View file

This diff is incomplete. Download the complete patch.

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

View file

This diff is incomplete. Download the complete patch.

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

View file

This diff is incomplete. Download the complete patch.

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

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/idpf/idpf_controlq.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/idpf/idpf_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/marvell/mvneta.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mediatek/airoha_eth.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/nvidia/forcedeth.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/realtek/8139too.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/renesas/ravb_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/renesas/sh_eth.c

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/sun/niu.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/via/via-rhine.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/netdevsim/netdevsim.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/netdevsim/udp_tunnels.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/marvell-88q2xxx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/nxp-c45-tja11xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/ipheth.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/rtl8150.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/vxlan/vxlan_vnifilter.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7603/mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7615/pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt76x0/pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt76x2/pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7915/mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7921/pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7925/pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/mediatek/mt76/mt7996/mac.c

View file

This diff is incomplete. Download the complete patch.

drivers/ptp/ptp_chardev.c

View file

This diff is incomplete. Download the complete patch.

drivers/ptp/ptp_clock.c

View file

This diff is incomplete. Download the complete patch.

include/linux/netdevice.h

View file

This diff is incomplete. Download the complete patch.

include/net/page_pool/types.h

View file

This diff is incomplete. Download the complete patch.

include/net/xfrm.h

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/l2cap_sock.c

View file

This diff is incomplete. Download the complete patch.

net/core/dev.c

View file

This diff is incomplete. Download the complete patch.

net/core/page_pool.c

View file

This diff is incomplete. Download the complete patch.

net/core/page_pool_priv.h

View file

This diff is incomplete. Download the complete patch.

net/core/page_pool_user.c

View file

This diff is incomplete. Download the complete patch.

net/ethtool/ioctl.c

View file

This diff is incomplete. Download the complete patch.

net/hsr/hsr_forward.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/esp4.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ipmr_base.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_output.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/esp6.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/xfrm6_output.c

View file

This diff is incomplete. Download the complete patch.

net/mptcp/ctrl.c

View file

This diff is incomplete. Download the complete patch.

net/mptcp/options.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/protocol.h

View file

This diff is incomplete. Download the complete patch.

net/ncsi/ncsi-manage.c

View file

This diff is incomplete. Download the complete patch.

net/ncsi/ncsi-rsp.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/nf_tables_api.c

View file

This diff is incomplete. Download the complete patch.

net/nfc/nci/hci.c

View file

This diff is incomplete. Download the complete patch.

net/rose/rose_timer.c

View file

This diff is incomplete. Download the complete patch.

net/rxrpc/peer_event.c

View file

This diff is incomplete. Download the complete patch.

net/rxrpc/peer_object.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/vmw_vsock/af_vsock.c

View file

This diff is incomplete. Download the complete patch.

net/xfrm/xfrm_interface_core.c

View file

This diff is incomplete. Download the complete patch.

net/xfrm/xfrm_output.c

View file

This diff is incomplete. Download the complete patch.

net/xfrm/xfrm_policy.c

View file

This diff is incomplete. Download the complete patch.

net/xfrm/xfrm_replay.c

View file

This diff is incomplete. Download the complete patch.

net/xfrm/xfrm_state.c

View file

This diff is incomplete. Download the complete patch.

tools/net/ynl/lib/ynl.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/drivers/net/netdevsim/udp_tunnel_nic.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/bpf_offload.py

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/lib/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/mptcp/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/openvswitch/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/packetdrill/ksft_runner.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/vsock/util.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/vsock/util.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/vsock/vsock_test.c

View file

This diff is incomplete. Download the complete patch.