projects/linux·commit 41b9fb38

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

41b9fb38 · Linus Torvalds <[email protected]> · 2024-02-01 12:39:54 -08:00

Pull networking fixes from Jakub Kicinski:
 "Including fixes from netfilter.

  As Paolo promised we continue to hammer out issues in our selftests.
  This is not the end but probably the peak.

  Current release - regressions:

   - smc: fix incorrect SMC-D link group matching logic

  Current release - new code bugs:

   - eth: bnxt: silence WARN() when device skips a timestamp, it happens

  Previous releases - regressions:

   - ipmr: fix null-deref when forwarding mcast packets

   - conntrack: evaluate window negotiation only for packets in the
     REPLY direction, otherwise SYN retransmissions trigger incorrect
     window scale negotiation

   - ipset: fix performance regression in swap operation

  Previous releases - always broken:

   - tcp: add sanity checks to types of pages getting into the rx
     zerocopy path, we only support basic NIC -> user, no page cache
     pages etc.

   - ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv()

   - nt_tables: more input sanitization changes

   - dsa: mt7530: fix 10M/100M speed on MediaTek MT7988 switch

   - bridge: mcast: fix loss of snooping after long uptime, jiffies do
     wrap on 32bit

   - xen-netback: properly sync TX responses, protect with locking

   - phy: mediatek-ge-soc: sync calibration values with MediaTek SDK,
     increase connection stability

   - eth: pds: fixes for various teardown, and reset races

  Misc:

   - hsr: silence WARN() if we can't alloc supervision frame, it
     happens"

* tag 'net-6.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (82 commits)
  doc/netlink/specs: Add missing attr in rt_link spec
  idpf: avoid compiler padding in virtchnl2_ptype struct
  selftests: mptcp: join: stop transfer when check is done (part 2)
  selftests: mptcp: join: stop transfer when check is done (part 1)
  selftests: mptcp: allow changing subtests prefix
  selftests: mptcp: decrease BW in simult flows
  selftests: mptcp: increase timeout to 30 min
  selftests: mptcp: add missing kconfig for NF Mangle
  selftests: mptcp: add missing kconfig for NF Filter in v6
  selftests: mptcp: add missing kconfig for NF Filter
  mptcp: fix data re-injection from stale subflow
  selftests: net: enable some more knobs
  selftests: net: add missing config for NF_TARGET_TTL
  selftests: forwarding: List helper scripts in TEST_FILES Makefile variable
  selftests: net: List helper scripts in TEST_FILES Makefile variable
  selftests: net: Remove executable bits from library scripts
  selftests: bonding: Check initial state
  selftests: team: Add missing config options
  hv_netvsc: Fix race condition between netvsc_probe and netvsc_remove
  xen-netback: properly sync TX responses
  ...
Commit
41b9fb381a486360b2daaec0c7480f8e3ff72bc7
Parents
91481c90 · 4e192be1

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

Changes

90 files changed · +839 −403

