History

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

Pull networking fixes from Paolo Abeni: "Including fixes from wifi and can. Current release - regressions: - phy: don't WARN for PHY_UP state in mdio_bus_phy_resume() - wifi: fix locking in mac80211 mlme - eth: - revert "net: mvpp2: debugfs: fix memory leak when using debugfs_lookup()" - mlxbf_gige: fix an IS_ERR() vs NULL bug in mlxbf_gige_mdio_probe Previous releases - regressions: - wifi: fix regression with non-QoS drivers Previous releases - always broken: - mptcp: fix unreleased socket in accept queue - wifi: - don't start TX with fq->lock to fix deadlock - fix memory corruption in minstrel_ht_update_rates() - eth: - macb: fix ZynqMP SGMII non-wakeup source resume failure - mt7531: only do PLL once after the reset - usbnet: fix memory leak in usbnet_disconnect() Misc: - usb: qmi_wwan: add new usb-id for Dell branded EM7455" * tag 'net-6.0-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (30 commits) mptcp: fix unreleased socket in accept queue mptcp: factor out __mptcp_close() without socket lock net: ethernet: mtk_eth_soc: fix mask of RX_DMA_GET_SPORT{,_V2} net: mscc: ocelot: fix tagged VLAN refusal while under a VLAN-unaware bridge can: c_can: don't cache TX messages for C_CAN cores ice: xsk: drop power of 2 ring size restriction for AF_XDP ice: xsk: change batched Tx descriptor cleaning net: usb: qmi_wwan: Add new usb-id for Dell branded EM7455 selftests: Fix the if conditions of in test_extra_filter() net: phy: Don't WARN for PHY_UP state in mdio_bus_phy_resume() net: stmmac: power up/down serdes in stmmac_open/release wifi: mac80211: mlme: Fix double unlock on assoc success handling wifi: mac80211: mlme: Fix missing unlock on beacon RX wifi: mac80211: fix memory corruption in minstrel_ht_update_rates() wifi: mac80211: fix regression with non-QoS drivers wifi: mac80211: ensure vif queues are operational after start wifi: mac80211: don't start TX with fq->lock to fix deadlock wifi: cfg80211: fix MCS divisor value net: hippi: Add missing pci_disable_device() in rr_init_one() net/mlxbf_gige: Fix an IS_ERR() vs NULL bug in mlxbf_gige_mdio_probe ...

Linus Torvalds committed 4 years ago

Commit 511cce12 parents da9eede 3b04cba32 files · +223 −191Browse files

Unified · Split

32 files
  1. MAINTAINERS +1 −1
  2. drivers/net/can/c_can/c_can.h +15 −2
  3. drivers/net/can/c_can/c_can_main.c +5 −6
  4. drivers/net/dsa/mt7530.c +13 −6
  5. drivers/net/ethernet/cadence/macb_main.c +4 −0
  6. drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +19 −9
  7. drivers/net/ethernet/intel/ice/ice_txrx.c +1 −1
  8. drivers/net/ethernet/intel/ice/ice_xsk.c +68 −95
  9. drivers/net/ethernet/intel/ice/ice_xsk.h +2 −5
  10. drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c +2 −2
  11. drivers/net/ethernet/mediatek/mtk_eth_soc.h +2 −2
  12. drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c +2 −2
  13. drivers/net/ethernet/mscc/ocelot.c +7 −0
  14. drivers/net/ethernet/sfc/ef10.c +1 −1
  15. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +13 −10
  16. drivers/net/hippi/rrunner.c +1 −0
  17. drivers/net/phy/phy_device.c +6 −4
  18. drivers/net/tun.c +6 −3
  19. drivers/net/usb/qmi_wwan.c +1 −0
  20. drivers/net/usb/usbnet.c +6 −1
  21. include/uapi/linux/if_tun.h +2 −0
  22. net/mac80211/mlme.c +6 −3
  23. net/mac80211/rc80211_minstrel_ht.c +4 −2
  24. net/mac80211/status.c +1 −1
  25. net/mac80211/tx.c +4 −0
  26. net/mac80211/util.c +2 −2
  27. net/mptcp/protocol.c +13 −3
  28. net/mptcp/protocol.h +2 −0
  29. net/mptcp/subflow.c +7 −26
  30. net/sched/act_ct.c +4 −1
  31. net/wireless/util.c +2 −2
  32. tools/testing/selftests/net/reuseport_bpf.c +1 −1
