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 ...
Unified · Split
| @@ -19961,7 +19961,7 @@ S: Supported · 19960 unmodified lines | |||
| 19961 | F: drivers/net/team/ | 19961 | F: drivers/net/team/ |
| 19962 | F: include/linux/if_team.h | 19962 | F: include/linux/if_team.h |
| 19963 | F: include/uapi/linux/if_team.h | 19963 | F: include/uapi/linux/if_team.h |
| 19964 | F: tools/testing/selftests/net/team/ | 19964 | F: tools/testing/selftests/drivers/net/team/ |
| 19965 | 19965 | ||
| 19966 | TECHNOLOGIC SYSTEMS TS-5500 PLATFORM SUPPORT | 19966 | TECHNOLOGIC SYSTEMS TS-5500 PLATFORM SUPPORT |
| 19967 | M: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com> | 19967 | M: "Savoir-faire Linux Inc." <kernel@savoirfairelinux.com> |
| @@ -235,9 +235,22 @@ static inline u8 c_can_get_tx_tail(const struct c_can_tx_ring *ring) · 234 unmodified lines | |||
| 235 | return ring->tail & (ring->obj_num - 1); | 235 | return ring->tail & (ring->obj_num - 1); |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 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) | ||
| 239 | { | 240 | { |
| 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; | ||
| 241 | } | 254 | } |
| 242 | 255 | ||
| 243 | #endif /* C_CAN_H */ | 256 | #endif /* C_CAN_H */ |
| @@ -429,7 +429,7 @@ static void c_can_setup_receive_object(struct net_device *dev, int iface, · 428 unmodified lines | |||
| 429 | static bool c_can_tx_busy(const struct c_can_priv *priv, | 429 | static bool c_can_tx_busy(const struct c_can_priv *priv, |
| 430 | const struct c_can_tx_ring *tx_ring) | 430 | const struct c_can_tx_ring *tx_ring) |
| 431 | { | 431 | { |
| 432 | if (c_can_get_tx_free(tx_ring) > 0) | 432 | if (c_can_get_tx_free(priv, tx_ring) > 0) |
| 433 | return false; | 433 | return false; |
| 434 | 434 | ||
| 435 | netif_stop_queue(priv->dev); | 435 | netif_stop_queue(priv->dev); |
| @@ -437,7 +437,7 @@ static bool c_can_tx_busy(const struct c_can_priv *priv, · 1 unmodified line | |||
| 437 | /* Memory barrier before checking tx_free (head and tail) */ | 437 | /* Memory barrier before checking tx_free (head and tail) */ |
| 438 | smp_mb(); | 438 | smp_mb(); |
| 439 | 439 | ||
| 440 | if (c_can_get_tx_free(tx_ring) == 0) { | 440 | if (c_can_get_tx_free(priv, tx_ring) == 0) { |
| 441 | netdev_dbg(priv->dev, | 441 | netdev_dbg(priv->dev, |
| 442 | "Stopping tx-queue (tx_head=0x%08x, tx_tail=0x%08x, len=%d).\n", | 442 | "Stopping tx-queue (tx_head=0x%08x, tx_tail=0x%08x, len=%d).\n", |
| 443 | tx_ring->head, tx_ring->tail, | 443 | 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 | |||
| 465 | 465 | ||
| 466 | idx = c_can_get_tx_head(tx_ring); | 466 | idx = c_can_get_tx_head(tx_ring); |
| 467 | tx_ring->head++; | 467 | tx_ring->head++; |
| 468 | if (c_can_get_tx_free(tx_ring) == 0) | 468 | if (c_can_get_tx_free(priv, tx_ring) == 0) |
| 469 | netif_stop_queue(dev); | 469 | netif_stop_queue(dev); |
| 470 | 470 | ||
| 471 | if (idx < c_can_get_tx_tail(tx_ring)) | 471 | 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 | |||
| 748 | return; | 748 | return; |
| 749 | 749 | ||
| 750 | tx_ring->tail += pkts; | 750 | tx_ring->tail += pkts; |
| 751 | if (c_can_get_tx_free(tx_ring)) { | 751 | if (c_can_get_tx_free(priv, tx_ring)) { |
| 752 | /* Make sure that anybody stopping the queue after | 752 | /* Make sure that anybody stopping the queue after |
| 753 | * this sees the new tx_ring->tail. | 753 | * this sees the new tx_ring->tail. |
| 754 | */ | 754 | */ |
| @@ -760,8 +760,7 @@ static void c_can_do_tx(struct net_device *dev) · 5 unmodified lines | |||
| 760 | stats->tx_packets += pkts; | 760 | stats->tx_packets += pkts; |
| 761 | 761 | ||
| 762 | tail = c_can_get_tx_tail(tx_ring); | 762 | tail = c_can_get_tx_tail(tx_ring); |
| 763 | 763 | if (priv->type == BOSCH_D_CAN && tail == 0) { | |
| 764 | if (tail == 0) { | ||
| 765 | u8 head = c_can_get_tx_head(tx_ring); | 764 | u8 head = c_can_get_tx_head(tx_ring); |
| 766 | 765 | ||
| 767 | /* Start transmission for all cached messages */ | 766 | /* Start transmission for all cached messages */ |
| @@ -506,14 +506,19 @@ static bool mt7531_dual_sgmii_supported(struct mt7530_priv *priv) · 505 unmodified lines | |||
| 506 | static int | 506 | static int |
| 507 | mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) | 507 | mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) |
| 508 | { | 508 | { |
| 509 | struct mt7530_priv *priv = ds->priv; | 509 | return 0; |
| 510 | } | ||
| 511 | |||
| 512 | static void | ||
| 513 | mt7531_pll_setup(struct mt7530_priv *priv) | ||
| 514 | { | ||
| 510 | u32 top_sig; | 515 | u32 top_sig; |
| 511 | u32 hwstrap; | 516 | u32 hwstrap; |
| 512 | u32 xtal; | 517 | u32 xtal; |
| 513 | u32 val; | 518 | u32 val; |
| 514 | 519 | ||
| 515 | if (mt7531_dual_sgmii_supported(priv)) | 520 | if (mt7531_dual_sgmii_supported(priv)) |
| 516 | return 0; | 521 | return; |
| 517 | 522 | ||
| 518 | val = mt7530_read(priv, MT7531_CREV); | 523 | val = mt7530_read(priv, MT7531_CREV); |
| 519 | top_sig = mt7530_read(priv, MT7531_TOP_SIG_SR); | 524 | 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 | |||
| 592 | val |= EN_COREPLL; | 597 | val |= EN_COREPLL; |
| 593 | mt7530_write(priv, MT7531_PLLGP_EN, val); | 598 | mt7530_write(priv, MT7531_PLLGP_EN, val); |
| 594 | usleep_range(25, 35); | 599 | usleep_range(25, 35); |
| 595 | |||
| 596 | return 0; | ||
| 597 | } | 600 | } |
| 598 | 601 | ||
| 599 | static void | 602 | static void |
| @@ -2326,11 +2329,17 @@ mt7531_setup(struct dsa_switch *ds) · 1726 unmodified lines | |||
| 2326 | return -ENODEV; | 2329 | return -ENODEV; |
| 2327 | } | 2330 | } |
| 2328 | 2331 | ||
| 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 | |||
| 2329 | /* Reset the switch through internal reset */ | 2336 | /* Reset the switch through internal reset */ |
| 2330 | mt7530_write(priv, MT7530_SYS_CTRL, | 2337 | mt7530_write(priv, MT7530_SYS_CTRL, |
| 2331 | SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | | 2338 | SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | |
| 2332 | SYS_CTRL_REG_RST); | 2339 | SYS_CTRL_REG_RST); |
| 2333 | 2340 | ||
| 2341 | mt7531_pll_setup(priv); | ||
| 2342 | |||
| 2334 | if (mt7531_dual_sgmii_supported(priv)) { | 2343 | if (mt7531_dual_sgmii_supported(priv)) { |
| 2335 | priv->p5_intf_sel = P5_INTF_SEL_GMAC5_SGMII; | 2344 | priv->p5_intf_sel = P5_INTF_SEL_GMAC5_SGMII; |
| 2336 | 2345 | ||
| @@ -2887,8 +2896,6 @@ mt7531_cpu_port_config(struct dsa_switch *ds, int port) · 550 unmodified lines | |||
| 2887 | case 6: | 2896 | case 6: |
| 2888 | interface = PHY_INTERFACE_MODE_2500BASEX; | 2897 | interface = PHY_INTERFACE_MODE_2500BASEX; |
| 2889 | 2898 | ||
| 2890 | mt7531_pad_setup(ds, interface); | ||
| 2891 | |||
| 2892 | priv->p6_interface = interface; | 2899 | priv->p6_interface = interface; |
| 2893 | break; | 2900 | break; |
| 2894 | default: | 2901 | default: |
| @@ -5109,6 +5109,7 @@ static int __maybe_unused macb_suspend(struct device *dev) · 5108 unmodified lines | |||
| 5109 | if (!(bp->wol & MACB_WOL_ENABLED)) { | 5109 | if (!(bp->wol & MACB_WOL_ENABLED)) { |
| 5110 | rtnl_lock(); | 5110 | rtnl_lock(); |
| 5111 | phylink_stop(bp->phylink); | 5111 | phylink_stop(bp->phylink); |
| 5112 | phy_exit(bp->sgmii_phy); | ||
| 5112 | rtnl_unlock(); | 5113 | rtnl_unlock(); |
| 5113 | spin_lock_irqsave(&bp->lock, flags); | 5114 | spin_lock_irqsave(&bp->lock, flags); |
| 5114 | macb_reset_hw(bp); | 5115 | macb_reset_hw(bp); |
| @@ -5198,6 +5199,9 @@ static int __maybe_unused macb_resume(struct device *dev) · 83 unmodified lines | |||
| 5198 | macb_set_rx_mode(netdev); | 5199 | macb_set_rx_mode(netdev); |
| 5199 | macb_restore_features(bp); | 5200 | macb_restore_features(bp); |
| 5200 | rtnl_lock(); | 5201 | rtnl_lock(); |
| 5202 | if (!device_may_wakeup(&bp->dev->dev)) | ||
| 5203 | phy_init(bp->sgmii_phy); | ||
| 5204 | |||
| 5201 | phylink_start(bp->phylink); | 5205 | phylink_start(bp->phylink); |
| 5202 | rtnl_unlock(); | 5206 | rtnl_unlock(); |
| 5203 | 5207 | ||
| @@ -14,6 +14,7 @@ · 13 unmodified lines | |||
| 14 | #include "cudbg_entity.h" | 14 | #include "cudbg_entity.h" |
| 15 | #include "cudbg_lib.h" | 15 | #include "cudbg_lib.h" |
| 16 | #include "cudbg_zlib.h" | 16 | #include "cudbg_zlib.h" |
| 17 | #include "cxgb4_tc_mqprio.h" | ||
| 17 | 18 | ||
| 18 | static const u32 t6_tp_pio_array[][IREG_NUM_ELEM] = { | 19 | static const u32 t6_tp_pio_array[][IREG_NUM_ELEM] = { |
| 19 | {0x7e40, 0x7e44, 0x020, 28}, /* t6_tp_pio_regs_20_to_3b */ | 20 | {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 | |||
| 3458 | for (i = 0; i < utxq->ntxq; i++) | 3459 | for (i = 0; i < utxq->ntxq; i++) |
| 3459 | QDESC_GET_TXQ(&utxq->uldtxq[i].q, | 3460 | QDESC_GET_TXQ(&utxq->uldtxq[i].q, |
| 3460 | cudbg_uld_txq_to_qtype(j), | 3461 | cudbg_uld_txq_to_qtype(j), |
| 3461 | out_unlock); | 3462 | out_unlock_uld); |
| 3462 | } | 3463 | } |
| 3463 | } | 3464 | } |
| 3464 | 3465 | ||
| @@ -3475,7 +3476,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, · 10 unmodified lines | |||
| 3475 | for (i = 0; i < urxq->nrxq; i++) | 3476 | for (i = 0; i < urxq->nrxq; i++) |
| 3476 | QDESC_GET_RXQ(&urxq->uldrxq[i].rspq, | 3477 | QDESC_GET_RXQ(&urxq->uldrxq[i].rspq, |
| 3477 | cudbg_uld_rxq_to_qtype(j), | 3478 | cudbg_uld_rxq_to_qtype(j), |
| 3478 | out_unlock); | 3479 | out_unlock_uld); |
| 3479 | } | 3480 | } |
| 3480 | 3481 | ||
| 3481 | /* ULD FLQ */ | 3482 | /* ULD FLQ */ |
| @@ -3487,7 +3488,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, · 5 unmodified lines | |||
| 3487 | for (i = 0; i < urxq->nrxq; i++) | 3488 | for (i = 0; i < urxq->nrxq; i++) |
| 3488 | QDESC_GET_FLQ(&urxq->uldrxq[i].fl, | 3489 | QDESC_GET_FLQ(&urxq->uldrxq[i].fl, |
| 3489 | cudbg_uld_flq_to_qtype(j), | 3490 | cudbg_uld_flq_to_qtype(j), |
| 3490 | out_unlock); | 3491 | out_unlock_uld); |
| 3491 | } | 3492 | } |
| 3492 | 3493 | ||
| 3493 | /* ULD CIQ */ | 3494 | /* ULD CIQ */ |
| @@ -3500,29 +3501,34 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, · 6 unmodified lines | |||
| 3500 | for (i = 0; i < urxq->nciq; i++) | 3501 | for (i = 0; i < urxq->nciq; i++) |
| 3501 | QDESC_GET_RXQ(&urxq->uldrxq[base + i].rspq, | 3502 | QDESC_GET_RXQ(&urxq->uldrxq[base + i].rspq, |
| 3502 | cudbg_uld_ciq_to_qtype(j), | 3503 | cudbg_uld_ciq_to_qtype(j), |
| 3503 | out_unlock); | 3504 | out_unlock_uld); |
| 3504 | } | 3505 | } |
| 3505 | } | 3506 | } |
| 3507 | mutex_unlock(&uld_mutex); | ||
| 3508 | |||
| 3509 | if (!padap->tc_mqprio) | ||
| 3510 | goto out; | ||
| 3506 | 3511 | ||
| 3512 | mutex_lock(&padap->tc_mqprio->mqprio_mutex); | ||
| 3507 | /* ETHOFLD TXQ */ | 3513 | /* ETHOFLD TXQ */ |
| 3508 | if (s->eohw_txq) | 3514 | if (s->eohw_txq) |
| 3509 | for (i = 0; i < s->eoqsets; i++) | 3515 | for (i = 0; i < s->eoqsets; i++) |
| 3510 | QDESC_GET_TXQ(&s->eohw_txq[i].q, | 3516 | QDESC_GET_TXQ(&s->eohw_txq[i].q, |
| 3511 | CUDBG_QTYPE_ETHOFLD_TXQ, out); | 3517 | CUDBG_QTYPE_ETHOFLD_TXQ, out_unlock_mqprio); |
| 3512 | 3518 | ||
| 3513 | /* ETHOFLD RXQ and FLQ */ | 3519 | /* ETHOFLD RXQ and FLQ */ |
| 3514 | if (s->eohw_rxq) { | 3520 | if (s->eohw_rxq) { |
| 3515 | for (i = 0; i < s->eoqsets; i++) | 3521 | for (i = 0; i < s->eoqsets; i++) |
| 3516 | QDESC_GET_RXQ(&s->eohw_rxq[i].rspq, | 3522 | QDESC_GET_RXQ(&s->eohw_rxq[i].rspq, |
| 3517 | CUDBG_QTYPE_ETHOFLD_RXQ, out); | 3523 | CUDBG_QTYPE_ETHOFLD_RXQ, out_unlock_mqprio); |
| 3518 | 3524 | ||
| 3519 | for (i = 0; i < s->eoqsets; i++) | 3525 | for (i = 0; i < s->eoqsets; i++) |
| 3520 | QDESC_GET_FLQ(&s->eohw_rxq[i].fl, | 3526 | QDESC_GET_FLQ(&s->eohw_rxq[i].fl, |
| 3521 | CUDBG_QTYPE_ETHOFLD_FLQ, out); | 3527 | CUDBG_QTYPE_ETHOFLD_FLQ, out_unlock_mqprio); |
| 3522 | } | 3528 | } |
| 3523 | 3529 | ||
| 3524 | out_unlock: | 3530 | out_unlock_mqprio: |
| 3525 | mutex_unlock(&uld_mutex); | 3531 | mutex_unlock(&padap->tc_mqprio->mqprio_mutex); |
| 3526 | 3532 | ||
| 3527 | out: | 3533 | out: |
| 3528 | qdesc_info->qdesc_entry_size = sizeof(*qdesc_entry); | 3534 | qdesc_info->qdesc_entry_size = sizeof(*qdesc_entry); |
| @@ -3559,6 +3565,10 @@ out_free: · 30 unmodified lines | |||
| 3559 | #undef QDESC_GET | 3565 | #undef QDESC_GET |
| 3560 | 3566 | ||
| 3561 | return rc; | 3567 | return rc; |
| 3568 | |||
| 3569 | out_unlock_uld: | ||
| 3570 | mutex_unlock(&uld_mutex); | ||
| 3571 | goto out; | ||
| 3562 | } | 3572 | } |
| 3563 | 3573 | ||
| 3564 | int cudbg_collect_flash(struct cudbg_init *pdbg_init, | 3574 | int cudbg_collect_flash(struct cudbg_init *pdbg_init, |
| @@ -1467,7 +1467,7 @@ int ice_napi_poll(struct napi_struct *napi, int budget) · 1466 unmodified lines | |||
| 1467 | bool wd; | 1467 | bool wd; |
| 1468 | 1468 | ||
| 1469 | if (tx_ring->xsk_pool) | 1469 | 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); |
| 1471 | else if (ice_ring_is_xdp(tx_ring)) | 1471 | else if (ice_ring_is_xdp(tx_ring)) |
| 1472 | wd = true; | 1472 | wd = true; |
| 1473 | else | 1473 | else |
| @@ -392,13 +392,6 @@ int ice_xsk_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool, u16 qid) · 391 unmodified lines | |||
| 392 | goto failure; | 392 | goto failure; |
| 393 | } | 393 | } |
| 394 | 394 | ||
| 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 | |||
| 402 | if_running = netif_running(vsi->netdev) && ice_is_xdp_ena_vsi(vsi); | 395 | if_running = netif_running(vsi->netdev) && ice_is_xdp_ena_vsi(vsi); |
| 403 | 396 | ||
| 404 | if (if_running) { | 397 | if (if_running) { |
| @@ -534,11 +527,10 @@ exit: · 129 unmodified lines | |||
| 534 | bool ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count) | 527 | bool ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count) |
| 535 | { | 528 | { |
| 536 | u16 rx_thresh = ICE_RING_QUARTER(rx_ring); | 529 | u16 rx_thresh = ICE_RING_QUARTER(rx_ring); |
| 537 | u16 batched, leftover, i, tail_bumps; | 530 | u16 leftover, i, tail_bumps; |
| 538 | 531 | ||
| 539 | batched = ALIGN_DOWN(count, rx_thresh); | 532 | tail_bumps = count / rx_thresh; |
| 540 | tail_bumps = batched / rx_thresh; | 533 | leftover = count - (tail_bumps * rx_thresh); |
| 541 | leftover = count & (rx_thresh - 1); | ||
| 542 | 534 | ||
| 543 | for (i = 0; i < tail_bumps; i++) | 535 | for (i = 0; i < tail_bumps; i++) |
| 544 | if (!__ice_alloc_rx_bufs_zc(rx_ring, rx_thresh)) | 536 | 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 | |||
| 788 | } | 780 | } |
| 789 | 781 | ||
| 790 | /** | 782 | /** |
| 791 | * ice_clean_xdp_irq_zc - Reclaim resources after transmit completes on XDP ring | 783 | * ice_clean_xdp_irq_zc - produce AF_XDP descriptors to CQ |
| 792 | * @xdp_ring: XDP ring to clean | 784 | * @xdp_ring: XDP Tx ring |
| 793 | * @napi_budget: amount of descriptors that NAPI allows us to clean | ||
| 794 | * | ||
| 795 | * Returns count of cleaned descriptors | ||
| 796 | */ | 785 | */ |
| 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) |
| 798 | { | 787 | { |
| 799 | u16 tx_thresh = ICE_RING_QUARTER(xdp_ring); | 788 | u16 ntc = xdp_ring->next_to_clean; |
| 800 | int budget = napi_budget / tx_thresh; | 789 | struct ice_tx_desc *tx_desc; |
| 801 | u16 next_dd = xdp_ring->next_dd; | 790 | u16 cnt = xdp_ring->count; |
| 802 | u16 ntc, cleared_dds = 0; | 791 | struct ice_tx_buf *tx_buf; |
| 803 | 792 | u16 xsk_frames = 0; | |
| 804 | do { | 793 | u16 last_rs; |
| 805 | struct ice_tx_desc *next_dd_desc; | 794 | int i; |
| 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; | ||
| 815 | 795 | ||
| 816 | cleared_dds++; | 796 | last_rs = xdp_ring->next_to_use ? xdp_ring->next_to_use - 1 : cnt - 1; |
| 817 | xsk_frames = 0; | 797 | tx_desc = ICE_TX_DESC(xdp_ring, last_rs); |
| 818 | if (likely(!xdp_ring->xdp_tx_active)) { | 798 | if ((tx_desc->cmd_type_offset_bsz & |
| 819 | xsk_frames = tx_thresh; | 799 | cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE))) { |
| 820 | goto skip; | 800 | if (last_rs >= ntc) |
| 821 | } | 801 | xsk_frames = last_rs - ntc + 1; |
| 802 | else | ||
| 803 | xsk_frames = last_rs + cnt - ntc + 1; | ||
| 804 | } | ||
| 822 | 805 | ||
| 823 | ntc = xdp_ring->next_to_clean; | 806 | if (!xsk_frames) |
| 807 | return; | ||
| 824 | 808 | ||
| 825 | for (i = 0; i < tx_thresh; i++) { | 809 | if (likely(!xdp_ring->xdp_tx_active)) |
| 826 | tx_buf = &xdp_ring->tx_buf[ntc]; | 810 | goto skip; |
| 827 | 811 | ||
| 828 | if (tx_buf->raw_buf) { | 812 | ntc = xdp_ring->next_to_clean; |
| 829 | ice_clean_xdp_tx_buf(xdp_ring, tx_buf); | 813 | for (i = 0; i < xsk_frames; i++) { |
| 830 | tx_buf->raw_buf = NULL; | 814 | tx_buf = &xdp_ring->tx_buf[ntc]; |
| 831 | } else { | ||
| 832 | xsk_frames++; | ||
| 833 | } | ||
| 834 | 815 | ||
| 835 | ntc++; | 816 | if (tx_buf->raw_buf) { |
| 836 | if (ntc >= xdp_ring->count) | 817 | ice_clean_xdp_tx_buf(xdp_ring, tx_buf); |
| 837 | ntc = 0; | 818 | tx_buf->raw_buf = NULL; |
| 819 | } else { | ||
| 820 | xsk_frames++; | ||
| 838 | } | 821 | } |
| 822 | |||
| 823 | ntc++; | ||
| 824 | if (ntc >= xdp_ring->count) | ||
| 825 | ntc = 0; | ||
| 826 | } | ||
| 839 | skip: | 827 | skip: |
| 840 | xdp_ring->next_to_clean += tx_thresh; | 828 | tx_desc->cmd_type_offset_bsz = 0; |
| 841 | if (xdp_ring->next_to_clean >= desc_cnt) | 829 | xdp_ring->next_to_clean += xsk_frames; |
| 842 | xdp_ring->next_to_clean -= desc_cnt; | 830 | if (xdp_ring->next_to_clean >= cnt) |
| 843 | if (xsk_frames) | 831 | xdp_ring->next_to_clean -= cnt; |
| 844 | xsk_tx_completed(xdp_ring->xsk_pool, xsk_frames); | 832 | if (xsk_frames) |
| 845 | next_dd_desc->cmd_type_offset_bsz = 0; | 833 | xsk_tx_completed(xdp_ring->xsk_pool, xsk_frames); |
| 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; | ||
| 854 | } | 834 | } |
| 855 | 835 | ||
| 856 | /** | 836 | /** |
| @@ -885,7 +865,6 @@ static void ice_xmit_pkt(struct ice_tx_ring *xdp_ring, struct xdp_desc *desc, · 28 unmodified lines | |||
| 885 | static void ice_xmit_pkt_batch(struct ice_tx_ring *xdp_ring, struct xdp_desc *descs, | 865 | static void ice_xmit_pkt_batch(struct ice_tx_ring *xdp_ring, struct xdp_desc *descs, |
| 886 | unsigned int *total_bytes) | 866 | unsigned int *total_bytes) |
| 887 | { | 867 | { |
| 888 | u16 tx_thresh = ICE_RING_QUARTER(xdp_ring); | ||
| 889 | u16 ntu = xdp_ring->next_to_use; | 868 | u16 ntu = xdp_ring->next_to_use; |
| 890 | struct ice_tx_desc *tx_desc; | 869 | struct ice_tx_desc *tx_desc; |
| 891 | u32 i; | 870 | 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 | |||
| 905 | } | 884 | } |
| 906 | 885 | ||
| 907 | xdp_ring->next_to_use = ntu; | 886 | 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 | } | ||
| 915 | } | 887 | } |
| 916 | 888 | ||
| 917 | /** | 889 | /** |
| @@ -924,7 +896,6 @@ static void ice_xmit_pkt_batch(struct ice_tx_ring *xdp_ring, struct xdp_desc *de · 6 unmodified lines | |||
| 924 | static void ice_fill_tx_hw_ring(struct ice_tx_ring *xdp_ring, struct xdp_desc *descs, | 896 | static void ice_fill_tx_hw_ring(struct ice_tx_ring *xdp_ring, struct xdp_desc *descs, |
| 925 | u32 nb_pkts, unsigned int *total_bytes) | 897 | u32 nb_pkts, unsigned int *total_bytes) |
| 926 | { | 898 | { |
| 927 | u16 tx_thresh = ICE_RING_QUARTER(xdp_ring); | ||
| 928 | u32 batched, leftover, i; | 899 | u32 batched, leftover, i; |
| 929 | 900 | ||
| 930 | batched = ALIGN_DOWN(nb_pkts, PKTS_PER_BATCH); | 901 | 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 | |||
| 933 | ice_xmit_pkt_batch(xdp_ring, &descs[i], total_bytes); | 904 | ice_xmit_pkt_batch(xdp_ring, &descs[i], total_bytes); |
| 934 | for (; i < batched + leftover; i++) | 905 | for (; i < batched + leftover; i++) |
| 935 | ice_xmit_pkt(xdp_ring, &descs[i], total_bytes); | 906 | ice_xmit_pkt(xdp_ring, &descs[i], total_bytes); |
| 907 | } | ||
| 936 | 908 | ||
| 937 | if (xdp_ring->next_to_use > xdp_ring->next_rs) { | 909 | /** |
| 938 | struct ice_tx_desc *tx_desc; | 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; | ||
| 939 | 917 | ||
| 940 | tx_desc = ICE_TX_DESC(xdp_ring, xdp_ring->next_rs); | 918 | tx_desc = ICE_TX_DESC(xdp_ring, ntu); |
| 941 | tx_desc->cmd_type_offset_bsz |= | 919 | tx_desc->cmd_type_offset_bsz |= |
| 942 | cpu_to_le64(ICE_TX_DESC_CMD_RS << ICE_TXD_QW1_CMD_S); | 920 | cpu_to_le64(ICE_TX_DESC_CMD_RS << ICE_TXD_QW1_CMD_S); |
| 943 | xdp_ring->next_rs += tx_thresh; | ||
| 944 | } | ||
| 945 | } | 921 | } |
| 946 | 922 | ||
| 947 | /** | 923 | /** |
| 948 | * ice_xmit_zc - take entries from XSK Tx ring and place them onto HW Tx ring | 924 | * ice_xmit_zc - take entries from XSK Tx ring and place them onto HW Tx ring |
| 949 | * @xdp_ring: XDP ring to produce the HW Tx descriptors on | 925 | * @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 | ||
| 952 | * | 926 | * |
| 953 | * Returns true if there is no more work that needs to be done, false otherwise | 927 | * Returns true if there is no more work that needs to be done, false otherwise |
| 954 | */ | 928 | */ |
| 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) |
| 956 | { | 930 | { |
| 957 | struct xdp_desc *descs = xdp_ring->xsk_pool->tx_descs; | 931 | struct xdp_desc *descs = xdp_ring->xsk_pool->tx_descs; |
| 958 | u16 tx_thresh = ICE_RING_QUARTER(xdp_ring); | ||
| 959 | u32 nb_pkts, nb_processed = 0; | 932 | u32 nb_pkts, nb_processed = 0; |
| 960 | unsigned int total_bytes = 0; | 933 | unsigned int total_bytes = 0; |
| 934 | int budget; | ||
| 935 | |||
| 936 | ice_clean_xdp_irq_zc(xdp_ring); | ||
| 961 | 937 | ||
| 962 | if (budget < tx_thresh) | 938 | budget = ICE_DESC_UNUSED(xdp_ring); |
| 963 | budget += ice_clean_xdp_irq_zc(xdp_ring, napi_budget); | 939 | budget = min_t(u16, budget, ICE_RING_QUARTER(xdp_ring)); |
| 964 | 940 | ||
| 965 | nb_pkts = xsk_tx_peek_release_desc_batch(xdp_ring->xsk_pool, budget); | 941 | nb_pkts = xsk_tx_peek_release_desc_batch(xdp_ring->xsk_pool, budget); |
| 966 | if (!nb_pkts) | 942 | if (!nb_pkts) |
| 967 | return true; | 943 | return true; |
| 968 | 944 | ||
| 969 | if (xdp_ring->next_to_use + nb_pkts >= xdp_ring->count) { | 945 | if (xdp_ring->next_to_use + nb_pkts >= xdp_ring->count) { |
| 970 | struct ice_tx_desc *tx_desc; | ||
| 971 | |||
| 972 | nb_processed = xdp_ring->count - xdp_ring->next_to_use; | 946 | nb_processed = xdp_ring->count - xdp_ring->next_to_use; |
| 973 | ice_fill_tx_hw_ring(xdp_ring, descs, nb_processed, &total_bytes); | 947 | 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; | ||
| 978 | xdp_ring->next_to_use = 0; | 948 | xdp_ring->next_to_use = 0; |
| 979 | } | 949 | } |
| 980 | 950 | ||
| 981 | ice_fill_tx_hw_ring(xdp_ring, &descs[nb_processed], nb_pkts - nb_processed, | 951 | ice_fill_tx_hw_ring(xdp_ring, &descs[nb_processed], nb_pkts - nb_processed, |
| 982 | &total_bytes); | 952 | &total_bytes); |
| 983 | 953 | ||
| 954 | ice_set_rs_bit(xdp_ring); | ||
| 984 | ice_xdp_ring_update_tail(xdp_ring); | 955 | ice_xdp_ring_update_tail(xdp_ring); |
| 985 | ice_update_tx_ring_stats(xdp_ring, nb_pkts, total_bytes); | 956 | ice_update_tx_ring_stats(xdp_ring, nb_pkts, total_bytes); |
| 986 | 957 | ||
| @@ -1058,14 +1029,16 @@ bool ice_xsk_any_rx_ring_ena(struct ice_vsi *vsi) · 71 unmodified lines | |||
| 1058 | */ | 1029 | */ |
| 1059 | void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring) | 1030 | void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring) |
| 1060 | { | 1031 | { |
| 1061 | u16 count_mask = rx_ring->count - 1; | ||
| 1062 | u16 ntc = rx_ring->next_to_clean; | 1032 | u16 ntc = rx_ring->next_to_clean; |
| 1063 | u16 ntu = rx_ring->next_to_use; | 1033 | u16 ntu = rx_ring->next_to_use; |
| 1064 | 1034 | ||
| 1065 | for ( ; ntc != ntu; ntc = (ntc + 1) & count_mask) { | 1035 | while (ntc != ntu) { |
| 1066 | struct xdp_buff *xdp = *ice_xdp_buf(rx_ring, ntc); | 1036 | struct xdp_buff *xdp = *ice_xdp_buf(rx_ring, ntc); |
| 1067 | 1037 | ||
| 1068 | xsk_buff_free(xdp); | 1038 | xsk_buff_free(xdp); |
| 1039 | ntc++; | ||
| 1040 | if (ntc >= rx_ring->count) | ||
| 1041 | ntc = 0; | ||
| 1069 | } | 1042 | } |
| 1070 | } | 1043 | } |
| 1071 | 1044 | ||
| @@ -26,13 +26,10 @@ bool ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count); · 25 unmodified lines | |||
| 26 | bool ice_xsk_any_rx_ring_ena(struct ice_vsi *vsi); | 26 | bool ice_xsk_any_rx_ring_ena(struct ice_vsi *vsi); |
| 27 | void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring); | 27 | void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring); |
| 28 | void ice_xsk_clean_xdp_ring(struct ice_tx_ring *xdp_ring); | 28 | 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); |
| 30 | int ice_realloc_zc_buf(struct ice_vsi *vsi, bool zc); | 30 | int ice_realloc_zc_buf(struct ice_vsi *vsi, bool zc); |
| 31 | #else | 31 | #else |
| 32 | static inline bool | 32 | static inline bool ice_xmit_zc(struct ice_tx_ring __always_unused *xdp_ring) |
| 33 | ice_xmit_zc(struct ice_tx_ring __always_unused *xdp_ring, | ||
| 34 | u32 __always_unused budget, | ||
| 35 | int __always_unused napi_budget) | ||
| 36 | { | 33 | { |
| 37 | return false; | 34 | return false; |
| 38 | } | 35 | } |
| @@ -700,10 +700,10 @@ void mvpp2_dbgfs_cleanup(struct mvpp2 *priv) · 699 unmodified lines | |||
| 700 | 700 | ||
| 701 | void mvpp2_dbgfs_init(struct mvpp2 *priv, const char *name) | 701 | void mvpp2_dbgfs_init(struct mvpp2 *priv, const char *name) |
| 702 | { | 702 | { |
| 703 | static struct dentry *mvpp2_root; | 703 | struct dentry *mvpp2_dir, *mvpp2_root; |
| 704 | struct dentry *mvpp2_dir; | ||
| 705 | int ret, i; | 704 | int ret, i; |
| 706 | 705 | ||
| 706 | mvpp2_root = debugfs_lookup(MVPP2_DRIVER_NAME, NULL); | ||
| 707 | if (!mvpp2_root) | 707 | if (!mvpp2_root) |
| 708 | mvpp2_root = debugfs_create_dir(MVPP2_DRIVER_NAME, NULL); | 708 | mvpp2_root = debugfs_create_dir(MVPP2_DRIVER_NAME, NULL); |
| 709 | 709 | ||
| @@ -319,8 +319,8 @@ · 318 unmodified lines | |||
| 319 | #define MTK_RXD5_PPE_CPU_REASON GENMASK(22, 18) | 319 | #define MTK_RXD5_PPE_CPU_REASON GENMASK(22, 18) |
| 320 | #define MTK_RXD5_SRC_PORT GENMASK(29, 26) | 320 | #define MTK_RXD5_SRC_PORT GENMASK(29, 26) |
| 321 | 321 | ||
| 322 | #define RX_DMA_GET_SPORT(x) (((x) >> 19) & 0xf) | 322 | #define RX_DMA_GET_SPORT(x) (((x) >> 19) & 0x7) |
| 323 | #define RX_DMA_GET_SPORT_V2(x) (((x) >> 26) & 0x7) | 323 | #define RX_DMA_GET_SPORT_V2(x) (((x) >> 26) & 0xf) |
| 324 | 324 | ||
| 325 | /* PDMA V2 descriptor rxd3 */ | 325 | /* PDMA V2 descriptor rxd3 */ |
| 326 | #define RX_DMA_VTAG_V2 BIT(0) | 326 | #define RX_DMA_VTAG_V2 BIT(0) |
| @@ -246,8 +246,8 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv) · 245 unmodified lines | |||
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); | 248 | priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); |
| 249 | if (IS_ERR(priv->clk_io)) | 249 | if (!priv->clk_io) |
| 250 | return PTR_ERR(priv->clk_io); | 250 | return -ENOMEM; |
| 251 | 251 | ||
| 252 | mlxbf_gige_mdio_cfg(priv); | 252 | mlxbf_gige_mdio_cfg(priv); |
| 253 | 253 | ||
| @@ -290,6 +290,13 @@ static int ocelot_port_num_untagged_vlans(struct ocelot *ocelot, int port) · 289 unmodified lines | |||
| 290 | if (!(vlan->portmask & BIT(port))) | 290 | if (!(vlan->portmask & BIT(port))) |
| 291 | continue; | 291 | continue; |
| 292 | 292 | ||
| 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 | |||
| 293 | if (vlan->untagged & BIT(port)) | 300 | if (vlan->untagged & BIT(port)) |
| 294 | num_untagged++; | 301 | num_untagged++; |
| 295 | } | 302 | } |
| @@ -4213,7 +4213,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = { · 4212 unmodified lines | |||
| 4213 | .ev_test_generate = efx_ef10_ev_test_generate, | 4213 | .ev_test_generate = efx_ef10_ev_test_generate, |
| 4214 | .filter_table_probe = efx_ef10_filter_table_probe, | 4214 | .filter_table_probe = efx_ef10_filter_table_probe, |
| 4215 | .filter_table_restore = efx_mcdi_filter_table_restore, | 4215 | .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, |
| 4217 | .filter_update_rx_scatter = efx_mcdi_update_rx_scatter, | 4217 | .filter_update_rx_scatter = efx_mcdi_update_rx_scatter, |
| 4218 | .filter_insert = efx_mcdi_filter_insert, | 4218 | .filter_insert = efx_mcdi_filter_insert, |
| 4219 | .filter_remove_safe = efx_mcdi_filter_remove_safe, | 4219 | .filter_remove_safe = efx_mcdi_filter_remove_safe, |
| @@ -3801,6 +3801,15 @@ static int __stmmac_open(struct net_device *dev, · 3800 unmodified lines | |||
| 3801 | 3801 | ||
| 3802 | stmmac_reset_queues_param(priv); | 3802 | stmmac_reset_queues_param(priv); |
| 3803 | 3803 | ||
| 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 | |||
| 3804 | ret = stmmac_hw_setup(dev, true); | 3813 | ret = stmmac_hw_setup(dev, true); |
| 3805 | if (ret < 0) { | 3814 | if (ret < 0) { |
| 3806 | netdev_err(priv->dev, "%s: Hw setup failed\n", __func__); | 3815 | 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 | |||
| 3904 | /* Disable the MAC Rx/Tx */ | 3913 | /* Disable the MAC Rx/Tx */ |
| 3905 | stmmac_mac_set(priv, priv->ioaddr, false); | 3914 | stmmac_mac_set(priv, priv->ioaddr, false); |
| 3906 | 3915 | ||
| 3916 | /* Powerdown Serdes if there is */ | ||
| 3917 | if (priv->plat->serdes_powerdown) | ||
| 3918 | priv->plat->serdes_powerdown(dev, priv->plat->bsp_priv); | ||
| 3919 | |||
| 3907 | netif_carrier_off(dev); | 3920 | netif_carrier_off(dev); |
| 3908 | 3921 | ||
| 3909 | stmmac_release_ptp(priv); | 3922 | stmmac_release_ptp(priv); |
| @@ -7293,14 +7306,6 @@ int stmmac_dvr_probe(struct device *device, · 3383 unmodified lines | |||
| 7293 | goto error_netdev_register; | 7306 | goto error_netdev_register; |
| 7294 | } | 7307 | } |
| 7295 | 7308 | ||
| 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 | |||
| 7304 | #ifdef CONFIG_DEBUG_FS | 7309 | #ifdef CONFIG_DEBUG_FS |
| 7305 | stmmac_init_fs(ndev); | 7310 | stmmac_init_fs(ndev); |
| 7306 | #endif | 7311 | #endif |
| @@ -7315,8 +7320,6 @@ int stmmac_dvr_probe(struct device *device, · 8 unmodified lines | |||
| 7315 | 7320 | ||
| 7316 | return ret; | 7321 | return ret; |
| 7317 | 7322 | ||
| 7318 | error_serdes_powerup: | ||
| 7319 | unregister_netdev(ndev); | ||
| 7320 | error_netdev_register: | 7323 | error_netdev_register: |
| 7321 | phylink_destroy(priv->phylink); | 7324 | phylink_destroy(priv->phylink); |
| 7322 | error_xpcs_setup: | 7325 | error_xpcs_setup: |
| @@ -213,6 +213,7 @@ static int rr_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 212 unmodified lines | |||
| 213 | pci_iounmap(pdev, rrpriv->regs); | 213 | pci_iounmap(pdev, rrpriv->regs); |
| 214 | if (pdev) | 214 | if (pdev) |
| 215 | pci_release_regions(pdev); | 215 | pci_release_regions(pdev); |
| 216 | pci_disable_device(pdev); | ||
| 216 | out2: | 217 | out2: |
| 217 | free_netdev(dev); | 218 | free_netdev(dev); |
| 218 | out3: | 219 | out3: |
| @@ -316,11 +316,13 @@ static __maybe_unused int mdio_bus_phy_resume(struct device *dev) · 315 unmodified lines | |||
| 316 | 316 | ||
| 317 | phydev->suspended_by_mdio_bus = 0; | 317 | phydev->suspended_by_mdio_bus = 0; |
| 318 | 318 | ||
| 319 | /* If we manged to get here with the PHY state machine in a state neither | 319 | /* If we managed to get here with the PHY state machine in a state |
| 320 | * PHY_HALTED nor PHY_READY this is an indication that something went wrong | 320 | * neither PHY_HALTED, PHY_READY nor PHY_UP, this is an indication |
| 321 | * and we should most likely be using MAC managed PM and we are not. | 321 | * that something went wrong and we should most likely be using |
| 322 | * MAC managed PM, but we are not. | ||
| 322 | */ | 323 | */ |
| 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); | ||
| 324 | 326 | ||
| 325 | ret = phy_init_hw(phydev); | 327 | ret = phy_init_hw(phydev); |
| 326 | if (ret < 0) | 328 | if (ret < 0) |
| @@ -2828,7 +2828,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) · 2827 unmodified lines | |||
| 2828 | rcu_assign_pointer(tfile->tun, tun); | 2828 | rcu_assign_pointer(tfile->tun, tun); |
| 2829 | } | 2829 | } |
| 2830 | 2830 | ||
| 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); | ||
| 2832 | 2835 | ||
| 2833 | /* Make sure persistent devices do not get stuck in | 2836 | /* Make sure persistent devices do not get stuck in |
| 2834 | * xoff state. | 2837 | * xoff state. |
| @@ -3056,8 +3059,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, · 221 unmodified lines | |||
| 3056 | * This is needed because we never checked for invalid flags on | 3059 | * This is needed because we never checked for invalid flags on |
| 3057 | * TUNSETIFF. | 3060 | * TUNSETIFF. |
| 3058 | */ | 3061 | */ |
| 3059 | return put_user(IFF_TUN | IFF_TAP | TUN_FEATURES, | 3062 | return put_user(IFF_TUN | IFF_TAP | IFF_NO_CARRIER | |
| 3060 | (unsigned int __user*)argp); | 3063 | TUN_FEATURES, (unsigned int __user*)argp); |
| 3061 | } else if (cmd == TUNSETQUEUE) { | 3064 | } else if (cmd == TUNSETQUEUE) { |
| 3062 | return tun_set_queue(file, &ifr); | 3065 | return tun_set_queue(file, &ifr); |
| 3063 | } else if (cmd == SIOCGSKNS) { | 3066 | } else if (cmd == SIOCGSKNS) { |
| @@ -1402,6 +1402,7 @@ static const struct usb_device_id products[] = { · 1401 unmodified lines | |||
| 1402 | {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ | 1402 | {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ |
| 1403 | {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ | 1403 | {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ |
| 1404 | {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ | 1404 | {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ |
| 1405 | {QMI_FIXED_INTF(0x413c, 0x81c2, 8)}, /* Dell Wireless 5811e */ | ||
| 1405 | {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ | 1406 | {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ |
| 1406 | {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ | 1407 | {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ |
| 1407 | {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ | 1408 | {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ |
| @@ -1598,6 +1598,7 @@ void usbnet_disconnect (struct usb_interface *intf) · 1597 unmodified lines | |||
| 1598 | struct usbnet *dev; | 1598 | struct usbnet *dev; |
| 1599 | struct usb_device *xdev; | 1599 | struct usb_device *xdev; |
| 1600 | struct net_device *net; | 1600 | struct net_device *net; |
| 1601 | struct urb *urb; | ||
| 1601 | 1602 | ||
| 1602 | dev = usb_get_intfdata(intf); | 1603 | dev = usb_get_intfdata(intf); |
| 1603 | usb_set_intfdata(intf, NULL); | 1604 | usb_set_intfdata(intf, NULL); |
| @@ -1614,7 +1615,11 @@ void usbnet_disconnect (struct usb_interface *intf) · 10 unmodified lines | |||
| 1614 | net = dev->net; | 1615 | net = dev->net; |
| 1615 | unregister_netdev (net); | 1616 | unregister_netdev (net); |
| 1616 | 1617 | ||
| 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 | } | ||
| 1618 | 1623 | ||
| 1619 | if (dev->driver_info->unbind) | 1624 | if (dev->driver_info->unbind) |
| 1620 | dev->driver_info->unbind(dev, intf); | 1625 | dev->driver_info->unbind(dev, intf); |
| @@ -67,6 +67,8 @@ · 66 unmodified lines | |||
| 67 | #define IFF_TAP 0x0002 | 67 | #define IFF_TAP 0x0002 |
| 68 | #define IFF_NAPI 0x0010 | 68 | #define IFF_NAPI 0x0010 |
| 69 | #define IFF_NAPI_FRAGS 0x0020 | 69 | #define IFF_NAPI_FRAGS 0x0020 |
| 70 | /* Used in TUNSETIFF to bring up tun/tap without carrier */ | ||
| 71 | #define IFF_NO_CARRIER 0x0040 | ||
| 70 | #define IFF_NO_PI 0x1000 | 72 | #define IFF_NO_PI 0x1000 |
| 71 | /* This flag has no real effect */ | 73 | /* This flag has no real effect */ |
| 72 | #define IFF_ONE_QUEUE 0x2000 | 74 | #define IFF_ONE_QUEUE 0x2000 |
| @@ -4040,7 +4040,6 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link, · 4039 unmodified lines | |||
| 4040 | 4040 | ||
| 4041 | if (!(link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_HE) && | 4041 | if (!(link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_HE) && |
| 4042 | (!elems->he_cap || !elems->he_operation)) { | 4042 | (!elems->he_cap || !elems->he_operation)) { |
| 4043 | mutex_unlock(&sdata->local->sta_mtx); | ||
| 4044 | sdata_info(sdata, | 4043 | sdata_info(sdata, |
| 4045 | "HE AP is missing HE capability/operation\n"); | 4044 | "HE AP is missing HE capability/operation\n"); |
| 4046 | ret = false; | 4045 | ret = false; |
| @@ -5589,12 +5588,16 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link, · 1542 unmodified lines | |||
| 5589 | 5588 | ||
| 5590 | mutex_lock(&local->sta_mtx); | 5589 | mutex_lock(&local->sta_mtx); |
| 5591 | sta = sta_info_get(sdata, sdata->vif.cfg.ap_addr); | 5590 | 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); | ||
| 5593 | goto free; | 5593 | goto free; |
| 5594 | } | ||
| 5594 | link_sta = rcu_dereference_protected(sta->link[link->link_id], | 5595 | link_sta = rcu_dereference_protected(sta->link[link->link_id], |
| 5595 | lockdep_is_held(&local->sta_mtx)); | 5596 | lockdep_is_held(&local->sta_mtx)); |
| 5596 | if (WARN_ON(!link_sta)) | 5597 | if (WARN_ON(!link_sta)) { |
| 5598 | mutex_unlock(&local->sta_mtx); | ||
| 5597 | goto free; | 5599 | goto free; |
| 5600 | } | ||
| 5598 | 5601 | ||
| 5599 | changed |= ieee80211_recalc_twt_req(link, link_sta, elems); | 5602 | changed |= ieee80211_recalc_twt_req(link, link_sta, elems); |
| 5600 | 5603 | ||
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | #include <linux/random.h> | 10 | #include <linux/random.h> |
| 11 | #include <linux/moduleparam.h> | 11 | #include <linux/moduleparam.h> |
| 12 | #include <linux/ieee80211.h> | 12 | #include <linux/ieee80211.h> |
| 13 | #include <linux/minmax.h> | ||
| 13 | #include <net/mac80211.h> | 14 | #include <net/mac80211.h> |
| 14 | #include "rate.h" | 15 | #include "rate.h" |
| 15 | #include "sta_info.h" | 16 | #include "sta_info.h" |
| @@ -1550,6 +1551,7 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) · 1534 unmodified lines | |||
| 1550 | { | 1551 | { |
| 1551 | struct ieee80211_sta_rates *rates; | 1552 | struct ieee80211_sta_rates *rates; |
| 1552 | int i = 0; | 1553 | int i = 0; |
| 1554 | int max_rates = min_t(int, mp->hw->max_rates, IEEE80211_TX_RATE_TABLE_SIZE); | ||
| 1553 | 1555 | ||
| 1554 | rates = kzalloc(sizeof(*rates), GFP_ATOMIC); | 1556 | rates = kzalloc(sizeof(*rates), GFP_ATOMIC); |
| 1555 | if (!rates) | 1557 | if (!rates) |
| @@ -1559,10 +1561,10 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) · 3 unmodified lines | |||
| 1559 | minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_tp_rate[0]); | 1561 | minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_tp_rate[0]); |
| 1560 | 1562 | ||
| 1561 | /* Fill up remaining, keep one entry for max_probe_rate */ | 1563 | /* 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++) |
| 1563 | minstrel_ht_set_rate(mp, mi, rates, i, mi->max_tp_rate[i]); | 1565 | minstrel_ht_set_rate(mp, mi, rates, i, mi->max_tp_rate[i]); |
| 1564 | 1566 | ||
| 1565 | if (i < mp->hw->max_rates) | 1567 | if (i < max_rates) |
| 1566 | minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_prob_rate); | 1568 | minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_prob_rate); |
| 1567 | 1569 | ||
| 1568 | if (i < IEEE80211_TX_RATE_TABLE_SIZE) | 1570 | if (i < IEEE80211_TX_RATE_TABLE_SIZE) |
| @@ -729,7 +729,7 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local, · 728 unmodified lines | |||
| 729 | 729 | ||
| 730 | if (!sdata) { | 730 | if (!sdata) { |
| 731 | skb->dev = NULL; | 731 | skb->dev = NULL; |
| 732 | } else { | 732 | } else if (!dropped) { |
| 733 | unsigned int hdr_size = | 733 | unsigned int hdr_size = |
| 734 | ieee80211_hdrlen(hdr->frame_control); | 734 | ieee80211_hdrlen(hdr->frame_control); |
| 735 | 735 | ||
| @@ -5878,6 +5878,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, · 5877 unmodified lines | |||
| 5878 | skb_reset_network_header(skb); | 5878 | skb_reset_network_header(skb); |
| 5879 | skb_reset_mac_header(skb); | 5879 | skb_reset_mac_header(skb); |
| 5880 | 5880 | ||
| 5881 | if (local->hw.queues < IEEE80211_NUM_ACS) | ||
| 5882 | goto start_xmit; | ||
| 5883 | |||
| 5881 | /* update QoS header to prioritize control port frames if possible, | 5884 | /* update QoS header to prioritize control port frames if possible, |
| 5882 | * priorization also happens for control port frames send over | 5885 | * priorization also happens for control port frames send over |
| 5883 | * AF_PACKET | 5886 | * AF_PACKET |
| @@ -5905,6 +5908,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, · 21 unmodified lines | |||
| 5905 | } | 5908 | } |
| 5906 | rcu_read_unlock(); | 5909 | rcu_read_unlock(); |
| 5907 | 5910 | ||
| 5911 | start_xmit: | ||
| 5908 | /* mutex lock is only needed for incrementing the cookie counter */ | 5912 | /* mutex lock is only needed for incrementing the cookie counter */ |
| 5909 | mutex_lock(&local->mtx); | 5913 | mutex_lock(&local->mtx); |
| 5910 | 5914 | ||
| @@ -301,14 +301,14 @@ static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac) · 300 unmodified lines | |||
| 301 | local_bh_disable(); | 301 | local_bh_disable(); |
| 302 | spin_lock(&fq->lock); | 302 | spin_lock(&fq->lock); |
| 303 | 303 | ||
| 304 | sdata->vif.txqs_stopped[ac] = false; | ||
| 305 | |||
| 304 | if (!test_bit(SDATA_STATE_RUNNING, &sdata->state)) | 306 | if (!test_bit(SDATA_STATE_RUNNING, &sdata->state)) |
| 305 | goto out; | 307 | goto out; |
| 306 | 308 | ||
| 307 | if (sdata->vif.type == NL80211_IFTYPE_AP) | 309 | if (sdata->vif.type == NL80211_IFTYPE_AP) |
| 308 | ps = &sdata->bss->ps; | 310 | ps = &sdata->bss->ps; |
| 309 | 311 | ||
| 310 | sdata->vif.txqs_stopped[ac] = false; | ||
| 311 | |||
| 312 | list_for_each_entry_rcu(sta, &local->sta_list, list) { | 312 | list_for_each_entry_rcu(sta, &local->sta_list, list) { |
| 313 | if (sdata != sta->sdata) | 313 | if (sdata != sta->sdata) |
| 314 | continue; | 314 | continue; |
| @@ -2662,7 +2662,7 @@ static void __mptcp_clear_xmit(struct sock *sk) · 2661 unmodified lines | |||
| 2662 | dfrag_clear(sk, dfrag); | 2662 | dfrag_clear(sk, dfrag); |
| 2663 | } | 2663 | } |
| 2664 | 2664 | ||
| 2665 | static void mptcp_cancel_work(struct sock *sk) | 2665 | void mptcp_cancel_work(struct sock *sk) |
| 2666 | { | 2666 | { |
| 2667 | struct mptcp_sock *msk = mptcp_sk(sk); | 2667 | struct mptcp_sock *msk = mptcp_sk(sk); |
| 2668 | 2668 | ||
| @@ -2802,13 +2802,12 @@ static void __mptcp_destroy_sock(struct sock *sk) · 133 unmodified lines | |||
| 2802 | sock_put(sk); | 2802 | sock_put(sk); |
| 2803 | } | 2803 | } |
| 2804 | 2804 | ||
| 2805 | static void mptcp_close(struct sock *sk, long timeout) | 2805 | bool __mptcp_close(struct sock *sk, long timeout) |
| 2806 | { | 2806 | { |
| 2807 | struct mptcp_subflow_context *subflow; | 2807 | struct mptcp_subflow_context *subflow; |
| 2808 | struct mptcp_sock *msk = mptcp_sk(sk); | 2808 | struct mptcp_sock *msk = mptcp_sk(sk); |
| 2809 | bool do_cancel_work = false; | 2809 | bool do_cancel_work = false; |
| 2810 | 2810 | ||
| 2811 | lock_sock(sk); | ||
| 2812 | sk->sk_shutdown = SHUTDOWN_MASK; | 2811 | sk->sk_shutdown = SHUTDOWN_MASK; |
| 2813 | 2812 | ||
| 2814 | if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) { | 2813 | if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) { |
| @@ -2850,6 +2849,17 @@ cleanup: · 35 unmodified lines | |||
| 2850 | } else { | 2849 | } else { |
| 2851 | mptcp_reset_timeout(msk, 0); | 2850 | mptcp_reset_timeout(msk, 0); |
| 2852 | } | 2851 | } |
| 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); | ||
| 2853 | release_sock(sk); | 2863 | release_sock(sk); |
| 2854 | if (do_cancel_work) | 2864 | if (do_cancel_work) |
| 2855 | mptcp_cancel_work(sk); | 2865 | mptcp_cancel_work(sk); |
| @@ -612,6 +612,8 @@ void mptcp_subflow_reset(struct sock *ssk); · 611 unmodified lines | |||
| 612 | void mptcp_subflow_queue_clean(struct sock *ssk); | 612 | void mptcp_subflow_queue_clean(struct sock *ssk); |
| 613 | void mptcp_sock_graft(struct sock *sk, struct socket *parent); | 613 | void mptcp_sock_graft(struct sock *sk, struct socket *parent); |
| 614 | struct socket *__mptcp_nmpc_socket(const struct mptcp_sock *msk); | 614 | 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); | ||
| 615 | 617 | ||
| 616 | bool mptcp_addresses_equal(const struct mptcp_addr_info *a, | 618 | bool mptcp_addresses_equal(const struct mptcp_addr_info *a, |
| 617 | const struct mptcp_addr_info *b, bool use_port); | 619 | const struct mptcp_addr_info *b, bool use_port); |
| @@ -602,30 +602,6 @@ static bool subflow_hmac_valid(const struct request_sock *req, · 601 unmodified lines | |||
| 602 | return !crypto_memneq(hmac, mp_opt->hmac, MPTCPOPT_HMAC_LEN); | 602 | return !crypto_memneq(hmac, mp_opt->hmac, MPTCPOPT_HMAC_LEN); |
| 603 | } | 603 | } |
| 604 | 604 | ||
| 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 | |||
| 629 | static void mptcp_force_close(struct sock *sk) | 605 | static void mptcp_force_close(struct sock *sk) |
| 630 | { | 606 | { |
| 631 | /* the msk is not yet exposed to user-space */ | 607 | /* the msk is not yet exposed to user-space */ |
| @@ -768,7 +744,6 @@ create_child: · 136 unmodified lines | |||
| 768 | /* new mpc subflow takes ownership of the newly | 744 | /* new mpc subflow takes ownership of the newly |
| 769 | * created mptcp socket | 745 | * created mptcp socket |
| 770 | */ | 746 | */ |
| 771 | new_msk->sk_destruct = mptcp_sock_destruct; | ||
| 772 | mptcp_sk(new_msk)->setsockopt_seq = ctx->setsockopt_seq; | 747 | mptcp_sk(new_msk)->setsockopt_seq = ctx->setsockopt_seq; |
| 773 | mptcp_pm_new_connection(mptcp_sk(new_msk), child, 1); | 748 | mptcp_pm_new_connection(mptcp_sk(new_msk), child, 1); |
| 774 | mptcp_token_accept(subflow_req, mptcp_sk(new_msk)); | 749 | 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 | |||
| 1763 | 1738 | ||
| 1764 | for (msk = head; msk; msk = next) { | 1739 | for (msk = head; msk; msk = next) { |
| 1765 | struct sock *sk = (struct sock *)msk; | 1740 | struct sock *sk = (struct sock *)msk; |
| 1766 | bool slow; | 1741 | bool slow, do_cancel_work; |
| 1767 | 1742 | ||
| 1743 | sock_hold(sk); | ||
| 1768 | slow = lock_sock_fast_nested(sk); | 1744 | slow = lock_sock_fast_nested(sk); |
| 1769 | next = msk->dl_next; | 1745 | next = msk->dl_next; |
| 1770 | msk->first = NULL; | 1746 | msk->first = NULL; |
| 1771 | msk->dl_next = NULL; | 1747 | msk->dl_next = NULL; |
| 1748 | |||
| 1749 | do_cancel_work = __mptcp_close(sk, 0); | ||
| 1772 | unlock_sock_fast(sk, slow); | 1750 | unlock_sock_fast(sk, slow); |
| 1751 | if (do_cancel_work) | ||
| 1752 | mptcp_cancel_work(sk); | ||
| 1753 | sock_put(sk); | ||
| 1773 | } | 1754 | } |
| 1774 | 1755 | ||
| 1775 | /* we are still under the listener msk socket lock */ | 1756 | /* we are still under the listener msk socket lock */ |
| @@ -1394,7 +1394,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, · 1393 unmodified lines | |||
| 1394 | 1394 | ||
| 1395 | err = tcf_ct_flow_table_get(net, params); | 1395 | err = tcf_ct_flow_table_get(net, params); |
| 1396 | if (err) | 1396 | if (err) |
| 1397 | goto cleanup; | 1397 | goto cleanup_params; |
| 1398 | 1398 | ||
| 1399 | spin_lock_bh(&c->tcf_lock); | 1399 | spin_lock_bh(&c->tcf_lock); |
| 1400 | goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch); | 1400 | 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 | |||
| 1409 | 1409 | ||
| 1410 | return res; | 1410 | return res; |
| 1411 | 1411 | ||
| 1412 | cleanup_params: | ||
| 1413 | if (params->tmpl) | ||
| 1414 | nf_ct_put(params->tmpl); | ||
| 1412 | cleanup: | 1415 | cleanup: |
| 1413 | if (goto_ch) | 1416 | if (goto_ch) |
| 1414 | tcf_chain_put_by_act(goto_ch); | 1417 | tcf_chain_put_by_act(goto_ch); |
| @@ -1361,7 +1361,7 @@ static u32 cfg80211_calculate_bitrate_he(struct rate_info *rate) · 1360 unmodified lines | |||
| 1361 | 25599, /* 4.166666... */ | 1361 | 25599, /* 4.166666... */ |
| 1362 | 17067, /* 2.777777... */ | 1362 | 17067, /* 2.777777... */ |
| 1363 | 12801, /* 2.083333... */ | 1363 | 12801, /* 2.083333... */ |
| 1364 | 11769, /* 1.851851... */ | 1364 | 11377, /* 1.851725... */ |
| 1365 | 10239, /* 1.666666... */ | 1365 | 10239, /* 1.666666... */ |
| 1366 | 8532, /* 1.388888... */ | 1366 | 8532, /* 1.388888... */ |
| 1367 | 7680, /* 1.250000... */ | 1367 | 7680, /* 1.250000... */ |
| @@ -1444,7 +1444,7 @@ static u32 cfg80211_calculate_bitrate_eht(struct rate_info *rate) · 76 unmodified lines | |||
| 1444 | 25599, /* 4.166666... */ | 1444 | 25599, /* 4.166666... */ |
| 1445 | 17067, /* 2.777777... */ | 1445 | 17067, /* 2.777777... */ |
| 1446 | 12801, /* 2.083333... */ | 1446 | 12801, /* 2.083333... */ |
| 1447 | 11769, /* 1.851851... */ | 1447 | 11377, /* 1.851725... */ |
| 1448 | 10239, /* 1.666666... */ | 1448 | 10239, /* 1.666666... */ |
| 1449 | 8532, /* 1.388888... */ | 1449 | 8532, /* 1.388888... */ |
| 1450 | 7680, /* 1.250000... */ | 1450 | 7680, /* 1.250000... */ |
| @@ -328,7 +328,7 @@ static void test_extra_filter(const struct test_params p) · 327 unmodified lines | |||
| 328 | if (bind(fd1, addr, sockaddr_size())) | 328 | if (bind(fd1, addr, sockaddr_size())) |
| 329 | error(1, errno, "failed to bind recv socket 1"); | 329 | error(1, errno, "failed to bind recv socket 1"); |
| 330 | 330 | ||
| 331 | if (!bind(fd2, addr, sockaddr_size()) && errno != EADDRINUSE) | 331 | if (!bind(fd2, addr, sockaddr_size()) || errno != EADDRINUSE) |
| 332 | error(1, errno, "bind socket 2 should fail with EADDRINUSE"); | 332 | error(1, errno, "bind socket 2 should fail with EADDRINUSE"); |
| 333 | 333 | ||
| 334 | free(addr); | 334 | free(addr); |