FileStatusAddDelContent
Documentation/ABI/testing/sysfs-class-net-queuesmodified+11−11View file
Documentation/netlink/specs/rt_link.yamlmodified+10−0View file
MAINTAINERSmodified+2−1View file
drivers/net/dsa/mt7530.cmodified+1−2View file
drivers/net/dsa/mv88e6xxx/chip.cmodified+1−1View file
drivers/net/dsa/qca/qca8k-8xxx.cmodified+1−2View file
drivers/net/ethernet/amd/pds_core/adminq.cmodified+48−16View file
drivers/net/ethernet/amd/pds_core/core.cmodified+36−10View file
drivers/net/ethernet/amd/pds_core/core.hmodified+1−1View file
drivers/net/ethernet/amd/pds_core/debugfs.cmodified+4−0View file
drivers/net/ethernet/amd/pds_core/dev.cmodified+8−8View file
drivers/net/ethernet/amd/pds_core/devlink.cmodified+2−1View file
drivers/net/ethernet/amd/pds_core/fw.cmodified+3−0View file
drivers/net/ethernet/amd/pds_core/main.cmodified+22−4View file
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.cmodified+1−1View file
drivers/net/ethernet/google/gve/gve_rx.cmodified+4−4View file
drivers/net/ethernet/intel/e1000e/e1000.hmodified+20−0View file
drivers/net/ethernet/intel/e1000e/ptp.cmodified+15−7View file
drivers/net/ethernet/intel/idpf/virtchnl2.hmodified+1−1View file
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.cmodified+2−1View file
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.cmodified+0−1View file
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.cmodified+1−2View file
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.cmodified+3−4View file
drivers/net/ethernet/mediatek/mtk_eth_soc.cmodified+4−1View file
drivers/net/ethernet/microchip/lan966x/lan966x_port.cmodified+3−2View file
drivers/net/ethernet/netronome/nfp/flower/conntrack.cmodified+43−3View file
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.cmodified+4−0View file
drivers/net/ethernet/stmicro/stmmac/stmmac_main.cmodified+3−0View file
drivers/net/hyperv/netvsc.cmodified+4−1View file
drivers/net/phy/mediatek-ge-soc.cmodified+81−66View file
drivers/net/xen-netback/netback.cmodified+40−44View file
include/linux/netfilter/ipset/ip_set.hmodified+4−0View file
include/net/af_unix.hmodified+14−6View file
include/net/ip.hmodified+1−1View file
include/net/netfilter/nf_tables.hmodified+2−0View file
net/batman-adv/multicast.cmodified+3−0View file
net/bridge/br_multicast.cmodified+15−5View file
net/bridge/br_private.hmodified+2−2View file
net/devlink/port.cmodified+1−1View file
net/hsr/hsr_device.cmodified+2−2View file
net/ipv4/ip_output.cmodified+6−6View file
net/ipv4/ip_sockglue.cmodified+4−2View file
net/ipv4/ipmr.cmodified+1−1View file
net/ipv4/raw.cmodified+1−1View file
net/ipv4/tcp.cmodified+11−1View file
net/ipv4/udp.cmodified+1−1View file
net/ipv6/addrconf_core.cmodified+14−7View file
net/ipv6/ip6_tunnel.cmodified+18−3View file
net/llc/af_llc.cmodified+2−0View file
net/mptcp/protocol.cmodified+0−3View file
net/netfilter/ipset/ip_set_bitmap_gen.hmodified+11−3View file
net/netfilter/ipset/ip_set_core.cmodified+28−9View file
net/netfilter/ipset/ip_set_hash_gen.hmodified+12−3View file
net/netfilter/ipset/ip_set_list_set.cmodified+10−3View file
net/netfilter/nf_conntrack_proto_sctp.cmodified+1−1View file
net/netfilter/nf_conntrack_proto_tcp.cmodified+6−4View file
net/netfilter/nf_log.cmodified+4−3View file
net/netfilter/nf_tables_api.cmodified+9−5View file
net/netfilter/nft_ct.cmodified+24−0View file
net/netfilter/nft_tunnel.cmodified+1−0View file
net/nfc/nci/core.cmodified+4−0View file
net/smc/smc_core.cmodified+9−3View file
net/unix/af_unix.cmodified+6−8View file
net/unix/diag.cmodified+1−1View file
tools/testing/selftests/drivers/net/bonding/lag_lib.shmodified+11−0View file
tools/testing/selftests/drivers/net/team/configmodified+3−1View file
tools/testing/selftests/net/Makefilemodified+5−4View file
tools/testing/selftests/net/configmodified+16−0View file
tools/testing/selftests/net/forwarding/Makefilemodified+1−1View file
tools/testing/selftests/net/lib.shmodified+4−1View file
tools/testing/selftests/net/mptcp/configmodified+3−0View file
tools/testing/selftests/net/mptcp/mptcp_join.shmodified+11−16View file
tools/testing/selftests/net/mptcp/mptcp_lib.shmodified+1−1View file
tools/testing/selftests/net/mptcp/settingsmodified+1−1View file
tools/testing/selftests/net/mptcp/simult_flows.shmodified+4−4View file
tools/testing/selftests/net/net_helper.shmodified+0−0View file
tools/testing/selftests/net/pmtu.shmodified+9−9View file
tools/testing/selftests/net/setup_loopback.shmodified+0−0View file
tools/testing/selftests/net/setup_veth.shmodified+1−1View file
tools/testing/selftests/net/tcp_ao/configadded+10−0View file
tools/testing/selftests/net/tcp_ao/key-management.cmodified+26−20View file
tools/testing/selftests/net/tcp_ao/lib/sock.cmodified+8−4View file
tools/testing/selftests/net/tcp_ao/rst.cmodified+90−48View file
tools/testing/selftests/net/tcp_ao/settingsadded+1−0View file
tools/testing/selftests/net/udpgro.shmodified+2−2View file
tools/testing/selftests/net/udpgro_bench.shmodified+2−2View file
tools/testing/selftests/net/udpgro_frglist.shmodified+3−3View file
tools/testing/selftests/net/udpgro_fwd.shmodified+5−3View file
tools/testing/selftests/net/veth.shmodified+2−2View file
tools/testing/selftests/net/xdp_dummy.cadded+13−0View file

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

Documentation/ABI/testing/sysfs-class-net-queues