MAINTAINERS+1−1
@@ -19961,7 +19961,7 @@ S: Supported · 19960 unmodified lines
1996119961 F: drivers/net/team/
1996219962 F: include/linux/if_team.h
1996319963 F: include/uapi/linux/if_team.h
19964−F: tools/testing/selftests/net/team/
19964+F: tools/testing/selftests/drivers/net/team/
1996519965
1996619966 TECHNOLOGIC SYSTEMS TS-5500 PLATFORM SUPPORT
1996719967 M: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com>
drivers/net/can/c_can/c_can.h+15−2
@@ -235,9 +235,22 @@ static inline u8 c_can_get_tx_tail(const struct c_can_tx_ring *ring) · 234 unmodified lines
235235 return ring->tail & (ring->obj_num - 1);
236236 }
237237
238−static inline u8 c_can_get_tx_free(const struct c_can_tx_ring *ring)
238+static inline u8 c_can_get_tx_free(const struct c_can_priv *priv,
239+ const struct c_can_tx_ring *ring)
239240 {
240− return ring->obj_num - (ring->head - ring->tail);
241+ u8 head = c_can_get_tx_head(ring);
242+ u8 tail = c_can_get_tx_tail(ring);
243+
244+ if (priv->type == BOSCH_D_CAN)
245+ return ring->obj_num - (ring->head - ring->tail);
246+
247+ /* This is not a FIFO. C/D_CAN sends out the buffers
248+ * prioritized. The lowest buffer number wins.
249+ */
250+ if (head < tail)
251+ return 0;
252+
253+ return ring->obj_num - head;
241254 }
242255
243256 #endif /* C_CAN_H */
drivers/net/can/c_can/c_can_main.c+5−6
@@ -429,7 +429,7 @@ static void c_can_setup_receive_object(struct net_device *dev, int iface, · 428 unmodified lines
429429 static bool c_can_tx_busy(const struct c_can_priv *priv,
430430 const struct c_can_tx_ring *tx_ring)
431431 {
432− if (c_can_get_tx_free(tx_ring) > 0)
432+ if (c_can_get_tx_free(priv, tx_ring) > 0)
433433 return false;
434434
435435 netif_stop_queue(priv->dev);
@@ -437,7 +437,7 @@ static bool c_can_tx_busy(const struct c_can_priv *priv, · 1 unmodified line
437437 /* Memory barrier before checking tx_free (head and tail) */
438438 smp_mb();
439439
440− if (c_can_get_tx_free(tx_ring) == 0) {
440+ if (c_can_get_tx_free(priv, tx_ring) == 0) {
441441 netdev_dbg(priv->dev,
442442 "Stopping tx-queue (tx_head=0x%08x, tx_tail=0x%08x, len=%d).\n",
443443 tx_ring->head, tx_ring->tail,
@@ -465,7 +465,7 @@ static netdev_tx_t c_can_start_xmit(struct sk_buff *skb, · 21 unmodified lines
465465
466466 idx = c_can_get_tx_head(tx_ring);
467467 tx_ring->head++;
468− if (c_can_get_tx_free(tx_ring) == 0)
468+ if (c_can_get_tx_free(priv, tx_ring) == 0)
469469 netif_stop_queue(dev);
470470
471471 if (idx < c_can_get_tx_tail(tx_ring))
@@ -748,7 +748,7 @@ static void c_can_do_tx(struct net_device *dev) · 276 unmodified lines
748748 return;
749749
750750 tx_ring->tail += pkts;
751− if (c_can_get_tx_free(tx_ring)) {
751+ if (c_can_get_tx_free(priv, tx_ring)) {
752752 /* Make sure that anybody stopping the queue after
753753 * this sees the new tx_ring->tail.
754754 */
@@ -760,8 +760,7 @@ static void c_can_do_tx(struct net_device *dev) · 5 unmodified lines
760760 stats->tx_packets += pkts;
761761
762762 tail = c_can_get_tx_tail(tx_ring);
763−
764− if (tail == 0) {
763+ if (priv->type == BOSCH_D_CAN && tail == 0) {
765764 u8 head = c_can_get_tx_head(tx_ring);
766765
767766 /* Start transmission for all cached messages */
drivers/net/dsa/mt7530.c+13−6
@@ -506,14 +506,19 @@ static bool mt7531_dual_sgmii_supported(struct mt7530_priv *priv) · 505 unmodified lines
506506 static int
507507 mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
508508 {
509− struct mt7530_priv *priv = ds->priv;
509+ return 0;
510+}
511+
512+static void
513+mt7531_pll_setup(struct mt7530_priv *priv)
514+{
510515 u32 top_sig;
511516 u32 hwstrap;
512517 u32 xtal;
513518 u32 val;
514519
515520 if (mt7531_dual_sgmii_supported(priv))
516− return 0;
521+ return;
517522
518523 val = mt7530_read(priv, MT7531_CREV);
519524 top_sig = mt7530_read(priv, MT7531_TOP_SIG_SR);
@@ -592,8 +597,6 @@ mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) · 72 unmodified lines
592597 val |= EN_COREPLL;
593598 mt7530_write(priv, MT7531_PLLGP_EN, val);
594599 usleep_range(25, 35);
595−
596− return 0;
597600 }
598601
599602 static void
@@ -2326,11 +2329,17 @@ mt7531_setup(struct dsa_switch *ds) · 1726 unmodified lines
23262329 return -ENODEV;
23272330 }
23282331
2332+ /* all MACs must be forced link-down before sw reset */
2333+ for (i = 0; i < MT7530_NUM_PORTS; i++)
2334+ mt7530_write(priv, MT7530_PMCR_P(i), MT7531_FORCE_LNK);
2335+
23292336 /* Reset the switch through internal reset */
23302337 mt7530_write(priv, MT7530_SYS_CTRL,
23312338 SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST |
23322339 SYS_CTRL_REG_RST);
23332340
2341+ mt7531_pll_setup(priv);
2342+
23342343 if (mt7531_dual_sgmii_supported(priv)) {
23352344 priv->p5_intf_sel = P5_INTF_SEL_GMAC5_SGMII;
23362345
@@ -2887,8 +2896,6 @@ mt7531_cpu_port_config(struct dsa_switch *ds, int port) · 550 unmodified lines
28872896 case 6:
28882897 interface = PHY_INTERFACE_MODE_2500BASEX;
28892898
2890− mt7531_pad_setup(ds, interface);
2891−
28922899 priv->p6_interface = interface;
28932900 break;
28942901 default:
drivers/net/ethernet/cadence/macb_main.c+4−0
@@ -5109,6 +5109,7 @@ static int __maybe_unused macb_suspend(struct device *dev) · 5108 unmodified lines
51095109 if (!(bp->wol & MACB_WOL_ENABLED)) {
51105110 rtnl_lock();
51115111 phylink_stop(bp->phylink);
5112+ phy_exit(bp->sgmii_phy);
51125113 rtnl_unlock();
51135114 spin_lock_irqsave(&bp->lock, flags);
51145115 macb_reset_hw(bp);
@@ -5198,6 +5199,9 @@ static int __maybe_unused macb_resume(struct device *dev) · 83 unmodified lines
51985199 macb_set_rx_mode(netdev);
51995200 macb_restore_features(bp);
52005201 rtnl_lock();
5202+ if (!device_may_wakeup(&bp->dev->dev))
5203+ phy_init(bp->sgmii_phy);
5204+
52015205 phylink_start(bp->phylink);
52025206 rtnl_unlock();
52035207
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c+19−9
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include "cudbg_entity.h"
1515 #include "cudbg_lib.h"
1616 #include "cudbg_zlib.h"
17+#include "cxgb4_tc_mqprio.h"
1718
1819 static const u32 t6_tp_pio_array[][IREG_NUM_ELEM] = {
1920 {0x7e40, 0x7e44, 0x020, 28}, /* t6_tp_pio_regs_20_to_3b */
@@ -3458,7 +3459,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, · 3438 unmodified lines
34583459 for (i = 0; i < utxq->ntxq; i++)
34593460 QDESC_GET_TXQ(&utxq->uldtxq[i].q,
34603461 cudbg_uld_txq_to_qtype(j),
3461− out_unlock);
3462+ out_unlock_uld);
34623463 }
34633464 }
34643465
@@ -3475,7 +3476,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, · 10 unmodified lines
34753476 for (i = 0; i < urxq->nrxq; i++)
34763477 QDESC_GET_RXQ(&urxq->uldrxq[i].rspq,
34773478 cudbg_uld_rxq_to_qtype(j),
3478− out_unlock);
3479+ out_unlock_uld);
34793480 }
34803481
34813482 /* ULD FLQ */
@@ -3487,7 +3488,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, · 5 unmodified lines
34873488 for (i = 0; i < urxq->nrxq; i++)
34883489 QDESC_GET_FLQ(&urxq->uldrxq[i].fl,
34893490 cudbg_uld_flq_to_qtype(j),
3490− out_unlock);
3491+ out_unlock_uld);
34913492 }
34923493
34933494 /* ULD CIQ */
@@ -3500,29 +3501,34 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, · 6 unmodified lines
35003501 for (i = 0; i < urxq->nciq; i++)
35013502 QDESC_GET_RXQ(&urxq->uldrxq[base + i].rspq,
35023503 cudbg_uld_ciq_to_qtype(j),
3503− out_unlock);
3504+ out_unlock_uld);
35043505 }
35053506 }
3507+ mutex_unlock(&uld_mutex);
3508+
3509+ if (!padap->tc_mqprio)
3510+ goto out;
35063511
3512+ mutex_lock(&padap->tc_mqprio->mqprio_mutex);
35073513 /* ETHOFLD TXQ */
35083514 if (s->eohw_txq)
35093515 for (i = 0; i < s->eoqsets; i++)
35103516 QDESC_GET_TXQ(&s->eohw_txq[i].q,
3511− CUDBG_QTYPE_ETHOFLD_TXQ, out);
3517+ CUDBG_QTYPE_ETHOFLD_TXQ, out_unlock_mqprio);
35123518
35133519 /* ETHOFLD RXQ and FLQ */
35143520 if (s->eohw_rxq) {
35153521 for (i = 0; i < s->eoqsets; i++)
35163522 QDESC_GET_RXQ(&s->eohw_rxq[i].rspq,
3517− CUDBG_QTYPE_ETHOFLD_RXQ, out);
3523+ CUDBG_QTYPE_ETHOFLD_RXQ, out_unlock_mqprio);
35183524
35193525 for (i = 0; i < s->eoqsets; i++)
35203526 QDESC_GET_FLQ(&s->eohw_rxq[i].fl,
3521− CUDBG_QTYPE_ETHOFLD_FLQ, out);
3527+ CUDBG_QTYPE_ETHOFLD_FLQ, out_unlock_mqprio);
35223528 }
35233529
3524−out_unlock:
3525− mutex_unlock(&uld_mutex);
3530+out_unlock_mqprio:
3531+ mutex_unlock(&padap->tc_mqprio->mqprio_mutex);
35263532
35273533 out:
35283534 qdesc_info->qdesc_entry_size = sizeof(*qdesc_entry);
@@ -3559,6 +3565,10 @@ out_free: · 30 unmodified lines
35593565 #undef QDESC_GET
35603566
35613567 return rc;
3568+
3569+out_unlock_uld:
3570+ mutex_unlock(&uld_mutex);
3571+ goto out;
35623572 }
35633573
35643574 int cudbg_collect_flash(struct cudbg_init *pdbg_init,
drivers/net/ethernet/intel/ice/ice_txrx.c+1−1
@@ -1467,7 +1467,7 @@ int ice_napi_poll(struct napi_struct *napi, int budget) · 1466 unmodified lines
14671467 bool wd;
14681468
14691469 if (tx_ring->xsk_pool)
1470− wd = ice_xmit_zc(tx_ring, ICE_DESC_UNUSED(tx_ring), budget);
1470+ wd = ice_xmit_zc(tx_ring);
14711471 else if (ice_ring_is_xdp(tx_ring))
14721472 wd = true;
14731473 else
drivers/net/ethernet/intel/ice/ice_xsk.c+68−95
@@ -392,13 +392,6 @@ int ice_xsk_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool, u16 qid) · 391 unmodified lines
392392 goto failure;
393393 }
394394
395− if (!is_power_of_2(vsi->rx_rings[qid]->count) ||
396− !is_power_of_2(vsi->tx_rings[qid]->count)) {
397− netdev_err(vsi->netdev, "Please align ring sizes to power of 2\n");
398− pool_failure = -EINVAL;
399− goto failure;
400− }
401−
402395 if_running = netif_running(vsi->netdev) && ice_is_xdp_ena_vsi(vsi);
403396
404397 if (if_running) {
@@ -534,11 +527,10 @@ exit: · 129 unmodified lines
534527 bool ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count)
535528 {
536529 u16 rx_thresh = ICE_RING_QUARTER(rx_ring);
537− u16 batched, leftover, i, tail_bumps;
530+ u16 leftover, i, tail_bumps;
538531
539− batched = ALIGN_DOWN(count, rx_thresh);
540− tail_bumps = batched / rx_thresh;
541− leftover = count & (rx_thresh - 1);
532+ tail_bumps = count / rx_thresh;
533+ leftover = count - (tail_bumps * rx_thresh);
542534
543535 for (i = 0; i < tail_bumps; i++)
544536 if (!__ice_alloc_rx_bufs_zc(rx_ring, rx_thresh))
@@ -788,69 +780,57 @@ ice_clean_xdp_tx_buf(struct ice_tx_ring *xdp_ring, struct ice_tx_buf *tx_buf) · 243 unmodified lines
788780 }
789781
790782 /**
791− * ice_clean_xdp_irq_zc - Reclaim resources after transmit completes on XDP ring
792− * @xdp_ring: XDP ring to clean
793− * @napi_budget: amount of descriptors that NAPI allows us to clean
794− *
795− * Returns count of cleaned descriptors
783+ * ice_clean_xdp_irq_zc - produce AF_XDP descriptors to CQ
784+ * @xdp_ring: XDP Tx ring
796785 */
797−static u16 ice_clean_xdp_irq_zc(struct ice_tx_ring *xdp_ring, int napi_budget)
786+static void ice_clean_xdp_irq_zc(struct ice_tx_ring *xdp_ring)
798787 {
799− u16 tx_thresh = ICE_RING_QUARTER(xdp_ring);
800− int budget = napi_budget / tx_thresh;
801− u16 next_dd = xdp_ring->next_dd;
802− u16 ntc, cleared_dds = 0;
803−
804− do {
805− struct ice_tx_desc *next_dd_desc;
806− u16 desc_cnt = xdp_ring->count;
807− struct ice_tx_buf *tx_buf;
808− u32 xsk_frames;
809− u16 i;
810−
811− next_dd_desc = ICE_TX_DESC(xdp_ring, next_dd);
812− if (!(next_dd_desc->cmd_type_offset_bsz &
813− cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE)))
814− break;
788+ u16 ntc = xdp_ring->next_to_clean;
789+ struct ice_tx_desc *tx_desc;
790+ u16 cnt = xdp_ring->count;
791+ struct ice_tx_buf *tx_buf;
792+ u16 xsk_frames = 0;
793+ u16 last_rs;
794+ int i;
815795
816− cleared_dds++;
817− xsk_frames = 0;
818− if (likely(!xdp_ring->xdp_tx_active)) {
819− xsk_frames = tx_thresh;
820− goto skip;
821− }
796+ last_rs = xdp_ring->next_to_use ? xdp_ring->next_to_use - 1 : cnt - 1;
797+ tx_desc = ICE_TX_DESC(xdp_ring, last_rs);
798+ if ((tx_desc->cmd_type_offset_bsz &
799+ cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
800+ if (last_rs >= ntc)
801+ xsk_frames = last_rs - ntc + 1;
802+ else
803+ xsk_frames = last_rs + cnt - ntc + 1;
804+ }
822805
823− ntc = xdp_ring->next_to_clean;
806+ if (!xsk_frames)
807+ return;
824808
825− for (i = 0; i < tx_thresh; i++) {
826− tx_buf = &xdp_ring->tx_buf[ntc];
809+ if (likely(!xdp_ring->xdp_tx_active))
810+ goto skip;
827811
828− if (tx_buf->raw_buf) {
829− ice_clean_xdp_tx_buf(xdp_ring, tx_buf);
830− tx_buf->raw_buf = NULL;
831− } else {
832− xsk_frames++;
833− }
812+ ntc = xdp_ring->next_to_clean;
813+ for (i = 0; i < xsk_frames; i++) {
814+ tx_buf = &xdp_ring->tx_buf[ntc];
834815
835− ntc++;
836− if (ntc >= xdp_ring->count)
837− ntc = 0;
816+ if (tx_buf->raw_buf) {
817+ ice_clean_xdp_tx_buf(xdp_ring, tx_buf);
818+ tx_buf->raw_buf = NULL;
819+ } else {
820+ xsk_frames++;
838821 }
822+
823+ ntc++;
824+ if (ntc >= xdp_ring->count)
825+ ntc = 0;
826+ }
839827 skip:
840− xdp_ring->next_to_clean += tx_thresh;
841− if (xdp_ring->next_to_clean >= desc_cnt)
842− xdp_ring->next_to_clean -= desc_cnt;
843− if (xsk_frames)
844− xsk_tx_completed(xdp_ring->xsk_pool, xsk_frames);
845− next_dd_desc->cmd_type_offset_bsz = 0;
846− next_dd = next_dd + tx_thresh;
847− if (next_dd >= desc_cnt)
848− next_dd = tx_thresh - 1;
849− } while (--budget);
850−
851− xdp_ring->next_dd = next_dd;
852−
853− return cleared_dds * tx_thresh;
828+ tx_desc->cmd_type_offset_bsz = 0;
829+ xdp_ring->next_to_clean += xsk_frames;
830+ if (xdp_ring->next_to_clean >= cnt)
831+ xdp_ring->next_to_clean -= cnt;
832+ if (xsk_frames)
833+ xsk_tx_completed(xdp_ring->xsk_pool, xsk_frames);
854834 }
855835
856836 /**
@@ -885,7 +865,6 @@ static void ice_xmit_pkt(struct ice_tx_ring *xdp_ring, struct xdp_desc *desc, · 28 unmodified lines
885865 static void ice_xmit_pkt_batch(struct ice_tx_ring *xdp_ring, struct xdp_desc *descs,
886866 unsigned int *total_bytes)
887867 {
888− u16 tx_thresh = ICE_RING_QUARTER(xdp_ring);
889868 u16 ntu = xdp_ring->next_to_use;
890869 struct ice_tx_desc *tx_desc;
891870 u32 i;
@@ -905,13 +884,6 @@ static void ice_xmit_pkt_batch(struct ice_tx_ring *xdp_ring, struct xdp_desc *de · 13 unmodified lines
905884 }
906885
907886 xdp_ring->next_to_use = ntu;
908−
909− if (xdp_ring->next_to_use > xdp_ring->next_rs) {
910− tx_desc = ICE_TX_DESC(xdp_ring, xdp_ring->next_rs);
911− tx_desc->cmd_type_offset_bsz |=
912− cpu_to_le64(ICE_TX_DESC_CMD_RS << ICE_TXD_QW1_CMD_S);
913− xdp_ring->next_rs += tx_thresh;
914− }
915887 }
916888
917889 /**
@@ -924,7 +896,6 @@ static void ice_xmit_pkt_batch(struct ice_tx_ring *xdp_ring, struct xdp_desc *de · 6 unmodified lines
924896 static void ice_fill_tx_hw_ring(struct ice_tx_ring *xdp_ring, struct xdp_desc *descs,
925897 u32 nb_pkts, unsigned int *total_bytes)
926898 {
927− u16 tx_thresh = ICE_RING_QUARTER(xdp_ring);
928899 u32 batched, leftover, i;
929900
930901 batched = ALIGN_DOWN(nb_pkts, PKTS_PER_BATCH);
@@ -933,54 +904,54 @@ static void ice_fill_tx_hw_ring(struct ice_tx_ring *xdp_ring, struct xdp_desc *d · 2 unmodified lines
933904 ice_xmit_pkt_batch(xdp_ring, &descs[i], total_bytes);
934905 for (; i < batched + leftover; i++)
935906 ice_xmit_pkt(xdp_ring, &descs[i], total_bytes);
907+}
936908
937− if (xdp_ring->next_to_use > xdp_ring->next_rs) {
938− struct ice_tx_desc *tx_desc;
909+/**
910+ * ice_set_rs_bit - set RS bit on last produced descriptor (one behind current NTU)
911+ * @xdp_ring: XDP ring to produce the HW Tx descriptors on
912+ */
913+static void ice_set_rs_bit(struct ice_tx_ring *xdp_ring)
914+{
915+ u16 ntu = xdp_ring->next_to_use ? xdp_ring->next_to_use - 1 : xdp_ring->count - 1;
916+ struct ice_tx_desc *tx_desc;
939917
940− tx_desc = ICE_TX_DESC(xdp_ring, xdp_ring->next_rs);
941− tx_desc->cmd_type_offset_bsz |=
942− cpu_to_le64(ICE_TX_DESC_CMD_RS << ICE_TXD_QW1_CMD_S);
943− xdp_ring->next_rs += tx_thresh;
944− }
918+ tx_desc = ICE_TX_DESC(xdp_ring, ntu);
919+ tx_desc->cmd_type_offset_bsz |=
920+ cpu_to_le64(ICE_TX_DESC_CMD_RS << ICE_TXD_QW1_CMD_S);
945921 }
946922
947923 /**
948924 * ice_xmit_zc - take entries from XSK Tx ring and place them onto HW Tx ring
949925 * @xdp_ring: XDP ring to produce the HW Tx descriptors on
950− * @budget: number of free descriptors on HW Tx ring that can be used
951− * @napi_budget: amount of descriptors that NAPI allows us to clean
952926 *
953927 * Returns true if there is no more work that needs to be done, false otherwise
954928 */
955−bool ice_xmit_zc(struct ice_tx_ring *xdp_ring, u32 budget, int napi_budget)
929+bool ice_xmit_zc(struct ice_tx_ring *xdp_ring)
956930 {
957931 struct xdp_desc *descs = xdp_ring->xsk_pool->tx_descs;
958− u16 tx_thresh = ICE_RING_QUARTER(xdp_ring);
959932 u32 nb_pkts, nb_processed = 0;
960933 unsigned int total_bytes = 0;
934+ int budget;
935+
936+ ice_clean_xdp_irq_zc(xdp_ring);
961937
962− if (budget < tx_thresh)
963− budget += ice_clean_xdp_irq_zc(xdp_ring, napi_budget);
938+ budget = ICE_DESC_UNUSED(xdp_ring);
939+ budget = min_t(u16, budget, ICE_RING_QUARTER(xdp_ring));
964940
965941 nb_pkts = xsk_tx_peek_release_desc_batch(xdp_ring->xsk_pool, budget);
966942 if (!nb_pkts)
967943 return true;
968944
969945 if (xdp_ring->next_to_use + nb_pkts >= xdp_ring->count) {
970− struct ice_tx_desc *tx_desc;
971−
972946 nb_processed = xdp_ring->count - xdp_ring->next_to_use;
973947 ice_fill_tx_hw_ring(xdp_ring, descs, nb_processed, &total_bytes);
974− tx_desc = ICE_TX_DESC(xdp_ring, xdp_ring->next_rs);
975− tx_desc->cmd_type_offset_bsz |=
976− cpu_to_le64(ICE_TX_DESC_CMD_RS << ICE_TXD_QW1_CMD_S);
977− xdp_ring->next_rs = tx_thresh - 1;
978948 xdp_ring->next_to_use = 0;
979949 }
980950
981951 ice_fill_tx_hw_ring(xdp_ring, &descs[nb_processed], nb_pkts - nb_processed,
982952 &total_bytes);
983953
954+ ice_set_rs_bit(xdp_ring);
984955 ice_xdp_ring_update_tail(xdp_ring);
985956 ice_update_tx_ring_stats(xdp_ring, nb_pkts, total_bytes);
986957
@@ -1058,14 +1029,16 @@ bool ice_xsk_any_rx_ring_ena(struct ice_vsi *vsi) · 71 unmodified lines
10581029 */
10591030 void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring)
10601031 {
1061− u16 count_mask = rx_ring->count - 1;
10621032 u16 ntc = rx_ring->next_to_clean;
10631033 u16 ntu = rx_ring->next_to_use;
10641034
1065− for ( ; ntc != ntu; ntc = (ntc + 1) & count_mask) {
1035+ while (ntc != ntu) {
10661036 struct xdp_buff *xdp = *ice_xdp_buf(rx_ring, ntc);
10671037
10681038 xsk_buff_free(xdp);
1039+ ntc++;
1040+ if (ntc >= rx_ring->count)
1041+ ntc = 0;
10691042 }
10701043 }
10711044
drivers/net/ethernet/intel/ice/ice_xsk.h+2−5
@@ -26,13 +26,10 @@ bool ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count); · 25 unmodified lines
2626 bool ice_xsk_any_rx_ring_ena(struct ice_vsi *vsi);
2727 void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring);
2828 void ice_xsk_clean_xdp_ring(struct ice_tx_ring *xdp_ring);
29−bool ice_xmit_zc(struct ice_tx_ring *xdp_ring, u32 budget, int napi_budget);
29+bool ice_xmit_zc(struct ice_tx_ring *xdp_ring);
3030 int ice_realloc_zc_buf(struct ice_vsi *vsi, bool zc);
3131 #else
32−static inline bool
33−ice_xmit_zc(struct ice_tx_ring __always_unused *xdp_ring,
34− u32 __always_unused budget,
35− int __always_unused napi_budget)
32+static inline bool ice_xmit_zc(struct ice_tx_ring __always_unused *xdp_ring)
3633 {
3734 return false;
3835 }
drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c+2−2
@@ -700,10 +700,10 @@ void mvpp2_dbgfs_cleanup(struct mvpp2 *priv) · 699 unmodified lines
700700
701701 void mvpp2_dbgfs_init(struct mvpp2 *priv, const char *name)
702702 {
703− static struct dentry *mvpp2_root;
704− struct dentry *mvpp2_dir;
703+ struct dentry *mvpp2_dir, *mvpp2_root;
705704 int ret, i;
706705
706+ mvpp2_root = debugfs_lookup(MVPP2_DRIVER_NAME, NULL);
707707 if (!mvpp2_root)
708708 mvpp2_root = debugfs_create_dir(MVPP2_DRIVER_NAME, NULL);
709709
drivers/net/ethernet/mediatek/mtk_eth_soc.h+2−2
@@ -319,8 +319,8 @@ · 318 unmodified lines
319319 #define MTK_RXD5_PPE_CPU_REASON GENMASK(22, 18)
320320 #define MTK_RXD5_SRC_PORT GENMASK(29, 26)
321321
322−#define RX_DMA_GET_SPORT(x) (((x) >> 19) & 0xf)
323−#define RX_DMA_GET_SPORT_V2(x) (((x) >> 26) & 0x7)
322+#define RX_DMA_GET_SPORT(x) (((x) >> 19) & 0x7)
323+#define RX_DMA_GET_SPORT_V2(x) (((x) >> 26) & 0xf)
324324
325325 /* PDMA V2 descriptor rxd3 */
326326 #define RX_DMA_VTAG_V2 BIT(0)
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_mdio.c+2−2
@@ -246,8 +246,8 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) · 245 unmodified lines
246246 }
247247
248248 priv->clk_io = devm_ioremap(dev, res->start, resource_size(res));
249− if (IS_ERR(priv->clk_io))
250− return PTR_ERR(priv->clk_io);
249+ if (!priv->clk_io)
250+ return -ENOMEM;
251251
252252 mlxbf_gige_mdio_cfg(priv);
253253
drivers/net/ethernet/mscc/ocelot.c+7−0
@@ -290,6 +290,13 @@ static int ocelot_port_num_untagged_vlans(struct ocelot *ocelot, int port) · 289 unmodified lines
290290 if (!(vlan->portmask & BIT(port)))
291291 continue;
292292
293+ /* Ignore the VLAN added by ocelot_add_vlan_unaware_pvid(),
294+ * because this is never active in hardware at the same time as
295+ * the bridge VLANs, which only matter in VLAN-aware mode.
296+ */
297+ if (vlan->vid >= OCELOT_RSV_VLAN_RANGE_START)
298+ continue;
299+
293300 if (vlan->untagged & BIT(port))
294301 num_untagged++;
295302 }
drivers/net/ethernet/sfc/ef10.c+1−1
@@ -4213,7 +4213,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = { · 4212 unmodified lines
42134213 .ev_test_generate = efx_ef10_ev_test_generate,
42144214 .filter_table_probe = efx_ef10_filter_table_probe,
42154215 .filter_table_restore = efx_mcdi_filter_table_restore,
4216− .filter_table_remove = efx_mcdi_filter_table_remove,
4216+ .filter_table_remove = efx_ef10_filter_table_remove,
42174217 .filter_update_rx_scatter = efx_mcdi_update_rx_scatter,
42184218 .filter_insert = efx_mcdi_filter_insert,
42194219 .filter_remove_safe = efx_mcdi_filter_remove_safe,
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+13−10
@@ -3801,6 +3801,15 @@ static int __stmmac_open(struct net_device *dev, · 3800 unmodified lines
38013801
38023802 stmmac_reset_queues_param(priv);
38033803
3804+ if (priv->plat->serdes_powerup) {
3805+ ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
3806+ if (ret < 0) {
3807+ netdev_err(priv->dev, "%s: Serdes powerup failed\n",
3808+ __func__);
3809+ goto init_error;
3810+ }
3811+ }
3812+
38043813 ret = stmmac_hw_setup(dev, true);
38053814 if (ret < 0) {
38063815 netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
@@ -3904,6 +3913,10 @@ static int stmmac_release(struct net_device *dev) · 97 unmodified lines
39043913 /* Disable the MAC Rx/Tx */
39053914 stmmac_mac_set(priv, priv->ioaddr, false);
39063915
3916+ /* Powerdown Serdes if there is */
3917+ if (priv->plat->serdes_powerdown)
3918+ priv->plat->serdes_powerdown(dev, priv->plat->bsp_priv);
3919+
39073920 netif_carrier_off(dev);
39083921
39093922 stmmac_release_ptp(priv);
@@ -7293,14 +7306,6 @@ int stmmac_dvr_probe(struct device *device, · 3383 unmodified lines
72937306 goto error_netdev_register;
72947307 }
72957308
7296− if (priv->plat->serdes_powerup) {
7297− ret = priv->plat->serdes_powerup(ndev,
7298− priv->plat->bsp_priv);
7299−
7300− if (ret < 0)
7301− goto error_serdes_powerup;
7302− }
7303−
73047309 #ifdef CONFIG_DEBUG_FS
73057310 stmmac_init_fs(ndev);
73067311 #endif
@@ -7315,8 +7320,6 @@ int stmmac_dvr_probe(struct device *device, · 8 unmodified lines
73157320
73167321 return ret;
73177322
7318−error_serdes_powerup:
7319− unregister_netdev(ndev);
73207323 error_netdev_register:
73217324 phylink_destroy(priv->phylink);
73227325 error_xpcs_setup:
drivers/net/hippi/rrunner.c+1−0
@@ -213,6 +213,7 @@ static int rr_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 212 unmodified lines
213213 pci_iounmap(pdev, rrpriv->regs);
214214 if (pdev)
215215 pci_release_regions(pdev);
216+ pci_disable_device(pdev);
216217 out2:
217218 free_netdev(dev);
218219 out3:
drivers/net/phy/phy_device.c+6−4
@@ -316,11 +316,13 @@ static __maybe_unused int mdio_bus_phy_resume(struct device *dev) · 315 unmodified lines
316316
317317 phydev->suspended_by_mdio_bus = 0;
318318
319− /* If we manged to get here with the PHY state machine in a state neither
320− * PHY_HALTED nor PHY_READY this is an indication that something went wrong
321− * and we should most likely be using MAC managed PM and we are not.
319+ /* If we managed to get here with the PHY state machine in a state
320+ * neither PHY_HALTED, PHY_READY nor PHY_UP, this is an indication
321+ * that something went wrong and we should most likely be using
322+ * MAC managed PM, but we are not.
322323 */
323− WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY);
324+ WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY &&
325+ phydev->state != PHY_UP);
324326
325327 ret = phy_init_hw(phydev);
326328 if (ret < 0)
drivers/net/tun.c+6−3
@@ -2828,7 +2828,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) · 2827 unmodified lines
28282828 rcu_assign_pointer(tfile->tun, tun);
28292829 }
28302830
2831− netif_carrier_on(tun->dev);
2831+ if (ifr->ifr_flags & IFF_NO_CARRIER)
2832+ netif_carrier_off(tun->dev);
2833+ else
2834+ netif_carrier_on(tun->dev);
28322835
28332836 /* Make sure persistent devices do not get stuck in
28342837 * xoff state.
@@ -3056,8 +3059,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, · 221 unmodified lines
30563059 * This is needed because we never checked for invalid flags on
30573060 * TUNSETIFF.
30583061 */
3059− return put_user(IFF_TUN | IFF_TAP | TUN_FEATURES,
3060− (unsigned int __user*)argp);
3062+ return put_user(IFF_TUN | IFF_TAP | IFF_NO_CARRIER |
3063+ TUN_FEATURES, (unsigned int __user*)argp);
30613064 } else if (cmd == TUNSETQUEUE) {
30623065 return tun_set_queue(file, &ifr);
30633066 } else if (cmd == SIOCGSKNS) {
drivers/net/usb/qmi_wwan.c+1−0
@@ -1402,6 +1402,7 @@ static const struct usb_device_id products[] = { · 1401 unmodified lines
14021402 {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
14031403 {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
14041404 {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
1405+ {QMI_FIXED_INTF(0x413c, 0x81c2, 8)}, /* Dell Wireless 5811e */
14051406 {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */
14061407 {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */
14071408 {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */
drivers/net/usb/usbnet.c+6−1
@@ -1598,6 +1598,7 @@ void usbnet_disconnect (struct usb_interface *intf) · 1597 unmodified lines
15981598 struct usbnet *dev;
15991599 struct usb_device *xdev;
16001600 struct net_device *net;
1601+ struct urb *urb;
16011602
16021603 dev = usb_get_intfdata(intf);
16031604 usb_set_intfdata(intf, NULL);
@@ -1614,7 +1615,11 @@ void usbnet_disconnect (struct usb_interface *intf) · 10 unmodified lines
16141615 net = dev->net;
16151616 unregister_netdev (net);
16161617
1617− usb_scuttle_anchored_urbs(&dev->deferred);
1618+ while ((urb = usb_get_from_anchor(&dev->deferred))) {
1619+ dev_kfree_skb(urb->context);
1620+ kfree(urb->sg);
1621+ usb_free_urb(urb);
1622+ }
16181623
16191624 if (dev->driver_info->unbind)
16201625 dev->driver_info->unbind(dev, intf);
include/uapi/linux/if_tun.h+2−0
@@ -67,6 +67,8 @@ · 66 unmodified lines
6767 #define IFF_TAP 0x0002
6868 #define IFF_NAPI 0x0010
6969 #define IFF_NAPI_FRAGS 0x0020
70+/* Used in TUNSETIFF to bring up tun/tap without carrier */
71+#define IFF_NO_CARRIER 0x0040
7072 #define IFF_NO_PI 0x1000
7173 /* This flag has no real effect */
7274 #define IFF_ONE_QUEUE 0x2000
net/mac80211/mlme.c+6−3
@@ -4040,7 +4040,6 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link, · 4039 unmodified lines
40404040
40414041 if (!(link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_HE) &&
40424042 (!elems->he_cap || !elems->he_operation)) {
4043− mutex_unlock(&sdata->local->sta_mtx);
40444043 sdata_info(sdata,
40454044 "HE AP is missing HE capability/operation\n");
40464045 ret = false;
@@ -5589,12 +5588,16 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link, · 1542 unmodified lines
55895588
55905589 mutex_lock(&local->sta_mtx);
55915590 sta = sta_info_get(sdata, sdata->vif.cfg.ap_addr);
5592− if (WARN_ON(!sta))
5591+ if (WARN_ON(!sta)) {
5592+ mutex_unlock(&local->sta_mtx);
55935593 goto free;
5594+ }
55945595 link_sta = rcu_dereference_protected(sta->link[link->link_id],
55955596 lockdep_is_held(&local->sta_mtx));
5596− if (WARN_ON(!link_sta))
5597+ if (WARN_ON(!link_sta)) {
5598+ mutex_unlock(&local->sta_mtx);
55975599 goto free;
5600+ }
55985601
55995602 changed |= ieee80211_recalc_twt_req(link, link_sta, elems);
56005603
net/mac80211/rc80211_minstrel_ht.c+4−2
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/random.h>
1111 #include <linux/moduleparam.h>
1212 #include <linux/ieee80211.h>
13+#include <linux/minmax.h>
1314 #include <net/mac80211.h>
1415 #include "rate.h"
1516 #include "sta_info.h"
@@ -1550,6 +1551,7 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) · 1534 unmodified lines
15501551 {
15511552 struct ieee80211_sta_rates *rates;
15521553 int i = 0;
1554+ int max_rates = min_t(int, mp->hw->max_rates, IEEE80211_TX_RATE_TABLE_SIZE);
15531555
15541556 rates = kzalloc(sizeof(*rates), GFP_ATOMIC);
15551557 if (!rates)
@@ -1559,10 +1561,10 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) · 3 unmodified lines
15591561 minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_tp_rate[0]);
15601562
15611563 /* Fill up remaining, keep one entry for max_probe_rate */
1562− for (; i < (mp->hw->max_rates - 1); i++)
1564+ for (; i < (max_rates - 1); i++)
15631565 minstrel_ht_set_rate(mp, mi, rates, i, mi->max_tp_rate[i]);
15641566
1565− if (i < mp->hw->max_rates)
1567+ if (i < max_rates)
15661568 minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_prob_rate);
15671569
15681570 if (i < IEEE80211_TX_RATE_TABLE_SIZE)
net/mac80211/status.c+1−1
@@ -729,7 +729,7 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local, · 728 unmodified lines
729729
730730 if (!sdata) {
731731 skb->dev = NULL;
732− } else {
732+ } else if (!dropped) {
733733 unsigned int hdr_size =
734734 ieee80211_hdrlen(hdr->frame_control);
735735
net/mac80211/tx.c+4−0
@@ -5878,6 +5878,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, · 5877 unmodified lines
58785878 skb_reset_network_header(skb);
58795879 skb_reset_mac_header(skb);
58805880
5881+ if (local->hw.queues < IEEE80211_NUM_ACS)
5882+ goto start_xmit;
5883+
58815884 /* update QoS header to prioritize control port frames if possible,
58825885 * priorization also happens for control port frames send over
58835886 * AF_PACKET
@@ -5905,6 +5908,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, · 21 unmodified lines
59055908 }
59065909 rcu_read_unlock();
59075910
5911+start_xmit:
59085912 /* mutex lock is only needed for incrementing the cookie counter */
59095913 mutex_lock(&local->mtx);
59105914
net/mac80211/util.c+2−2
@@ -301,14 +301,14 @@ static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac) · 300 unmodified lines
301301 local_bh_disable();
302302 spin_lock(&fq->lock);
303303
304+ sdata->vif.txqs_stopped[ac] = false;
305+
304306 if (!test_bit(SDATA_STATE_RUNNING, &sdata->state))
305307 goto out;
306308
307309 if (sdata->vif.type == NL80211_IFTYPE_AP)
308310 ps = &sdata->bss->ps;
309311
310− sdata->vif.txqs_stopped[ac] = false;
311−
312312 list_for_each_entry_rcu(sta, &local->sta_list, list) {
313313 if (sdata != sta->sdata)
314314 continue;
net/mptcp/protocol.c+13−3
@@ -2662,7 +2662,7 @@ static void __mptcp_clear_xmit(struct sock *sk) · 2661 unmodified lines
26622662 dfrag_clear(sk, dfrag);
26632663 }
26642664
2665−static void mptcp_cancel_work(struct sock *sk)
2665+void mptcp_cancel_work(struct sock *sk)
26662666 {
26672667 struct mptcp_sock *msk = mptcp_sk(sk);
26682668
@@ -2802,13 +2802,12 @@ static void __mptcp_destroy_sock(struct sock *sk) · 133 unmodified lines
28022802 sock_put(sk);
28032803 }
28042804
2805−static void mptcp_close(struct sock *sk, long timeout)
2805+bool __mptcp_close(struct sock *sk, long timeout)
28062806 {
28072807 struct mptcp_subflow_context *subflow;
28082808 struct mptcp_sock *msk = mptcp_sk(sk);
28092809 bool do_cancel_work = false;
28102810
2811− lock_sock(sk);
28122811 sk->sk_shutdown = SHUTDOWN_MASK;
28132812
28142813 if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) {
@@ -2850,6 +2849,17 @@ cleanup: · 35 unmodified lines
28502849 } else {
28512850 mptcp_reset_timeout(msk, 0);
28522851 }
2852+
2853+ return do_cancel_work;
2854+}
2855+
2856+static void mptcp_close(struct sock *sk, long timeout)
2857+{
2858+ bool do_cancel_work;
2859+
2860+ lock_sock(sk);
2861+
2862+ do_cancel_work = __mptcp_close(sk, timeout);
28532863 release_sock(sk);
28542864 if (do_cancel_work)
28552865 mptcp_cancel_work(sk);
net/mptcp/protocol.h+2−0
@@ -612,6 +612,8 @@ void mptcp_subflow_reset(struct sock *ssk); · 611 unmodified lines
612612 void mptcp_subflow_queue_clean(struct sock *ssk);
613613 void mptcp_sock_graft(struct sock *sk, struct socket *parent);
614614 struct socket *__mptcp_nmpc_socket(const struct mptcp_sock *msk);
615+bool __mptcp_close(struct sock *sk, long timeout);
616+void mptcp_cancel_work(struct sock *sk);
615617
616618 bool mptcp_addresses_equal(const struct mptcp_addr_info *a,
617619 const struct mptcp_addr_info *b, bool use_port);
net/mptcp/subflow.c+7−26
@@ -602,30 +602,6 @@ static bool subflow_hmac_valid(const struct request_sock *req, · 601 unmodified lines
602602 return !crypto_memneq(hmac, mp_opt->hmac, MPTCPOPT_HMAC_LEN);
603603 }
604604
605−static void mptcp_sock_destruct(struct sock *sk)
606−{
607− /* if new mptcp socket isn't accepted, it is free'd
608− * from the tcp listener sockets request queue, linked
609− * from req->sk. The tcp socket is released.
610− * This calls the ULP release function which will
611− * also remove the mptcp socket, via
612− * sock_put(ctx->conn).
613− *
614− * Problem is that the mptcp socket will be in
615− * ESTABLISHED state and will not have the SOCK_DEAD flag.
616− * Both result in warnings from inet_sock_destruct.
617− */
618− if ((1 << sk->sk_state) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) {
619− sk->sk_state = TCP_CLOSE;
620− WARN_ON_ONCE(sk->sk_socket);
621− sock_orphan(sk);
622− }
623−
624− /* We don't need to clear msk->subflow, as it's still NULL at this point */
625− mptcp_destroy_common(mptcp_sk(sk), 0);
626− inet_sock_destruct(sk);
627−}
628−
629605 static void mptcp_force_close(struct sock *sk)
630606 {
631607 /* the msk is not yet exposed to user-space */
@@ -768,7 +744,6 @@ create_child: · 136 unmodified lines
768744 /* new mpc subflow takes ownership of the newly
769745 * created mptcp socket
770746 */
771− new_msk->sk_destruct = mptcp_sock_destruct;
772747 mptcp_sk(new_msk)->setsockopt_seq = ctx->setsockopt_seq;
773748 mptcp_pm_new_connection(mptcp_sk(new_msk), child, 1);
774749 mptcp_token_accept(subflow_req, mptcp_sk(new_msk));
@@ -1763,13 +1738,19 @@ void mptcp_subflow_queue_clean(struct sock *listener_ssk) · 988 unmodified lines
17631738
17641739 for (msk = head; msk; msk = next) {
17651740 struct sock *sk = (struct sock *)msk;
1766− bool slow;
1741+ bool slow, do_cancel_work;
17671742
1743+ sock_hold(sk);
17681744 slow = lock_sock_fast_nested(sk);
17691745 next = msk->dl_next;
17701746 msk->first = NULL;
17711747 msk->dl_next = NULL;
1748+
1749+ do_cancel_work = __mptcp_close(sk, 0);
17721750 unlock_sock_fast(sk, slow);
1751+ if (do_cancel_work)
1752+ mptcp_cancel_work(sk);
1753+ sock_put(sk);
17731754 }
17741755
17751756 /* we are still under the listener msk socket lock */
net/sched/act_ct.c+4−1
@@ -1394,7 +1394,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, · 1393 unmodified lines
13941394
13951395 err = tcf_ct_flow_table_get(net, params);
13961396 if (err)
1397− goto cleanup;
1397+ goto cleanup_params;
13981398
13991399 spin_lock_bh(&c->tcf_lock);
14001400 goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
@@ -1409,6 +1409,9 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, · 8 unmodified lines
14091409
14101410 return res;
14111411
1412+cleanup_params:
1413+ if (params->tmpl)
1414+ nf_ct_put(params->tmpl);
14121415 cleanup:
14131416 if (goto_ch)
14141417 tcf_chain_put_by_act(goto_ch);
net/wireless/util.c+2−2
@@ -1361,7 +1361,7 @@ static u32 cfg80211_calculate_bitrate_he(struct rate_info *rate) · 1360 unmodified lines
13611361 25599, /* 4.166666... */
13621362 17067, /* 2.777777... */
13631363 12801, /* 2.083333... */
1364− 11769, /* 1.851851... */
1364+ 11377, /* 1.851725... */
13651365 10239, /* 1.666666... */
13661366 8532, /* 1.388888... */
13671367 7680, /* 1.250000... */
@@ -1444,7 +1444,7 @@ static u32 cfg80211_calculate_bitrate_eht(struct rate_info *rate) · 76 unmodified lines
14441444 25599, /* 4.166666... */
14451445 17067, /* 2.777777... */
14461446 12801, /* 2.083333... */
1447− 11769, /* 1.851851... */
1447+ 11377, /* 1.851725... */
14481448 10239, /* 1.666666... */
14491449 8532, /* 1.388888... */
14501450 7680, /* 1.250000... */
tools/testing/selftests/net/reuseport_bpf.c+1−1
@@ -328,7 +328,7 @@ static void test_extra_filter(const struct test_params p) · 327 unmodified lines
328328 if (bind(fd1, addr, sockaddr_size()))
329329 error(1, errno, "failed to bind recv socket 1");
330330
331− if (!bind(fd2, addr, sockaddr_size()) && errno != EADDRINUSE)
331+ if (!bind(fd2, addr, sockaddr_size()) || errno != EADDRINUSE)
332332 error(1, errno, "bind socket 2 should fail with EADDRINUSE");
333333
334334 free(addr);