Skip to content

Commit fd19d4a

Browse files
committed
Merge tag 'net-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from can, bpf and netfilter. There are a bunch of regressions addressed here, but hopefully nothing spectacular. We are still waiting the driver fix from Intel, mentioned by Jakub in the previous networking pull. Current release - regressions: - core: add softirq safety to netdev_rename_lock - tcp: fix tcp_rcv_fastopen_synack() to enter TCP_CA_Loss for failed TFO - batman-adv: fix RCU race at module unload time Previous releases - regressions: - openvswitch: get related ct labels from its master if it is not confirmed - eth: bonding: fix incorrect software timestamping report - eth: mlxsw: fix memory corruptions on spectrum-4 systems - eth: ionic: use dev_consume_skb_any outside of napi Previous releases - always broken: - netfilter: fully validate NFT_DATA_VALUE on store to data registers - unix: several fixes for OoB data - tcp: fix race for duplicate reqsk on identical SYN - bpf: - fix may_goto with negative offset - fix the corner case with may_goto and jump to the 1st insn - fix overrunning reservations in ringbuf - can: - j1939: recover socket queue on CAN bus error during BAM transmission - mcp251xfd: fix infinite loop when xmit fails - dsa: microchip: monitor potential faults in half-duplex mode - eth: vxlan: pull inner IP header in vxlan_xmit_one() - eth: ionic: fix kernel panic due to multi-buffer handling Misc: - selftest: unix tests refactor and a lot of new cases added" * tag 'net-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (61 commits) net: mana: Fix possible double free in error handling path selftest: af_unix: Check SIOCATMARK after every send()/recv() in msg_oob.c. af_unix: Fix wrong ioctl(SIOCATMARK) when consumed OOB skb is at the head. selftest: af_unix: Check EPOLLPRI after every send()/recv() in msg_oob.c selftest: af_unix: Check SIGURG after every send() in msg_oob.c selftest: af_unix: Add SO_OOBINLINE test cases in msg_oob.c af_unix: Don't stop recv() at consumed ex-OOB skb. selftest: af_unix: Add non-TCP-compliant test cases in msg_oob.c. af_unix: Don't stop recv(MSG_DONTWAIT) if consumed OOB skb is at the head. af_unix: Stop recv(MSG_PEEK) at consumed OOB skb. selftest: af_unix: Add msg_oob.c. selftest: af_unix: Remove test_unix_oob.c. tracing/net_sched: NULL pointer dereference in perf_trace_qdisc_reset() netfilter: nf_tables: fully validate NFT_DATA_VALUE on store to data registers net: usb: qmi_wwan: add Telit FN912 compositions tcp: fix tcp_rcv_fastopen_synack() to enter TCP_CA_Loss for failed TFO ionic: use dev_consume_skb_any outside of napi net: dsa: microchip: fix wrong register write when masking interrupt Fix race for duplicate reqsk on identical SYN ibmvnic: Add tx check to prevent skb leak ...
2 parents 3c1d29e + b62cb6a commit fd19d4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1663
-594
lines changed

Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ required:
128128
- cell-index
129129
- reg
130130
- fsl,fman-ports
131-
- ptp-timer
132131

133132
dependencies:
134133
pcs-handle-names:

Documentation/netlink/specs/ethtool.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ operations:
16031603
attributes:
16041604
- header
16051605
reply:
1606-
attributes: &pse
1606+
attributes:
16071607
- header
16081608
- podl-pse-admin-state
16091609
- podl-pse-admin-control
@@ -1620,7 +1620,10 @@ operations:
16201620

16211621
do:
16221622
request:
1623-
attributes: *pse
1623+
attributes:
1624+
- header
1625+
- podl-pse-admin-control
1626+
- c33-pse-admin-control
16241627
-
16251628
name: rss-get
16261629
doc: Get RSS params.

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4083,12 +4083,13 @@ F: kernel/bpf/ringbuf.c
40834083

40844084
BPF [SECURITY & LSM] (Security Audit and Enforcement using BPF)
40854085
M: KP Singh <[email protected]>
4086-
R: Matt Bobrowski <[email protected]>
4086+
M: Matt Bobrowski <[email protected]>
40874087
40884088
S: Maintained
40894089
F: Documentation/bpf/prog_lsm.rst
40904090
F: include/linux/bpf_lsm.h
40914091
F: kernel/bpf/bpf_lsm.c
4092+
F: kernel/trace/bpf_trace.c
40924093
F: security/bpf/
40934094