View file
diff --git a/Documentation/ABI/testing/sysfs-class-net-queues b/Documentation/ABI/testing/sysfs-class-net-queues
index 906ff3c..5bff64d 100644
--- a/Documentation/ABI/testing/sysfs-class-net-queues
+++ b/Documentation/ABI/testing/sysfs-class-net-queues
@@ -1,4 +1,4 @@
-What: /sys/class/<iface>/queues/rx-<queue>/rps_cpus
+What: /sys/class/net/<iface>/queues/rx-<queue>/rps_cpus
Date: March 2010
KernelVersion: 2.6.35
@@ -8,7 +8,7 @@ Description:
network device queue. Possible values depend on the number
of available CPU(s) in the system.
-What: /sys/class/<iface>/queues/rx-<queue>/rps_flow_cnt
+What: /sys/class/net/<iface>/queues/rx-<queue>/rps_flow_cnt
Date: April 2010
KernelVersion: 2.6.35
@@ -16,7 +16,7 @@ Description:
Number of Receive Packet Steering flows being currently
processed by this particular network device receive queue.
-What: /sys/class/<iface>/queues/tx-<queue>/tx_timeout
+What: /sys/class/net/<iface>/queues/tx-<queue>/tx_timeout
Date: November 2011
KernelVersion: 3.3
@@ -24,7 +24,7 @@ Description:
Indicates the number of transmit timeout events seen by this
network interface transmit queue.
-What: /sys/class/<iface>/queues/tx-<queue>/tx_maxrate
+What: /sys/class/net/<iface>/queues/tx-<queue>/tx_maxrate
Date: March 2015
KernelVersion: 4.1
@@ -32,7 +32,7 @@ Description:
A Mbps max-rate set for the queue, a value of zero means disabled,
default is disabled.
-What: /sys/class/<iface>/queues/tx-<queue>/xps_cpus
+What: /sys/class/net/<iface>/queues/tx-<queue>/xps_cpus
Date: November 2010
KernelVersion: 2.6.38
@@ -42,7 +42,7 @@ Description:
network device transmit queue. Possible values depend on the
number of available CPU(s) in the system.
-What: /sys/class/<iface>/queues/tx-<queue>/xps_rxqs
+What: /sys/class/net/<iface>/queues/tx-<queue>/xps_rxqs
Date: June 2018
KernelVersion: 4.18.0
@@ -53,7 +53,7 @@ Description:
number of available receive queue(s) in the network device.
Default is disabled.
-What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
Date: November 2011
KernelVersion: 3.3
@@ -62,7 +62,7 @@ Description:
of this particular network device transmit queue.
Default value is 1000.
-What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
Date: November 2011
KernelVersion: 3.3
@@ -70,7 +70,7 @@ Description:
Indicates the number of bytes (objects) in flight on this
network device transmit queue.
-What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit
+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit
Date: November 2011
KernelVersion: 3.3
@@ -79,7 +79,7 @@ Description:
on this network device transmit queue. This value is clamped
to be within the bounds defined by limit_max and limit_min.
-What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
Date: November 2011
KernelVersion: 3.3
@@ -88,7 +88,7 @@ Description:
queued on this network device transmit queue. See
include/linux/dynamic_queue_limits.h for the default value.
-What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
+What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
Date: November 2011
KernelVersion: 3.3

Documentation/netlink/specs/rt_link.yaml

View file
diff --git a/Documentation/netlink/specs/rt_link.yaml b/Documentation/netlink/specs/rt_link.yaml
index 1ad01d5..8e4d19a 100644
--- a/Documentation/netlink/specs/rt_link.yaml
+++ b/Documentation/netlink/specs/rt_link.yaml
@@ -942,6 +942,10 @@ attribute-sets:
-
name: gro-ipv4-max-size
type: u32
+ -
+ name: dpll-pin
+ type: nest
+ nested-attributes: link-dpll-pin-attrs
-
name: af-spec-attrs
attributes:
@@ -1627,6 +1631,12 @@ attribute-sets:
-
name: used
type: u8
+ -
+ name: link-dpll-pin-attrs
+ attributes:
+ -
+ name: id
+ type: u32
sub-messages:
-

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 61117c3..722b894 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15181,6 +15181,7 @@ F: Documentation/networking/net_cachelines/net_device.rst
F: drivers/connector/
F: drivers/net/
F: include/dt-bindings/net/
+F: include/linux/cn_proc.h
F: include/linux/etherdevice.h
F: include/linux/fcdevice.h
F: include/linux/fddidevice.h
@@ -15188,6 +15189,7 @@ F: include/linux/hippidevice.h
F: include/linux/if_*
F: include/linux/inetdevice.h
F: include/linux/netdevice.h
+F: include/uapi/linux/cn_proc.h
F: include/uapi/linux/if_*
F: include/uapi/linux/netdevice.h
X: drivers/net/wireless/
@@ -18085,7 +18087,6 @@ F: drivers/net/ethernet/qualcomm/emac/
QUALCOMM ETHQOS ETHERNET DRIVER
M: Vinod Koul <[email protected]>
-R: Bhupesh Sharma <[email protected]>
S: Maintained

drivers/net/dsa/mt7530.c

View file
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 391c4db..3c1f657 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2838,8 +2838,7 @@ static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
/* MT753x MAC works in 1G full duplex mode for all up-clocked
* variants.
*/
- if (interface == PHY_INTERFACE_MODE_INTERNAL ||
- interface == PHY_INTERFACE_MODE_TRGMII ||
+ if (interface == PHY_INTERFACE_MODE_TRGMII ||
(phy_interface_mode_is_8023z(interface))) {
speed = SPEED_1000;
duplex = DUPLEX_FULL;

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 383b3c4..614cabb 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3659,7 +3659,7 @@ static int mv88e6xxx_mdio_read_c45(struct mii_bus *bus, int phy, int devad,
int err;
if (!chip->info->ops->phy_read_c45)
- return -EOPNOTSUPP;
+ return 0xffff;
mv88e6xxx_reg_lock(chip);
err = chip->info->ops->phy_read_c45(chip, bus, phy, devad, reg, &val);

drivers/net/dsa/qca/qca8k-8xxx.c

View file
diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
index c51f409..7a86432 100644
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
@@ -2051,12 +2051,11 @@ qca8k_sw_probe(struct mdio_device *mdiodev)
priv->info = of_device_get_match_data(priv->dev);
priv->reset_gpio = devm_gpiod_get_optional(priv->dev, "reset",
- GPIOD_ASIS);
+ GPIOD_OUT_HIGH);
if (IS_ERR(priv->reset_gpio))
return PTR_ERR(priv->reset_gpio);
if (priv->reset_gpio) {
- gpiod_set_value_cansleep(priv->reset_gpio, 1);
/* The active low duration must be greater than 10 ms
* and checkpatch.pl wants 20 ms.
*/

drivers/net/ethernet/amd/pds_core/adminq.c

View file
diff --git a/drivers/net/ethernet/amd/pds_core/adminq.c b/drivers/net/ethernet/amd/pds_core/adminq.c
index 5beadab..ea773cf 100644
--- a/drivers/net/ethernet/amd/pds_core/adminq.c
+++ b/drivers/net/ethernet/amd/pds_core/adminq.c
@@ -63,6 +63,15 @@ static int pdsc_process_notifyq(struct pdsc_qcq *qcq)
return nq_work;
}
+static bool pdsc_adminq_inc_if_up(struct pdsc *pdsc)
+{
+ if (pdsc->state & BIT_ULL(PDSC_S_STOPPING_DRIVER) ||
+ pdsc->state & BIT_ULL(PDSC_S_FW_DEAD))
+ return false;
+
+ return refcount_inc_not_zero(&pdsc->adminq_refcnt);
+}
+
void pdsc_process_adminq(struct pdsc_qcq *qcq)
{
union pds_core_adminq_comp *comp;
@@ -75,9 +84,9 @@ void pdsc_process_adminq(struct pdsc_qcq *qcq)
int aq_work = 0;
int credits;
- /* Don't process AdminQ when shutting down */
- if (pdsc->state & BIT_ULL(PDSC_S_STOPPING_DRIVER)) {
- dev_err(pdsc->dev, "%s: called while PDSC_S_STOPPING_DRIVER\n",
+ /* Don't process AdminQ when it's not up */
+ if (!pdsc_adminq_inc_if_up(pdsc)) {
+ dev_err(pdsc->dev, "%s: called while adminq is unavailable\n",
__func__);
return;
}
@@ -124,6 +133,7 @@ credits:
pds_core_intr_credits(&pdsc->intr_ctrl[qcq->intx],
credits,
PDS_CORE_INTR_CRED_REARM);
+ refcount_dec(&pdsc->adminq_refcnt);
}
void pdsc_work_thread(struct work_struct *work)
@@ -135,18 +145,20 @@ void pdsc_work_thread(struct work_struct *work)
irqreturn_t pdsc_adminq_isr(int irq, void *data)
{
- struct pdsc_qcq *qcq = data;
- struct pdsc *pdsc = qcq->pdsc;
+ struct pdsc *pdsc = data;
+ struct pdsc_qcq *qcq;
- /* Don't process AdminQ when shutting down */
- if (pdsc->state & BIT_ULL(PDSC_S_STOPPING_DRIVER)) {
- dev_err(pdsc->dev, "%s: called while PDSC_S_STOPPING_DRIVER\n",
+ /* Don't process AdminQ when it's not up */
+ if (!pdsc_adminq_inc_if_up(pdsc)) {
+ dev_err(pdsc->dev, "%s: called while adminq is unavailable\n",
__func__);
return IRQ_HANDLED;
}
+ qcq = &pdsc->adminqcq;
queue_work(pdsc->wq, &qcq->work);
pds_core_intr_mask(&pdsc->intr_ctrl[qcq->intx], PDS_CORE_INTR_MASK_CLEAR);
+ refcount_dec(&pdsc->adminq_refcnt);
return IRQ_HANDLED;
}
@@ -179,10 +191,16 @@ static int __pdsc_adminq_post(struct pdsc *pdsc,
/* Check that the FW is running */
if (!pdsc_is_fw_running(pdsc)) {
- u8 fw_status = ioread8(&pdsc->info_regs->fw_status);
-
- dev_info(pdsc->dev, "%s: post failed - fw not running %#02x:\n",
- __func__, fw_status);
+ if (pdsc->info_regs) {
+ u8 fw_status =
+ ioread8(&pdsc->info_regs->fw_status);
+
+ dev_info(pdsc->dev, "%s: post failed - fw not running %#02x:\n",
+ __func__, fw_status);
+ } else {
+ dev_info(pdsc->dev, "%s: post failed - BARs not setup\n",
+ __func__);
+ }
ret = -ENXIO;
goto err_out_unlock;
@@ -230,6 +248,12 @@ int pdsc_adminq_post(struct pdsc *pdsc,
int err = 0;
int index;
+ if (!pdsc_adminq_inc_if_up(pdsc)) {
+ dev_dbg(pdsc->dev, "%s: preventing adminq cmd %u\n",
+ __func__, cmd->opcode);
+ return -ENXIO;
+ }
+
wc.qcq = &pdsc->adminqcq;
index = __pdsc_adminq_post(pdsc, &pdsc->adminqcq, cmd, comp, &wc);
if (index < 0) {
@@ -248,10 +272,16 @@ int pdsc_adminq_post(struct pdsc *pdsc,
break;
if (!pdsc_is_fw_running(pdsc)) {
- u8 fw_status = ioread8(&pdsc->info_regs->fw_status);
-
- dev_dbg(pdsc->dev, "%s: post wait failed - fw not running %#02x:\n",
- __func__, fw_status);
+ if (pdsc->info_regs) {
+ u8 fw_status =
+ ioread8(&pdsc->info_regs->fw_status);
+
+ dev_dbg(pdsc->dev, "%s: post wait failed - fw not running %#02x:\n",
+ __func__, fw_status);
+ } else {
+ dev_dbg(pdsc->dev, "%s: post wait failed - BARs not setup\n",
+ __func__);
+ }
err = -ENXIO;
break;
}
@@ -285,6 +315,8 @@ err_out:
queue_work(pdsc->wq, &pdsc->health_work);
}
+ refcount_dec(&pdsc->adminq_refcnt);
+
return err;
}
EXPORT_SYMBOL_GPL(pdsc_adminq_post);

drivers/net/ethernet/amd/pds_core/core.c

View file
diff --git a/drivers/net/ethernet/amd/pds_core/core.c b/drivers/net/ethernet/amd/pds_core/core.c
index 0d2091e..7658a72 100644
--- a/drivers/net/ethernet/amd/pds_core/core.c
+++ b/drivers/net/ethernet/amd/pds_core/core.c
@@ -125,7 +125,7 @@ static int pdsc_qcq_intr_alloc(struct pdsc *pdsc, struct pdsc_qcq *qcq)
snprintf(name, sizeof(name), "%s-%d-%s",
PDS_CORE_DRV_NAME, pdsc->pdev->bus->number, qcq->q.name);
- index = pdsc_intr_alloc(pdsc, name, pdsc_adminq_isr, qcq);
+ index = pdsc_intr_alloc(pdsc, name, pdsc_adminq_isr, pdsc);
if (index < 0)
return index;
qcq->intx = index;
@@ -404,10 +404,7 @@ int pdsc_setup(struct pdsc *pdsc, bool init)
int numdescs;
int err;
- if (init)
- err = pdsc_dev_init(pdsc);
- else
- err = pdsc_dev_reinit(pdsc);
+ err = pdsc_dev_init(pdsc);
if (err)
return err;
@@ -450,6 +447,7 @@ int pdsc_setup(struct pdsc *pdsc, bool init)
pdsc_debugfs_add_viftype(pdsc);
}
+ refcount_set(&pdsc->adminq_refcnt, 1);
clear_bit(PDSC_S_FW_DEAD, &pdsc->state);
return 0;
@@ -464,6 +462,8 @@ void pdsc_teardown(struct pdsc *pdsc, bool removing)
if (!pdsc->pdev->is_virtfn)
pdsc_devcmd_reset(pdsc);
+ if (pdsc->adminqcq.work.func)
+ cancel_work_sync(&pdsc->adminqcq.work);
pdsc_qcq_free(pdsc, &pdsc->notifyqcq);
pdsc_qcq_free(pdsc, &pdsc->adminqcq);
@@ -476,10 +476,9 @@ void pdsc_teardown(struct pdsc *pdsc, bool removing)
for (i = 0; i < pdsc->nintrs; i++)
pdsc_intr_free(pdsc, i);
- if (removing) {
- kfree(pdsc->intr_info);
- pdsc->intr_info = NULL;
- }
+ kfree(pdsc->intr_info);
+ pdsc->intr_info = NULL;
+ pdsc->nintrs = 0;
}
if (pdsc->kern_dbpage) {
@@ -487,6 +486,7 @@ void pdsc_teardown(struct pdsc *pdsc, bool removing)
pdsc->kern_dbpage = NULL;
}
+ pci_free_irq_vectors(pdsc->pdev);
set_bit(PDSC_S_FW_DEAD, &pdsc->state);
}
@@ -512,6 +512,24 @@ void pdsc_stop(struct pdsc *pdsc)
PDS_CORE_INTR_MASK_SET);
}
+static void pdsc_adminq_wait_and_dec_once_unused(struct pdsc *pdsc)
+{
+ /* The driver initializes the adminq_refcnt to 1 when the adminq is
+ * allocated and ready for use. Other users/requesters will increment
+ * the refcnt while in use. If the refcnt is down to 1 then the adminq
+ * is not in use and the refcnt can be cleared and adminq freed. Before
+ * calling this function the driver will set PDSC_S_FW_DEAD, which
+ * prevent subsequent attempts to use the adminq and increment the
+ * refcnt to fail. This guarantees that this function will eventually
+ * exit.
+ */
+ while (!refcount_dec_if_one(&pdsc->adminq_refcnt)) {
+ dev_dbg_ratelimited(pdsc->dev, "%s: adminq in use\n",
+ __func__);
+ cpu_relax();
+ }
+}
+
void pdsc_fw_down(struct pdsc *pdsc)
{
union pds_core_notifyq_comp reset_event = {
@@ -527,6 +545,8 @@ void pdsc_fw_down(struct pdsc *pdsc)
if (pdsc->pdev->is_virtfn)
return;
+ pdsc_adminq_wait_and_dec_once_unused(pdsc);
+
/* Notify clients of fw_down */
if (pdsc->fw_reporter)
devlink_health_report(pdsc->fw_reporter, "FW down reported", pdsc);
@@ -577,7 +597,13 @@ err_out:
static void pdsc_check_pci_health(struct pdsc *pdsc)
{
- u8 fw_status = ioread8(&pdsc->info_regs->fw_status);
+ u8 fw_status;
+
+ /* some sort of teardown already in progress */
+ if (!pdsc->info_regs)
+ return;
+
+ fw_status = ioread8(&pdsc->info_regs->fw_status);
/* is PCI broken? */
if (fw_status != PDS_RC_BAD_PCI)

drivers/net/ethernet/amd/pds_core/core.h

View file
diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
index e35d3e7..110c4b8 100644
--- a/drivers/net/ethernet/amd/pds_core/core.h
+++ b/drivers/net/ethernet/amd/pds_core/core.h
@@ -184,6 +184,7 @@ struct pdsc {
struct mutex devcmd_lock; /* lock for dev_cmd operations */
struct mutex config_lock; /* lock for configuration operations */
spinlock_t adminq_lock; /* lock for adminq operations */
+ refcount_t adminq_refcnt;
struct pds_core_dev_info_regs __iomem *info_regs;
struct pds_core_dev_cmd_regs __iomem *cmd_regs;
struct pds_core_intr __iomem *intr_ctrl;
@@ -280,7 +281,6 @@ int pdsc_devcmd_locked(struct pdsc *pdsc, union pds_core_dev_cmd *cmd,
union pds_core_dev_comp *comp, int max_seconds);
int pdsc_devcmd_init(struct pdsc *pdsc);
int pdsc_devcmd_reset(struct pdsc *pdsc);
-int pdsc_dev_reinit(struct pdsc *pdsc);
int pdsc_dev_init(struct pdsc *pdsc);
void pdsc_reset_prepare(struct pci_dev *pdev);

drivers/net/ethernet/amd/pds_core/debugfs.c

View file
diff --git a/drivers/net/ethernet/amd/pds_core/debugfs.c b/drivers/net/ethernet/amd/pds_core/debugfs.c
index 8ec3922..4e8579c 100644
--- a/drivers/net/ethernet/amd/pds_core/debugfs.c
+++ b/drivers/net/ethernet/amd/pds_core/debugfs.c
@@ -64,6 +64,10 @@ DEFINE_SHOW_ATTRIBUTE(identity);
void pdsc_debugfs_add_ident(struct pdsc *pdsc)
{
+ /* This file will already exist in the reset flow */
+ if (debugfs_lookup("identity", pdsc->dentry))
+ return;
+
debugfs_create_file("identity", 0400, pdsc->dentry,
pdsc, &identity_fops);
}

drivers/net/ethernet/amd/pds_core/dev.c

View file
diff --git a/drivers/net/ethernet/amd/pds_core/dev.c b/drivers/net/ethernet/amd/pds_core/dev.c
index 31940b8..e65a163 100644
--- a/drivers/net/ethernet/amd/pds_core/dev.c
+++ b/drivers/net/ethernet/amd/pds_core/dev.c
@@ -57,6 +57,9 @@ int pdsc_err_to_errno(enum pds_core_status_code code)
bool pdsc_is_fw_running(struct pdsc *pdsc)
{
+ if (!pdsc->info_regs)
+ return false;
+
pdsc->fw_status = ioread8(&pdsc->info_regs->fw_status);
pdsc->last_fw_time = jiffies;
pdsc->last_hb = ioread32(&pdsc->info_regs->fw_heartbeat);
@@ -182,13 +185,17 @@ int pdsc_devcmd_locked(struct pdsc *pdsc, union pds_core_dev_cmd *cmd,
{
int err;
+ if (!pdsc->cmd_regs)
+ return -ENXIO;
+
memcpy_toio(&pdsc->cmd_regs->cmd, cmd, sizeof(*cmd));
pdsc_devcmd_dbell(pdsc);
err = pdsc_devcmd_wait(pdsc, cmd->opcode, max_seconds);
- memcpy_fromio(comp, &pdsc->cmd_regs->comp, sizeof(*comp));
if ((err == -ENXIO || err == -ETIMEDOUT) && pdsc->wq)
queue_work(pdsc->wq, &pdsc->health_work);
+ else
+ memcpy_fromio(comp, &pdsc->cmd_regs->comp, sizeof(*comp));
return err;
}
@@ -309,13 +316,6 @@ static int pdsc_identify(struct pdsc *pdsc)
return 0;
}
-int pdsc_dev_reinit(struct pdsc *pdsc)
-{
- pdsc_init_devinfo(pdsc);
-
- return pdsc_identify(pdsc);
-}
-
int pdsc_dev_init(struct pdsc *pdsc)
{
unsigned int nintrs;

drivers/net/ethernet/amd/pds_core/devlink.c

View file
diff --git a/drivers/net/ethernet/amd/pds_core/devlink.c b/drivers/net/ethernet/amd/pds_core/devlink.c
index e9948ea..54864f2 100644
--- a/drivers/net/ethernet/amd/pds_core/devlink.c
+++ b/drivers/net/ethernet/amd/pds_core/devlink.c
@@ -111,7 +111,8 @@ int pdsc_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
mutex_lock(&pdsc->devcmd_lock);
err = pdsc_devcmd_locked(pdsc, &cmd, &comp, pdsc->devcmd_timeout * 2);
- memcpy_fromio(&fw_list, pdsc->cmd_regs->data, sizeof(fw_list));
+ if (!err)
+ memcpy_fromio(&fw_list, pdsc->cmd_regs->data, sizeof(fw_list));
mutex_unlock(&pdsc->devcmd_lock);
if (err && err != -EIO)
return err;

drivers/net/ethernet/amd/pds_core/fw.c

View file
diff --git a/drivers/net/ethernet/amd/pds_core/fw.c b/drivers/net/ethernet/amd/pds_core/fw.c
index 90a811f..fa62671 100644
--- a/drivers/net/ethernet/amd/pds_core/fw.c
+++ b/drivers/net/ethernet/amd/pds_core/fw.c
@@ -107,6 +107,9 @@ int pdsc_firmware_update(struct pdsc *pdsc, const struct firmware *fw,
dev_info(pdsc->dev, "Installing firmware\n");
+ if (!pdsc->cmd_regs)
+ return -ENXIO;
+
dl = priv_to_devlink(pdsc);
devlink_flash_update_status_notify(dl, "Preparing to flash",
NULL, 0, 0);

drivers/net/ethernet/amd/pds_core/main.c

View file
diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/ethernet/amd/pds_core/main.c
index 3080898..cdbf053 100644
--- a/drivers/net/ethernet/amd/pds_core/main.c
+++ b/drivers/net/ethernet/amd/pds_core/main.c
@@ -37,6 +37,11 @@ static void pdsc_unmap_bars(struct pdsc *pdsc)
struct pdsc_dev_bar *bars = pdsc->bars;
unsigned int i;
+ pdsc->info_regs = NULL;
+ pdsc->cmd_regs = NULL;
+ pdsc->intr_status = NULL;
+ pdsc->intr_ctrl = NULL;
+
for (i = 0; i < PDS_CORE_BARS_MAX; i++) {
if (bars[i].vaddr)
pci_iounmap(pdsc->pdev, bars[i].vaddr);
@@ -293,7 +298,7 @@ err_out_stop:
err_out_teardown:
pdsc_teardown(pdsc, PDSC_TEARDOWN_REMOVING);
err_out_unmap_bars:
- del_timer_sync(&pdsc->wdtimer);
+ timer_shutdown_sync(&pdsc->wdtimer);
if (pdsc->wq)
destroy_workqueue(pdsc->wq);
mutex_destroy(&pdsc->config_lock);
@@ -420,7 +425,7 @@ static void pdsc_remove(struct pci_dev *pdev)
*/
pdsc_sriov_configure(pdev, 0);
- del_timer_sync(&pdsc->wdtimer);
+ timer_shutdown_sync(&pdsc->wdtimer);
if (pdsc->wq)
destroy_workqueue(pdsc->wq);
@@ -433,7 +438,6 @@ static void pdsc_remove(struct pci_dev *pdev)
mutex_destroy(&pdsc->config_lock);
mutex_destroy(&pdsc->devcmd_lock);
- pci_free_irq_vectors(pdev);
pdsc_unmap_bars(pdsc);
pci_release_regions(pdev);
}
@@ -445,13 +449,26 @@ static void pdsc_remove(struct pci_dev *pdev)
devlink_free(dl);
}

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/google/gve/gve_rx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/e1000e/e1000.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/e1000e/ptp.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/idpf/virtchnl2.h

View file

This diff is incomplete. Download the complete patch.

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

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mediatek/mtk_eth_soc.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/microchip/lan966x/lan966x_port.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/netronome/nfp/flower/conntrack.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/stmicro/stmmac/dwmac-imx.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/hyperv/netvsc.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/mediatek-ge-soc.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/xen-netback/netback.c

View file

This diff is incomplete. Download the complete patch.

include/linux/netfilter/ipset/ip_set.h

View file

This diff is incomplete. Download the complete patch.

include/net/af_unix.h

View file

This diff is incomplete. Download the complete patch.

include/net/ip.h

View file

This diff is incomplete. Download the complete patch.

include/net/netfilter/nf_tables.h

View file

This diff is incomplete. Download the complete patch.

net/batman-adv/multicast.c

View file

This diff is incomplete. Download the complete patch.

net/bridge/br_multicast.c

View file

This diff is incomplete. Download the complete patch.

net/bridge/br_private.h

View file

This diff is incomplete. Download the complete patch.

net/devlink/port.c

View file

This diff is incomplete. Download the complete patch.

net/hsr/hsr_device.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ip_output.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ip_sockglue.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ipmr.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/raw.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp.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/addrconf_core.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/llc/af_llc.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/netfilter/ipset/ip_set_bitmap_gen.h

View file

This diff is incomplete. Download the complete patch.

net/netfilter/ipset/ip_set_core.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/ipset/ip_set_hash_gen.h

View file

This diff is incomplete. Download the complete patch.

net/netfilter/ipset/ip_set_list_set.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/nf_conntrack_proto_sctp.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/nf_conntrack_proto_tcp.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/nf_log.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/netfilter/nft_ct.c

View file

This diff is incomplete. Download the complete patch.

net/netfilter/nft_tunnel.c

View file

This diff is incomplete. Download the complete patch.

net/nfc/nci/core.c

View file

This diff is incomplete. Download the complete patch.

net/smc/smc_core.c

View file

This diff is incomplete. Download the complete patch.

net/unix/af_unix.c

View file

This diff is incomplete. Download the complete patch.

net/unix/diag.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/drivers/net/bonding/lag_lib.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/drivers/net/team/config

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/config

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/forwarding/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/lib.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/mptcp/config

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/mptcp/mptcp_join.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/mptcp/mptcp_lib.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/mptcp/settings

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/mptcp/simult_flows.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/net_helper.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/pmtu.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/setup_loopback.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/setup_veth.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/tcp_ao/config

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/tcp_ao/key-management.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/tcp_ao/lib/sock.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/tcp_ao/rst.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/tcp_ao/settings

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/udpgro.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/udpgro_bench.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/udpgro_frglist.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/udpgro_fwd.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/veth.sh

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/net/xdp_dummy.c

View file

This diff is incomplete. Download the complete patch.