40944095
BPF [SELFTESTS] (Test Runners & Infrastructure)
@@ -17531,7 +17532,6 @@ F: include/linux/peci.h
1753117532
PENSANDO ETHERNET DRIVERS
1753217533
M: Shannon Nelson <[email protected]>
1753317534
M: Brett Creeley <[email protected]>
17534-
1753517535
1753617536
S: Supported
1753717537
F: Documentation/networking/device_drivers/ethernet/pensando/ionic.rst

drivers/net/bonding/bond_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5773,6 +5773,9 @@ static int bond_ethtool_get_ts_info(struct net_device *bond_dev,
57735773
if (real_dev) {
57745774
ret = ethtool_get_ts_info_by_layer(real_dev, info);
57755775
} else {
5776+
info->phc_index = -1;
5777+
info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
5778+
SOF_TIMESTAMPING_SOFTWARE;
57765779
/* Check if all slaves support software tx timestamping */
57775780
rcu_read_lock();
57785781
bond_for_each_slave_rcu(bond, slave, iter) {

drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,11 +1618,20 @@ static int mcp251xfd_open(struct net_device *ndev)
16181618
clear_bit(MCP251XFD_FLAGS_DOWN, priv->flags);
16191619
can_rx_offload_enable(&priv->offload);
16201620

1621+
priv->wq = alloc_ordered_workqueue("%s-mcp251xfd_wq",
1622+
WQ_FREEZABLE | WQ_MEM_RECLAIM,
1623+
dev_name(&spi->dev));
1624+
if (!priv->wq) {
1625+
err = -ENOMEM;
1626+
goto out_can_rx_offload_disable;
1627+
}
1628+
INIT_WORK(&priv->tx_work, mcp251xfd_tx_obj_write_sync);
1629+
16211630
err = request_threaded_irq(spi->irq, NULL, mcp251xfd_irq,
16221631
IRQF_SHARED | IRQF_ONESHOT,
16231632
dev_name(&spi->dev), priv);
16241633
if (err)
1625-
goto out_can_rx_offload_disable;
1634+
goto out_destroy_workqueue;
16261635

16271636
err = mcp251xfd_chip_interrupts_enable(priv);
16281637
if (err)
@@ -1634,6 +1643,8 @@ static int mcp251xfd_open(struct net_device *ndev)
16341643

16351644
out_free_irq:
16361645
free_irq(spi->irq, priv);
1646+
out_destroy_workqueue:
1647+
destroy_workqueue(priv->wq);
16371648
out_can_rx_offload_disable:
16381649
can_rx_offload_disable(&priv->offload);
16391650
set_bit(MCP251XFD_FLAGS_DOWN, priv->flags);
@@ -1661,6 +1672,7 @@ static int mcp251xfd_stop(struct net_device *ndev)
16611672
hrtimer_cancel(&priv->tx_irq_timer);
16621673
mcp251xfd_chip_interrupts_disable(priv);
16631674
free_irq(ndev->irq, priv);
1675+
destroy_workqueue(priv->wq);
16641676
can_rx_offload_disable(&priv->offload);
16651677
mcp251xfd_timestamp_stop(priv);
16661678
mcp251xfd_chip_stop(priv, CAN_STATE_STOPPED);

drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,39 @@ mcp251xfd_tx_obj_from_skb(const struct mcp251xfd_priv *priv,
131131
tx_obj->xfer[0].len = len;
132132
}
133133

134+
static void mcp251xfd_tx_failure_drop(const struct mcp251xfd_priv *priv,
135+
struct mcp251xfd_tx_ring *tx_ring,
136+
int err)
137+
{
138+
struct net_device *ndev = priv->ndev;
139+
struct net_device_stats *stats = &ndev->stats;
140+
unsigned int frame_len = 0;
141+
u8 tx_head;
142+
143+
tx_ring->head--;
144+
stats->tx_dropped++;
145+
tx_head = mcp251xfd_get_tx_head(tx_ring);
146+
can_free_echo_skb(ndev, tx_head, &frame_len);
147+
netdev_completed_queue(ndev, 1, frame_len);
148+
netif_wake_queue(ndev);
149+
150+
if (net_ratelimit())
151+
netdev_err(priv->ndev, "ERROR in %s: %d\n", __func__, err);
152+
}
153+
154+
void mcp251xfd_tx_obj_write_sync(struct work_struct *work)
155+
{
156+
struct mcp251xfd_priv *priv = container_of(work, struct mcp251xfd_priv,
157+
tx_work);
158+
struct mcp251xfd_tx_obj *tx_obj = priv->tx_work_obj;
159+
struct mcp251xfd_tx_ring *tx_ring = priv->tx;
160+
int err;
161+
162+
err = spi_sync(priv->spi, &tx_obj->msg);
163+
if (err)
164+
mcp251xfd_tx_failure_drop(priv, tx_ring, err);
165+
}
166+
134167
static int mcp251xfd_tx_obj_write(const struct mcp251xfd_priv *priv,
135168
struct mcp251xfd_tx_obj *tx_obj)
136169
{
@@ -162,6 +195,11 @@ static bool mcp251xfd_tx_busy(const struct mcp251xfd_priv *priv,
162195
return false;
163196
}
164197

198+
static bool mcp251xfd_work_busy(struct work_struct *work)
199+
{
200+
return work_busy(work);
201+
}
202+
165203
netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb,
166204
struct net_device *ndev)
167205
{
@@ -175,7 +213,8 @@ netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb,
175213
if (can_dev_dropped_skb(ndev, skb))
176214
return NETDEV_TX_OK;
177215

178-
if (mcp251xfd_tx_busy(priv, tx_ring))
216+
if (mcp251xfd_tx_busy(priv, tx_ring) ||
217+
mcp251xfd_work_busy(&priv->tx_work))
179218
return NETDEV_TX_BUSY;
180219

181220
tx_obj = mcp251xfd_get_tx_obj_next(tx_ring);
@@ -193,13 +232,13 @@ netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb,
193232
netdev_sent_queue(priv->ndev, frame_len);
194233

195234
err = mcp251xfd_tx_obj_write(priv, tx_obj);
196-
if (err)
197-
goto out_err;
198-
199-
return NETDEV_TX_OK;
200-
201-
out_err:
202-
netdev_err(priv->ndev, "ERROR in %s: %d\n", __func__, err);
235+
if (err == -EBUSY) {
236+
netif_stop_queue(ndev);
237+
priv->tx_work_obj = tx_obj;
238+
queue_work(priv->wq, &priv->tx_work);
239+
} else if (err) {
240+
mcp251xfd_tx_failure_drop(priv, tx_ring, err);
241+
}
203242

204243
return NETDEV_TX_OK;
205244
}

drivers/net/can/spi/mcp251xfd/mcp251xfd.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,10 @@ struct mcp251xfd_priv {
633633
struct mcp251xfd_rx_ring *rx[MCP251XFD_FIFO_RX_NUM];
634634
struct mcp251xfd_tx_ring tx[MCP251XFD_FIFO_TX_NUM];
635635

636+
struct workqueue_struct *wq;
637+
struct work_struct tx_work;
638+
struct mcp251xfd_tx_obj *tx_work_obj;
639+
636640
DECLARE_BITMAP(flags, __MCP251XFD_FLAGS_SIZE__);
637641

638642
u8 rx_ring_num;
@@ -952,6 +956,7 @@ void mcp251xfd_skb_set_timestamp(const struct mcp251xfd_priv *priv,
952956
void mcp251xfd_timestamp_init(struct mcp251xfd_priv *priv);
953957
void mcp251xfd_timestamp_stop(struct mcp251xfd_priv *priv);
954958

959+
void mcp251xfd_tx_obj_write_sync(struct work_struct *work);
955960
netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb,
956961
struct net_device *ndev);
957962

drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ int kvaser_usb_send_cmd_async(struct kvaser_usb_net_priv *priv, void *cmd,
294294
}
295295
usb_free_urb(urb);
296296

297-
return 0;
297+
return err;
298298
}
299299

300300
int kvaser_usb_can_rx_over_error(struct net_device *netdev)

drivers/net/dsa/microchip/ksz9477.c

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,8 @@ int ksz9477_reset_switch(struct ksz_device *dev)
355355
SPI_AUTO_EDGE_DETECTION, 0);
356356

357357
/* default configuration */
358-
ksz_read8(dev, REG_SW_LUE_CTRL_1, &data8);
359-
data8 = SW_AGING_ENABLE | SW_LINK_AUTO_AGING |
360-
SW_SRC_ADDR_FILTER | SW_FLUSH_STP_TABLE | SW_FLUSH_MSTP_TABLE;
361-
ksz_write8(dev, REG_SW_LUE_CTRL_1, data8);
358+
ksz_write8(dev, REG_SW_LUE_CTRL_1,
359+
SW_AGING_ENABLE | SW_LINK_AUTO_AGING | SW_SRC_ADDR_FILTER);
362360

363361
/* disable interrupts */
364362
ksz_write32(dev, REG_SW_INT_MASK__4, SWITCH_INT_MASK);
@@ -429,6 +427,57 @@ void ksz9477_freeze_mib(struct ksz_device *dev, int port, bool freeze)
429427
mutex_unlock(&p->mib.cnt_mutex);
430428
}
431429

430+
int ksz9477_errata_monitor(struct ksz_device *dev, int port,
431+
u64 tx_late_col)
432+
{
433+
u32 pmavbc;
434+
u8 status;
435+
u16 pqm;
436+
int ret;
437+
438+
ret = ksz_pread8(dev, port, REG_PORT_STATUS_0, &status);
439+
if (ret)
440+
return ret;
441+
if (!(FIELD_GET(PORT_INTF_SPEED_MASK, status) == PORT_INTF_SPEED_NONE) &&
442+
!(status & PORT_INTF_FULL_DUPLEX)) {
443+
/* Errata DS80000754 recommends monitoring potential faults in
444+
* half-duplex mode. The switch might not be able to communicate anymore
445+
* in these states.
446+
* If you see this message, please read the errata-sheet for more information:
447+
* https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/Errata/KSZ9477S-Errata-DS80000754.pdf
448+
* To workaround this issue, half-duplex mode should be avoided.
449+
* A software reset could be implemented to recover from this state.
450+
*/
451+
dev_warn_once(dev->dev,
452+
"Half-duplex detected on port %d, transmission halt may occur\n",
453+
port);
454+
if (tx_late_col != 0) {
455+
/* Transmission halt with late collisions */
456+
dev_crit_once(dev->dev,
457+
"TX late collisions detected, transmission may be halted on port %d\n",
458+
port);
459+
}
460+
ret = ksz_read8(dev, REG_SW_LUE_CTRL_0, &status);
461+
if (ret)
462+
return ret;
463+
if (status & SW_VLAN_ENABLE) {
464+
ret = ksz_pread16(dev, port, REG_PORT_QM_TX_CNT_0__4, &pqm);
465+
if (ret)
466+
return ret;
467+
ret = ksz_read32(dev, REG_PMAVBC, &pmavbc);
468+
if (ret)
469+
return ret;
470+
if ((FIELD_GET(PMAVBC_MASK, pmavbc) <= PMAVBC_MIN) ||
471+
(FIELD_GET(PORT_QM_TX_CNT_M, pqm) >= PORT_QM_TX_CNT_MAX)) {
472+
/* Transmission halt with Half-Duplex and VLAN */
473+
dev_crit_once(dev->dev,
474+
"resources out of limits, transmission may be halted\n");
475+
}
476+
}
477+
}
478+
return ret;
479+
}
480+
432481
void ksz9477_port_init_cnt(struct ksz_device *dev, int port)
433482
{
434483
struct ksz_port_mib *mib = &dev->ports[port].mib;
@@ -1299,6 +1348,10 @@ int ksz9477_setup(struct dsa_switch *ds)
12991348
/* Enable REG_SW_MTU__2 reg by setting SW_JUMBO_PACKET */
13001349
ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_JUMBO_PACKET, true);
13011350

1351+
/* Use collision based back pressure mode. */
1352+
ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_BACK_PRESSURE,
1353+
SW_BACK_PRESSURE_COLLISION);
1354+
13021355
/* Now we can configure default MTU value */
13031356
ret = regmap_update_bits(ksz_regmap_16(dev), REG_SW_MTU__2, REG_SW_MTU_MASK,
13041357
VLAN_ETH_FRAME_LEN + ETH_FCS_LEN);

drivers/net/dsa/microchip/ksz9477.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ int ksz9477_port_mirror_add(struct ksz_device *dev, int port,
3636
bool ingress, struct netlink_ext_ack *extack);
3737
void ksz9477_port_mirror_del(struct ksz_device *dev, int port,
3838
struct dsa_mall_mirror_tc_entry *mirror);
39+
int ksz9477_errata_monitor(struct ksz_device *dev, int port,
40+
u64 tx_late_col);
3941
void ksz9477_get_caps(struct ksz_device *dev, int port,
4042
struct phylink_config *config);
4143
int ksz9477_fdb_dump(struct ksz_device *dev, int port,

0 commit comments

Comments
 (0)