Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull networking fixes from Jakub Kicinski:
"Networking fixes, including fixes from bpf, wireless and mac80211
trees.

Current release - regressions:

- tipc: call tipc_wait_for_connect only when dlen is not 0

- mac80211: fix locking in ieee80211_restart_work()

Current release - new code bugs:

- bpf: add rcu_read_lock in bpf_get_current_[ancestor_]cgroup_id()

- ethernet: ice: fix perout start time rounding

- wwan: iosm: prevent underflow in ipc_chnl_cfg_get()

Previous releases - regressions:

- bpf: clear zext_dst of dead insns

- sch_cake: fix srchost/dsthost hashing mode

- vrf: reset skb conntrack connection on VRF rcv

- net/rds: dma_map_sg is entitled to merge entries

Previous releases - always broken:

- ethernet: bnxt: fix Tx path locking and races, add Rx path
barriers"

* tag 'net-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (42 commits)
net: dpaa2-switch: disable the control interface on error path
Revert "flow_offload: action should not be NULL when it is referenced"
iavf: Fix ping is lost after untrusted VF had tried to change MAC
i40e: Fix ATR queue selection
r8152: fix the maximum number of PLA bp for RTL8153C
r8152: fix writing USB_BP2_EN
mptcp: full fully established support after ADD_ADDR
mptcp: fix memory leak on address flush
net/rds: dma_map_sg is entitled to merge entries
net: mscc: ocelot: allow forwarding from bridge ports to the tag_8021q CPU port
net: asix: fix uninit value bugs
ovs: clear skb->tstamp in forwarding path
net: mdio-mux: Handle -EPROBE_DEFER correctly
net: mdio-mux: Don't ignore memory allocation errors
net: mdio-mux: Delete unnecessary devm_kfree
net: dsa: sja1105: fix use-after-free after calling of_find_compatible_node, or worse
sch_cake: fix srchost/dsthost hashing mode
ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path
net: qlcnic: add missed unlock in qlcnic_83xx_flash_read32
mac80211: fix locking in ieee80211_restart_work()
...

+419 -207
+2 -4
drivers/net/dsa/sja1105/sja1105_mdio.c
··· 284 284 struct mii_bus *bus; 285 285 int rc = 0; 286 286 287 - np = of_find_compatible_node(mdio_node, NULL, 288 - "nxp,sja1110-base-tx-mdio"); 287 + np = of_get_compatible_child(mdio_node, "nxp,sja1110-base-tx-mdio"); 289 288 if (!np) 290 289 return 0; 291 290 ··· 338 339 struct mii_bus *bus; 339 340 int rc = 0; 340 341 341 - np = of_find_compatible_node(mdio_node, NULL, 342 - "nxp,sja1110-base-t1-mdio"); 342 + np = of_get_compatible_child(mdio_node, "nxp,sja1110-base-t1-mdio"); 343 343 if (!np) 344 344 return 0; 345 345
+76 -37
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 72 72 #include "bnxt_debugfs.h" 73 73 74 74 #define BNXT_TX_TIMEOUT (5 * HZ) 75 - #define BNXT_DEF_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_HW) 75 + #define BNXT_DEF_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_HW | \ 76 + NETIF_MSG_TX_ERR) 76 77 77 78 MODULE_LICENSE("GPL"); 78 79 MODULE_DESCRIPTION("Broadcom BCM573xx network driver"); ··· 366 365 return md_dst->u.port_info.port_id; 367 366 } 368 367 368 + static void bnxt_txr_db_kick(struct bnxt *bp, struct bnxt_tx_ring_info *txr, 369 + u16 prod) 370 + { 371 + bnxt_db_write(bp, &txr->tx_db, prod); 372 + txr->kick_pending = 0; 373 + } 374 + 375 + static bool bnxt_txr_netif_try_stop_queue(struct bnxt *bp, 376 + struct bnxt_tx_ring_info *txr, 377 + struct netdev_queue *txq) 378 + { 379 + netif_tx_stop_queue(txq); 380 + 381 + /* netif_tx_stop_queue() must be done before checking 382 + * tx index in bnxt_tx_avail() below, because in 383 + * bnxt_tx_int(), we update tx index before checking for 384 + * netif_tx_queue_stopped(). 385 + */ 386 + smp_mb(); 387 + if (bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh) { 388 + netif_tx_wake_queue(txq); 389 + return false; 390 + } 391 + 392 + return true; 393 + } 394 + 369 395 static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) 370 396 { 371 397 struct bnxt *bp = netdev_priv(dev); ··· 412 384 i = skb_get_queue_mapping(skb); 413 385 if (unlikely(i >= bp->tx_nr_rings)) { 414 386 dev_kfree_skb_any(skb); 387 + atomic_long_inc(&dev->tx_dropped); 415 388 return NETDEV_TX_OK; 416 389 } 417 390 ··· 422 393 423 394 free_size = bnxt_tx_avail(bp, txr); 424 395 if (unlikely(free_size < skb_shinfo(skb)->nr_frags + 2)) { 425 - netif_tx_stop_queue(txq); 426 - return NETDEV_TX_BUSY; 396 + /* We must have raced with NAPI cleanup */ 397 + if (net_ratelimit() && txr->kick_pending) 398 + netif_warn(bp, tx_err, dev, 399 + "bnxt: ring busy w/ flush pending!\n"); 400 + if (bnxt_txr_netif_try_stop_queue(bp, txr, txq)) 401 + return NETDEV_TX_BUSY; 427 402 } 428 403 429 404 length = skb->len; ··· 550 517 normal_tx: 551 518 if (length < BNXT_MIN_PKT_SIZE) { 552 519 pad = BNXT_MIN_PKT_SIZE - length; 553 - if (skb_pad(skb, pad)) { 520 + if (skb_pad(skb, pad)) 554 521 /* SKB already freed. */ 555 - tx_buf->skb = NULL; 556 - return NETDEV_TX_OK; 557 - } 522 + goto tx_kick_pending; 558 523 length = BNXT_MIN_PKT_SIZE; 559 524 } 560 525 561 526 mapping = dma_map_single(&pdev->dev, skb->data, len, DMA_TO_DEVICE); 562 527 563 - if (unlikely(dma_mapping_error(&pdev->dev, mapping))) { 564 - dev_kfree_skb_any(skb); 565 - tx_buf->skb = NULL; 566 - return NETDEV_TX_OK; 567 - } 528 + if (unlikely(dma_mapping_error(&pdev->dev, mapping))) 529 + goto tx_free; 568 530 569 531 dma_unmap_addr_set(tx_buf, mapping, mapping); 570 532 flags = (len << TX_BD_LEN_SHIFT) | TX_BD_TYPE_LONG_TX_BD | ··· 646 618 txr->tx_prod = prod; 647 619 648 620 if (!netdev_xmit_more() || netif_xmit_stopped(txq)) 649 - bnxt_db_write(bp, &txr->tx_db, prod); 621 + bnxt_txr_db_kick(bp, txr, prod); 622 + else 623 + txr->kick_pending = 1; 650 624 651 625 tx_done: 652 626 653 627 if (unlikely(bnxt_tx_avail(bp, txr) <= MAX_SKB_FRAGS + 1)) { 654 628 if (netdev_xmit_more() && !tx_buf->is_push) 655 - bnxt_db_write(bp, &txr->tx_db, prod); 629 + bnxt_txr_db_kick(bp, txr, prod); 656 630 657 - netif_tx_stop_queue(txq); 658 - 659 - /* netif_tx_stop_queue() must be done before checking 660 - * tx index in bnxt_tx_avail() below, because in 661 - * bnxt_tx_int(), we update tx index before checking for 662 - * netif_tx_queue_stopped(). 663 - */ 664 - smp_mb(); 665 - if (bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh) 666 - netif_tx_wake_queue(txq); 631 + bnxt_txr_netif_try_stop_queue(bp, txr, txq); 667 632 } 668 633 return NETDEV_TX_OK; 669 634 ··· 669 648 /* start back at beginning and unmap skb */ 670 649 prod = txr->tx_prod; 671 650 tx_buf = &txr->tx_buf_ring[prod]; 672 - tx_buf->skb = NULL; 673 651 dma_unmap_single(&pdev->dev, dma_unmap_addr(tx_buf, mapping), 674 652 skb_headlen(skb), PCI_DMA_TODEVICE); 675 653 prod = NEXT_TX(prod); ··· 682 662 PCI_DMA_TODEVICE); 683 663 } 684 664 665 + tx_free: 685 666 dev_kfree_skb_any(skb); 667 + tx_kick_pending: 668 + if (txr->kick_pending) 669 + bnxt_txr_db_kick(bp, txr, txr->tx_prod); 670 + txr->tx_buf_ring[txr->tx_prod].skb = NULL; 671 + atomic_long_inc(&dev->tx_dropped); 686 672 return NETDEV_TX_OK; 687 673 } 688 674 ··· 758 732 smp_mb(); 759 733 760 734 if (unlikely(netif_tx_queue_stopped(txq)) && 761 - (bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh)) { 762 - __netif_tx_lock(txq, smp_processor_id()); 763 - if (netif_tx_queue_stopped(txq) && 764 - bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh && 765 - txr->dev_state != BNXT_DEV_STATE_CLOSING) 766 - netif_tx_wake_queue(txq); 767 - __netif_tx_unlock(txq); 768 - } 735 + bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh && 736 + READ_ONCE(txr->dev_state) != BNXT_DEV_STATE_CLOSING) 737 + netif_tx_wake_queue(txq); 769 738 } 770 739 771 740 static struct page *__bnxt_alloc_rx_page(struct bnxt *bp, dma_addr_t *mapping, ··· 1788 1767 if (!RX_CMP_VALID(rxcmp1, tmp_raw_cons)) 1789 1768 return -EBUSY; 1790 1769 1770 + /* The valid test of the entry must be done first before 1771 + * reading any further. 1772 + */ 1773 + dma_rmb(); 1791 1774 prod = rxr->rx_prod; 1792 1775 1793 1776 if (cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP) { ··· 2014 1989 if (!RX_CMP_VALID(rxcmp1, tmp_raw_cons)) 2015 1990 return -EBUSY; 2016 1991 1992 + /* The valid test of the entry must be done first before 1993 + * reading any further. 1994 + */ 1995 + dma_rmb(); 2017 1996 cmp_type = RX_CMP_TYPE(rxcmp); 2018 1997 if (cmp_type == CMP_TYPE_RX_L2_CMP) { 2019 1998 rxcmp1->rx_cmp_cfa_code_errors_v2 |= ··· 2483 2454 if (!TX_CMP_VALID(txcmp, raw_cons)) 2484 2455 break; 2485 2456 2457 + /* The valid test of the entry must be done first before 2458 + * reading any further. 2459 + */ 2460 + dma_rmb(); 2486 2461 if ((TX_CMP_TYPE(txcmp) & 0x30) == 0x10) { 2487 2462 tmp_raw_cons = NEXT_RAW_CMP(raw_cons); 2488 2463 cp_cons = RING_CMP(tmp_raw_cons); ··· 9161 9128 for (i = 0; i < bp->cp_nr_rings; i++) { 9162 9129 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; 9163 9130 9131 + napi_disable(&bp->bnapi[i]->napi); 9164 9132 if (bp->bnapi[i]->rx_ring) 9165 9133 cancel_work_sync(&cpr->dim.work); 9166 - 9167 - napi_disable(&bp->bnapi[i]->napi); 9168 9134 } 9169 9135 } 9170 9136 ··· 9197 9165 if (bp->tx_ring) { 9198 9166 for (i = 0; i < bp->tx_nr_rings; i++) { 9199 9167 txr = &bp->tx_ring[i]; 9200 - txr->dev_state = BNXT_DEV_STATE_CLOSING; 9168 + WRITE_ONCE(txr->dev_state, BNXT_DEV_STATE_CLOSING); 9201 9169 } 9202 9170 } 9171 + /* Make sure napi polls see @dev_state change */ 9172 + synchronize_net(); 9203 9173 /* Drop carrier first to prevent TX timeout */ 9204 9174 netif_carrier_off(bp->dev); 9205 9175 /* Stop all TX queues */ ··· 9215 9181 9216 9182 for (i = 0; i < bp->tx_nr_rings; i++) { 9217 9183 txr = &bp->tx_ring[i]; 9218 - txr->dev_state = 0; 9184 + WRITE_ONCE(txr->dev_state, 0); 9219 9185 } 9186 + /* Make sure napi polls see @dev_state change */ 9187 + synchronize_net(); 9220 9188 netif_tx_wake_all_queues(bp->dev); 9221 9189 if (bp->link_info.link_up) 9222 9190 netif_carrier_on(bp->dev); ··· 10804 10768 return true; 10805 10769 return false; 10806 10770 } 10771 + /* 212 firmware is broken for aRFS */ 10772 + if (BNXT_FW_MAJ(bp) == 212) 10773 + return false; 10807 10774 if (BNXT_PF(bp) && !BNXT_CHIP_TYPE_NITRO_A0(bp)) 10808 10775 return true; 10809 10776 if (bp->flags & BNXT_FLAG_NEW_RSS_CAP)
+1
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 786 786 u16 tx_prod; 787 787 u16 tx_cons; 788 788 u16 txq_index; 789 + u8 kick_pending; 789 790 struct bnxt_db_info tx_db; 790 791 791 792 struct tx_bd *tx_desc_ring[MAX_TX_PAGES];
+19 -19
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
··· 3038 3038 return err; 3039 3039 } 3040 3040 3041 - static void dpaa2_switch_takedown(struct fsl_mc_device *sw_dev) 3042 - { 3043 - struct device *dev = &sw_dev->dev; 3044 - struct ethsw_core *ethsw = dev_get_drvdata(dev); 3045 - int err; 3046 - 3047 - err = dpsw_close(ethsw->mc_io, 0, ethsw->dpsw_handle); 3048 - if (err) 3049 - dev_warn(dev, "dpsw_close err %d\n", err); 3050 - } 3051 - 3052 3041 static void dpaa2_switch_ctrl_if_teardown(struct ethsw_core *ethsw) 3053 3042 { 3054 3043 dpsw_ctrl_if_disable(ethsw->mc_io, 0, ethsw->dpsw_handle); ··· 3045 3056 dpaa2_switch_destroy_rings(ethsw); 3046 3057 dpaa2_switch_drain_bp(ethsw); 3047 3058 dpaa2_switch_free_dpbp(ethsw); 3059 + } 3060 + 3061 + static void dpaa2_switch_teardown(struct fsl_mc_device *sw_dev) 3062 + { 3063 + struct device *dev = &sw_dev->dev; 3064 + struct ethsw_core *ethsw = dev_get_drvdata(dev); 3065 + int err; 3066 + 3067 + dpaa2_switch_ctrl_if_teardown(ethsw); 3068 + 3069 + destroy_workqueue(ethsw->workqueue); 3070 + 3071 + err = dpsw_close(ethsw->mc_io, 0, ethsw->dpsw_handle); 3072 + if (err) 3073 + dev_warn(dev, "dpsw_close err %d\n", err); 3048 3074 } 3049 3075 3050 3076 static int dpaa2_switch_remove(struct fsl_mc_device *sw_dev) ··· 3071 3067 3072 3068 dev = &sw_dev->dev; 3073 3069 ethsw = dev_get_drvdata(dev); 3074 - 3075 - dpaa2_switch_ctrl_if_teardown(ethsw); 3076 3070 3077 3071 dpaa2_switch_teardown_irqs(sw_dev); 3078 3072 ··· 3086 3084 kfree(ethsw->acls); 3087 3085 kfree(ethsw->ports); 3088 3086 3089 - dpaa2_switch_takedown(sw_dev); 3090 - 3091 - destroy_workqueue(ethsw->workqueue); 3087 + dpaa2_switch_teardown(sw_dev); 3092 3088 3093 3089 fsl_mc_portal_free(ethsw->mc_io); 3094 3090 ··· 3199 3199 GFP_KERNEL); 3200 3200 if (!(ethsw->ports)) { 3201 3201 err = -ENOMEM; 3202 - goto err_takedown; 3202 + goto err_teardown; 3203 3203 } 3204 3204 3205 3205 ethsw->fdbs = kcalloc(ethsw->sw_attr.num_ifs, sizeof(*ethsw->fdbs), ··· 3270 3270 err_free_ports: 3271 3271 kfree(ethsw->ports); 3272 3272 3273 - err_takedown: 3274 - dpaa2_switch_takedown(sw_dev); 3273 + err_teardown: 3274 + dpaa2_switch_teardown(sw_dev); 3275 3275 3276 3276 err_free_cmdport: 3277 3277 fsl_mc_portal_free(ethsw->mc_io);
+1 -2
drivers/net/ethernet/intel/i40e/i40e_txrx.c
··· 3663 3663 3664 3664 /* is DCB enabled at all? */ 3665 3665 if (vsi->tc_config.numtc == 1) 3666 - return i40e_swdcb_skb_tx_hash(netdev, skb, 3667 - netdev->real_num_tx_queues); 3666 + return netdev_pick_tx(netdev, skb, sb_dev); 3668 3667 3669 3668 prio = skb->priority; 3670 3669 hw = &vsi->back->hw;
+1
drivers/net/ethernet/intel/iavf/iavf.h
··· 136 136 struct iavf_mac_filter { 137 137 struct list_head list; 138 138 u8 macaddr[ETH_ALEN]; 139 + bool is_new_mac; /* filter is new, wait for PF decision */ 139 140 bool remove; /* filter needs to be removed */ 140 141 bool add; /* filter needs to be added */ 141 142 };
+1
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 751 751 752 752 list_add_tail(&f->list, &adapter->mac_filter_list); 753 753 f->add = true; 754 + f->is_new_mac = true; 754 755 adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER; 755 756 } else { 756 757 f->remove = false;
+45 -2
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
··· 541 541 } 542 542 543 543 /** 544 + * iavf_mac_add_ok 545 + * @adapter: adapter structure 546 + * 547 + * Submit list of filters based on PF response. 548 + **/ 549 + static void iavf_mac_add_ok(struct iavf_adapter *adapter) 550 + { 551 + struct iavf_mac_filter *f, *ftmp; 552 + 553 + spin_lock_bh(&adapter->mac_vlan_list_lock); 554 + list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { 555 + f->is_new_mac = false; 556 + } 557 + spin_unlock_bh(&adapter->mac_vlan_list_lock); 558 + } 559 + 560 + /** 561 + * iavf_mac_add_reject 562 + * @adapter: adapter structure 563 + * 564 + * Remove filters from list based on PF response. 565 + **/ 566 + static void iavf_mac_add_reject(struct iavf_adapter *adapter) 567 + { 568 + struct net_device *netdev = adapter->netdev; 569 + struct iavf_mac_filter *f, *ftmp; 570 + 571 + spin_lock_bh(&adapter->mac_vlan_list_lock); 572 + list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { 573 + if (f->remove && ether_addr_equal(f->macaddr, netdev->dev_addr)) 574 + f->remove = false; 575 + 576 + if (f->is_new_mac) { 577 + list_del(&f->list); 578 + kfree(f); 579 + } 580 + } 581 + spin_unlock_bh(&adapter->mac_vlan_list_lock); 582 + } 583 + 584 + /** 544 585 * iavf_add_vlans 545 586 * @adapter: adapter structure 546 587 * ··· 1533 1492 case VIRTCHNL_OP_ADD_ETH_ADDR: 1534 1493 dev_err(&adapter->pdev->dev, "Failed to add MAC filter, error %s\n", 1535 1494 iavf_stat_str(&adapter->hw, v_retval)); 1495 + iavf_mac_add_reject(adapter); 1536 1496 /* restore administratively set MAC address */ 1537 1497 ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr); 1538 1498 break; ··· 1681 1639 } 1682 1640 } 1683 1641 switch (v_opcode) { 1684 - case VIRTCHNL_OP_ADD_ETH_ADDR: { 1642 + case VIRTCHNL_OP_ADD_ETH_ADDR: 1643 + if (!v_retval) 1644 + iavf_mac_add_ok(adapter); 1685 1645 if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr)) 1686 1646 ether_addr_copy(netdev->dev_addr, adapter->hw.mac.addr); 1687 - } 1688 1647 break; 1689 1648 case VIRTCHNL_OP_GET_STATS: { 1690 1649 struct iavf_eth_stats *stats =
+1 -1
drivers/net/ethernet/intel/ice/ice_ptp.c
··· 656 656 * maintaining phase 657 657 */ 658 658 if (start_time < current_time) 659 - start_time = div64_u64(current_time + NSEC_PER_MSEC - 1, 659 + start_time = div64_u64(current_time + NSEC_PER_SEC - 1, 660 660 NSEC_PER_SEC) * NSEC_PER_SEC + phase; 661 661 662 662 start_time -= E810_OUT_PROP_DELAY_NS;
+4 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
··· 52 52 53 53 /* Kick start the NAPI context so that receiving will start */ 54 54 err = ixgbe_xsk_wakeup(adapter->netdev, qid, XDP_WAKEUP_RX); 55 - if (err) 55 + if (err) { 56 + clear_bit(qid, adapter->af_xdp_zc_qps); 57 + xsk_pool_dma_unmap(pool, IXGBE_RX_DMA_ATTR); 56 58 return err; 59 + } 57 60 } 58 61 59 62 return 0;
+1
drivers/net/ethernet/mscc/ocelot.c
··· 1334 1334 struct net_device *bond = ocelot_port->bond; 1335 1335 1336 1336 mask = ocelot_get_bridge_fwd_mask(ocelot, bridge); 1337 + mask |= cpu_fwd_mask; 1337 1338 mask &= ~BIT(port); 1338 1339 if (bond) { 1339 1340 mask &= ~ocelot_get_bond_mask(ocelot, bond,
+20
drivers/net/ethernet/qlogic/qed/qed_ll2.c
··· 327 327 unsigned long flags; 328 328 int rc = -EINVAL; 329 329 330 + if (!p_ll2_conn) 331 + return rc; 332 + 330 333 spin_lock_irqsave(&p_tx->lock, flags); 331 334 if (p_tx->b_completing_packet) { 332 335 rc = -EBUSY; ··· 503 500 unsigned long flags = 0; 504 501 int rc = 0; 505 502 503 + if (!p_ll2_conn) 504 + return rc; 505 + 506 506 spin_lock_irqsave(&p_rx->lock, flags); 507 + 508 + if (!QED_LL2_RX_REGISTERED(p_ll2_conn)) { 509 + spin_unlock_irqrestore(&p_rx->lock, flags); 510 + return 0; 511 + } 512 + 507 513 cq_new_idx = le16_to_cpu(*p_rx->p_fw_cons); 508 514 cq_old_idx = qed_chain_get_cons_idx(&p_rx->rcq_chain); 509 515 ··· 833 821 struct qed_ll2_info *p_ll2_conn = (struct qed_ll2_info *)p_cookie; 834 822 int rc; 835 823 824 + if (!p_ll2_conn) 825 + return 0; 826 + 836 827 if (!QED_LL2_RX_REGISTERED(p_ll2_conn)) 837 828 return 0; 838 829 ··· 858 843 bool b_dont_submit_rx = false; 859 844 u16 new_idx = 0, num_bds = 0; 860 845 int rc; 846 + 847 + if (!p_ll2_conn) 848 + return 0; 861 849 862 850 if (!QED_LL2_TX_REGISTERED(p_ll2_conn)) 863 851 return 0; ··· 1746 1728 if (!p_ll2_conn) 1747 1729 return -EINVAL; 1748 1730 p_rx = &p_ll2_conn->rx_queue; 1731 + if (!p_rx->set_prod_addr) 1732 + return -EIO; 1749 1733 1750 1734 spin_lock_irqsave(&p_rx->lock, flags); 1751 1735 if (!list_empty(&p_rx->free_descq))
+1 -2
drivers/net/ethernet/qlogic/qed/qed_rdma.c
··· 1285 1285 1286 1286 if (!rdma_cxt || !in_params || !out_params || 1287 1287 !p_hwfn->p_rdma_info->active) { 1288 - DP_ERR(p_hwfn->cdev, 1289 - "qed roce create qp failed due to NULL entry (rdma_cxt=%p, in=%p, out=%p, roce_info=?\n", 1288 + pr_err("qed roce create qp failed due to NULL entry (rdma_cxt=%p, in=%p, out=%p, roce_info=?\n", 1290 1289 rdma_cxt, in_params, out_params); 1291 1290 return NULL; 1292 1291 }
+3 -1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
··· 3156 3156 3157 3157 indirect_addr = QLC_83XX_FLASH_DIRECT_DATA(addr); 3158 3158 ret = QLCRD32(adapter, indirect_addr, &err); 3159 - if (err == -EIO) 3159 + if (err == -EIO) { 3160 + qlcnic_83xx_unlock_flash(adapter); 3160 3161 return err; 3162 + } 3161 3163 3162 3164 word = ret; 3163 3165 *(u32 *)p_data = word;
+6
drivers/net/hamradio/6pack.c
··· 827 827 return; 828 828 } 829 829 830 + if (sp->rx_count_cooked + 2 >= sizeof(sp->cooked_buf)) { 831 + pr_err("6pack: cooked buffer overrun, data loss\n"); 832 + sp->rx_count = 0; 833 + return; 834 + } 835 + 830 836 buf = sp->raw_buf; 831 837 sp->cooked_buf[sp->rx_count_cooked++] = 832 838 buf[0] | ((buf[1] << 2) & 0xc0);
+24 -13
drivers/net/mdio/mdio-mux.c
··· 82 82 83 83 static int parent_count; 84 84 85 + static void mdio_mux_uninit_children(struct mdio_mux_parent_bus *pb) 86 + { 87 + struct mdio_mux_child_bus *cb = pb->children; 88 + 89 + while (cb) { 90 + mdiobus_unregister(cb->mii_bus); 91 + mdiobus_free(cb->mii_bus); 92 + cb = cb->next; 93 + } 94 + } 95 + 85 96 int mdio_mux_init(struct device *dev, 86 97 struct device_node *mux_node, 87 98 int (*switch_fn)(int cur, int desired, void *data), ··· 155 144 cb = devm_kzalloc(dev, sizeof(*cb), GFP_KERNEL); 156 145 if (!cb) { 157 146 ret_val = -ENOMEM; 158 - continue; 147 + goto err_loop; 159 148 } 160 149 cb->bus_number = v; 161 150 cb->parent = pb; ··· 163 152 cb->mii_bus = mdiobus_alloc(); 164 153 if (!cb->mii_bus) { 165 154 ret_val = -ENOMEM; 166 - devm_kfree(dev, cb); 167 - continue; 155 + goto err_loop; 168 156 } 169 157 cb->mii_bus->priv = cb; 170 158 ··· 175 165 cb->mii_bus->write = mdio_mux_write; 176 166 r = of_mdiobus_register(cb->mii_bus, child_bus_node); 177 167 if (r) { 168 + mdiobus_free(cb->mii_bus); 169 + if (r == -EPROBE_DEFER) { 170 + ret_val = r; 171 + goto err_loop; 172 + } 173 + devm_kfree(dev, cb); 178 174 dev_err(dev, 179 175 "Error: Failed to register MDIO bus for child %pOF\n", 180 176 child_bus_node); 181 - mdiobus_free(cb->mii_bus); 182 - devm_kfree(dev, cb); 183 177 } else { 184 178 cb->next = pb->children; 185 179 pb->children = cb; ··· 195 181 } 196 182 197 183 dev_err(dev, "Error: No acceptable child buses found\n"); 198 - devm_kfree(dev, pb); 184 + 185 + err_loop: 186 + mdio_mux_uninit_children(pb); 187 + of_node_put(child_bus_node); 199 188 err_pb_kz: 200 189 put_device(&parent_bus->dev); 201 190 err_parent_bus: ··· 210 193 void mdio_mux_uninit(void *mux_handle) 211 194 { 212 195 struct mdio_mux_parent_bus *pb = mux_handle; 213 - struct mdio_mux_child_bus *cb = pb->children; 214 196 215 - while (cb) { 216 - mdiobus_unregister(cb->mii_bus); 217 - mdiobus_free(cb->mii_bus); 218 - cb = cb->next; 219 - } 220 - 197 + mdio_mux_uninit_children(pb); 221 198 put_device(&pb->mii_bus->dev); 222 199 } 223 200 EXPORT_SYMBOL_GPL(mdio_mux_uninit);
+30 -40
drivers/net/usb/asix_common.c
··· 63 63 value, index, data, size); 64 64 } 65 65 66 + static int asix_check_host_enable(struct usbnet *dev, int in_pm) 67 + { 68 + int i, ret; 69 + u8 smsr; 70 + 71 + for (i = 0; i < 30; ++i) { 72 + ret = asix_set_sw_mii(dev, in_pm); 73 + if (ret == -ENODEV || ret == -ETIMEDOUT) 74 + break; 75 + usleep_range(1000, 1100); 76 + ret = asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 77 + 0, 0, 1, &smsr, in_pm); 78 + if (ret == -ENODEV) 79 + break; 80 + else if (ret < 0) 81 + continue; 82 + else if (smsr & AX_HOST_EN) 83 + break; 84 + } 85 + 86 + return ret; 87 + } 88 + 66 89 static void reset_asix_rx_fixup_info(struct asix_rx_fixup_info *rx) 67 90 { 68 91 /* Reset the variables that have a lifetime outside of ··· 490 467 { 491 468 struct usbnet *dev = netdev_priv(netdev); 492 469 __le16 res; 493 - u8 smsr; 494 - int i = 0; 495 470 int ret; 496 471 497 472 mutex_lock(&dev->phy_mutex); 498 - do { 499 - ret = asix_set_sw_mii(dev, 0); 500 - if (ret == -ENODEV || ret == -ETIMEDOUT) 501 - break; 502 - usleep_range(1000, 1100); 503 - ret = asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 504 - 0, 0, 1, &smsr, 0); 505 - } while (!(smsr & AX_HOST_EN) && (i++ < 30) && (ret != -ENODEV)); 473 + 474 + ret = asix_check_host_enable(dev, 0); 506 475 if (ret == -ENODEV || ret == -ETIMEDOUT) { 507 476 mutex_unlock(&dev->phy_mutex); 508 477 return ret; ··· 520 505 { 521 506 struct usbnet *dev = netdev_priv(netdev); 522 507 __le16 res = cpu_to_le16(val); 523 - u8 smsr; 524 - int i = 0; 525 508 int ret; 526 509 527 510 netdev_dbg(dev->net, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n", 528 511 phy_id, loc, val); 529 512 530 513 mutex_lock(&dev->phy_mutex); 531 - do { 532 - ret = asix_set_sw_mii(dev, 0); 533 - if (ret == -ENODEV) 534 - break; 535 - usleep_range(1000, 1100); 536 - ret = asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 537 - 0, 0, 1, &smsr, 0); 538 - } while (!(smsr & AX_HOST_EN) && (i++ < 30) && (ret != -ENODEV)); 539 514 515 + ret = asix_check_host_enable(dev, 0); 540 516 if (ret == -ENODEV) 541 517 goto out; 542 518 ··· 567 561 { 568 562 struct usbnet *dev = netdev_priv(netdev); 569 563 __le16 res; 570 - u8 smsr; 571 - int i = 0; 572 564 int ret; 573 565 574 566 mutex_lock(&dev->phy_mutex); 575 - do { 576 - ret = asix_set_sw_mii(dev, 1); 577 - if (ret == -ENODEV || ret == -ETIMEDOUT) 578 - break; 579 - usleep_range(1000, 1100); 580 - ret = asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 581 - 0, 0, 1, &smsr, 1); 582 - } while (!(smsr & AX_HOST_EN) && (i++ < 30) && (ret != -ENODEV)); 567 + 568 + ret = asix_check_host_enable(dev, 1); 583 569 if (ret == -ENODEV || ret == -ETIMEDOUT) { 584 570 mutex_unlock(&dev->phy_mutex); 585 571 return ret; ··· 593 595 { 594 596 struct usbnet *dev = netdev_priv(netdev); 595 597 __le16 res = cpu_to_le16(val); 596 - u8 smsr; 597 - int i = 0; 598 598 int ret; 599 599 600 600 netdev_dbg(dev->net, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n", 601 601 phy_id, loc, val); 602 602 603 603 mutex_lock(&dev->phy_mutex); 604 - do { 605 - ret = asix_set_sw_mii(dev, 1); 606 - if (ret == -ENODEV) 607 - break; 608 - usleep_range(1000, 1100); 609 - ret = asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 610 - 0, 0, 1, &smsr, 1); 611 - } while (!(smsr & AX_HOST_EN) && (i++ < 30) && (ret != -ENODEV)); 604 + 605 + ret = asix_check_host_enable(dev, 1); 612 606 if (ret == -ENODEV) { 613 607 mutex_unlock(&dev->phy_mutex); 614 608 return;
+20 -3
drivers/net/usb/r8152.c
··· 3955 3955 case RTL_VER_06: 3956 3956 ocp_write_byte(tp, type, PLA_BP_EN, 0); 3957 3957 break; 3958 + case RTL_VER_14: 3959 + ocp_write_word(tp, type, USB_BP2_EN, 0); 3960 + 3961 + ocp_write_word(tp, type, USB_BP_8, 0); 3962 + ocp_write_word(tp, type, USB_BP_9, 0); 3963 + ocp_write_word(tp, type, USB_BP_10, 0); 3964 + ocp_write_word(tp, type, USB_BP_11, 0); 3965 + ocp_write_word(tp, type, USB_BP_12, 0); 3966 + ocp_write_word(tp, type, USB_BP_13, 0); 3967 + ocp_write_word(tp, type, USB_BP_14, 0); 3968 + ocp_write_word(tp, type, USB_BP_15, 0); 3969 + break; 3958 3970 case RTL_VER_08: 3959 3971 case RTL_VER_09: 3960 3972 case RTL_VER_10: 3961 3973 case RTL_VER_11: 3962 3974 case RTL_VER_12: 3963 3975 case RTL_VER_13: 3964 - case RTL_VER_14: 3965 3976 case RTL_VER_15: 3966 3977 default: 3967 3978 if (type == MCU_TYPE_USB) { 3968 - ocp_write_byte(tp, MCU_TYPE_USB, USB_BP2_EN, 0); 3979 + ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0); 3969 3980 3970 3981 ocp_write_word(tp, MCU_TYPE_USB, USB_BP_8, 0); 3971 3982 ocp_write_word(tp, MCU_TYPE_USB, USB_BP_9, 0); ··· 4342 4331 case RTL_VER_11: 4343 4332 case RTL_VER_12: 4344 4333 case RTL_VER_13: 4345 - case RTL_VER_14: 4346 4334 case RTL_VER_15: 4347 4335 fw_reg = 0xf800; 4348 4336 bp_ba_addr = PLA_BP_BA; 4349 4337 bp_en_addr = PLA_BP_EN; 4350 4338 bp_start = PLA_BP_0; 4351 4339 max_bp = 8; 4340 + break; 4341 + case RTL_VER_14: 4342 + fw_reg = 0xf800; 4343 + bp_ba_addr = PLA_BP_BA; 4344 + bp_en_addr = USB_BP2_EN; 4345 + bp_start = PLA_BP_0; 4346 + max_bp = 16; 4352 4347 break; 4353 4348 default: 4354 4349 goto out;
+7 -7
drivers/net/virtio_net.c
··· 63 63 VIRTIO_NET_F_GUEST_CSUM 64 64 }; 65 65 66 - #define GUEST_OFFLOAD_LRO_MASK ((1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ 66 + #define GUEST_OFFLOAD_GRO_HW_MASK ((1ULL << VIRTIO_NET_F_GUEST_TSO4) | \ 67 67 (1ULL << VIRTIO_NET_F_GUEST_TSO6) | \ 68 68 (1ULL << VIRTIO_NET_F_GUEST_ECN) | \ 69 69 (1ULL << VIRTIO_NET_F_GUEST_UFO)) ··· 2515 2515 virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || 2516 2516 virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || 2517 2517 virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { 2518 - NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO/CSUM, disable LRO/CSUM first"); 2518 + NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing GRO_HW/CSUM, disable GRO_HW/CSUM first"); 2519 2519 return -EOPNOTSUPP; 2520 2520 } 2521 2521 ··· 2646 2646 u64 offloads; 2647 2647 int err; 2648 2648 2649 - if ((dev->features ^ features) & NETIF_F_LRO) { 2649 + if ((dev->features ^ features) & NETIF_F_GRO_HW) { 2650 2650 if (vi->xdp_enabled) 2651 2651 return -EBUSY; 2652 2652 2653 - if (features & NETIF_F_LRO) 2653 + if (features & NETIF_F_GRO_HW) 2654 2654 offloads = vi->guest_offloads_capable; 2655 2655 else 2656 2656 offloads = vi->guest_offloads_capable & 2657 - ~GUEST_OFFLOAD_LRO_MASK; 2657 + ~GUEST_OFFLOAD_GRO_HW_MASK; 2658 2658 2659 2659 err = virtnet_set_guest_offloads(vi, offloads); 2660 2660 if (err) ··· 3134 3134 dev->features |= NETIF_F_RXCSUM; 3135 3135 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || 3136 3136 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6)) 3137 - dev->features |= NETIF_F_LRO; 3137 + dev->features |= NETIF_F_GRO_HW; 3138 3138 if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS)) 3139 - dev->hw_features |= NETIF_F_LRO; 3139 + dev->hw_features |= NETIF_F_GRO_HW; 3140 3140 3141 3141 dev->vlan_features = dev->features; 3142 3142
+4
drivers/net/vrf.c
··· 1367 1367 bool need_strict = rt6_need_strict(&ipv6_hdr(skb)->daddr); 1368 1368 bool is_ndisc = ipv6_ndisc_frame(skb); 1369 1369 1370 + nf_reset_ct(skb); 1371 + 1370 1372 /* loopback, multicast & non-ND link-local traffic; do not push through 1371 1373 * packet taps again. Reset pkt_type for upper layers to process skb. 1372 1374 * For strict packets with a source LLA, determine the dst using the ··· 1430 1428 skb->dev = vrf_dev; 1431 1429 skb->skb_iif = vrf_dev->ifindex; 1432 1430 IPCB(skb)->flags |= IPSKB_L3SLAVE; 1431 + 1432 + nf_reset_ct(skb); 1433 1433 1434 1434 if (ipv4_is_multicast(ip_hdr(skb)->daddr)) 1435 1435 goto out;
+16 -9
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
··· 37 37 u32 sha1 = 0; 38 38 u16 mac_type = 0, rf_id = 0; 39 39 u8 *pnvm_data = NULL, *tmp; 40 + bool hw_match = false; 40 41 u32 size = 0; 41 42 int ret; 42 43 ··· 84 83 break; 85 84 } 86 85 86 + if (hw_match) 87 + break; 88 + 87 89 mac_type = le16_to_cpup((__le16 *)data); 88 90 rf_id = le16_to_cpup((__le16 *)(data + sizeof(__le16))); 89 91 ··· 94 90 "Got IWL_UCODE_TLV_HW_TYPE mac_type 0x%0x rf_id 0x%0x\n", 95 91 mac_type, rf_id); 96 92 97 - if (mac_type != CSR_HW_REV_TYPE(trans->hw_rev) || 98 - rf_id != CSR_HW_RFID_TYPE(trans->hw_rf_id)) { 99 - IWL_DEBUG_FW(trans, 100 - "HW mismatch, skipping PNVM section, mac_type 0x%0x, rf_id 0x%0x.\n", 101 - CSR_HW_REV_TYPE(trans->hw_rev), trans->hw_rf_id); 102 - ret = -ENOENT; 103 - goto out; 104 - } 105 - 93 + if (mac_type == CSR_HW_REV_TYPE(trans->hw_rev) && 94 + rf_id == CSR_HW_RFID_TYPE(trans->hw_rf_id)) 95 + hw_match = true; 106 96 break; 107 97 case IWL_UCODE_TLV_SEC_RT: { 108 98 struct iwl_pnvm_section *section = (void *)data; ··· 147 149 } 148 150 149 151 done: 152 + if (!hw_match) { 153 + IWL_DEBUG_FW(trans, 154 + "HW mismatch, skipping PNVM section (need mac_type 0x%x rf_id 0x%x)\n", 155 + CSR_HW_REV_TYPE(trans->hw_rev), 156 + CSR_HW_RFID_TYPE(trans->hw_rf_id)); 157 + ret = -ENOENT; 158 + goto out; 159 + } 160 + 150 161 if (!size) { 151 162 IWL_DEBUG_FW(trans, "Empty PNVM, skipping.\n"); 152 163 ret = -ENOENT;
+69 -1
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 1110 1110 IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_NO_CDB, 1111 1111 iwl_cfg_bz_a0_mr_a0, iwl_ax211_name), 1112 1112 1113 + /* SoF with JF2 */ 1114 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1115 + IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY, 1116 + IWL_CFG_RF_TYPE_JF2, IWL_CFG_RF_ID_JF, 1117 + IWL_CFG_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1118 + iwlax210_2ax_cfg_so_jf_b0, iwl9560_160_name), 1119 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1120 + IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY, 1121 + IWL_CFG_RF_TYPE_JF2, IWL_CFG_RF_ID_JF, 1122 + IWL_CFG_NO_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1123 + iwlax210_2ax_cfg_so_jf_b0, iwl9560_name), 1124 + 1125 + /* SoF with JF */ 1126 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1127 + IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY, 1128 + IWL_CFG_RF_TYPE_JF1, IWL_CFG_RF_ID_JF1, 1129 + IWL_CFG_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1130 + iwlax210_2ax_cfg_so_jf_b0, iwl9461_160_name), 1131 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1132 + IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY, 1133 + IWL_CFG_RF_TYPE_JF1, IWL_CFG_RF_ID_JF1_DIV, 1134 + IWL_CFG_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1135 + iwlax210_2ax_cfg_so_jf_b0, iwl9462_160_name), 1136 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1137 + IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY, 1138 + IWL_CFG_RF_TYPE_JF1, IWL_CFG_RF_ID_JF1, 1139 + IWL_CFG_NO_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1140 + iwlax210_2ax_cfg_so_jf_b0, iwl9461_name), 1141 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1142 + IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY, 1143 + IWL_CFG_RF_TYPE_JF1, IWL_CFG_RF_ID_JF1_DIV, 1144 + IWL_CFG_NO_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1145 + iwlax210_2ax_cfg_so_jf_b0, iwl9462_name), 1146 + 1113 1147 /* So with GF */ 1114 1148 _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1115 1149 IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY, 1116 1150 IWL_CFG_RF_TYPE_GF, IWL_CFG_ANY, 1117 1151 IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB, 1118 - iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_name) 1152 + iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_name), 1153 + 1154 + /* So with JF2 */ 1155 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1156 + IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY, 1157 + IWL_CFG_RF_TYPE_JF2, IWL_CFG_RF_ID_JF, 1158 + IWL_CFG_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1159 + iwlax210_2ax_cfg_so_jf_b0, iwl9560_160_name), 1160 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1161 + IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY, 1162 + IWL_CFG_RF_TYPE_JF2, IWL_CFG_RF_ID_JF, 1163 + IWL_CFG_NO_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1164 + iwlax210_2ax_cfg_so_jf_b0, iwl9560_name), 1165 + 1166 + /* So with JF */ 1167 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1168 + IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY, 1169 + IWL_CFG_RF_TYPE_JF1, IWL_CFG_RF_ID_JF1, 1170 + IWL_CFG_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1171 + iwlax210_2ax_cfg_so_jf_b0, iwl9461_160_name), 1172 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1173 + IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY, 1174 + IWL_CFG_RF_TYPE_JF1, IWL_CFG_RF_ID_JF1_DIV, 1175 + IWL_CFG_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1176 + iwlax210_2ax_cfg_so_jf_b0, iwl9462_160_name), 1177 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1178 + IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY, 1179 + IWL_CFG_RF_TYPE_JF1, IWL_CFG_RF_ID_JF1, 1180 + IWL_CFG_NO_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1181 + iwlax210_2ax_cfg_so_jf_b0, iwl9461_name), 1182 + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, 1183 + IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY, 1184 + IWL_CFG_RF_TYPE_JF1, IWL_CFG_RF_ID_JF1_DIV, 1185 + IWL_CFG_NO_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, 1186 + iwlax210_2ax_cfg_so_jf_b0, iwl9462_name) 1119 1187 1120 1188 #endif /* CONFIG_IWLMVM */ 1121 1189 };
+1 -1
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
··· 111 111 case WLAN_CIPHER_SUITE_SMS4: 112 112 return MCU_CIPHER_WAPI; 113 113 default: 114 - return MT_CIPHER_NONE; 114 + return MCU_CIPHER_NONE; 115 115 } 116 116 } 117 117
+2 -1
drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
··· 1073 1073 }; 1074 1074 1075 1075 enum mcu_cipher_type { 1076 - MCU_CIPHER_WEP40 = 1, 1076 + MCU_CIPHER_NONE = 0, 1077 + MCU_CIPHER_WEP40, 1077 1078 MCU_CIPHER_WEP104, 1078 1079 MCU_CIPHER_WEP128, 1079 1080 MCU_CIPHER_TKIP,
+1 -1
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
··· 111 111 case WLAN_CIPHER_SUITE_SMS4: 112 112 return MCU_CIPHER_WAPI; 113 113 default: 114 - return MT_CIPHER_NONE; 114 + return MCU_CIPHER_NONE; 115 115 } 116 116 } 117 117
+2 -1
drivers/net/wireless/mediatek/mt76/mt7921/mcu.h
··· 199 199 } __packed; 200 200 201 201 enum mcu_cipher_type { 202 - MCU_CIPHER_WEP40 = 1, 202 + MCU_CIPHER_NONE = 0, 203 + MCU_CIPHER_WEP40, 203 204 MCU_CIPHER_WEP104, 204 205 MCU_CIPHER_WEP128, 205 206 MCU_CIPHER_TKIP,
+3 -4
drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c
··· 64 64 65 65 int ipc_chnl_cfg_get(struct ipc_chnl_cfg *chnl_cfg, int index) 66 66 { 67 - int array_size = ARRAY_SIZE(modem_cfg); 68 - 69 - if (index >= array_size) { 70 - pr_err("index: %d and array_size %d", index, array_size); 67 + if (index >= ARRAY_SIZE(modem_cfg)) { 68 + pr_err("index: %d and array size %zu", index, 69 + ARRAY_SIZE(modem_cfg)); 71 70 return -ECHRNG; 72 71 } 73 72
+2 -1
drivers/ptp/Kconfig
··· 90 90 config PTP_1588_CLOCK_PCH 91 91 tristate "Intel PCH EG20T as PTP clock" 92 92 depends on X86_32 || COMPILE_TEST 93 - depends on HAS_IOMEM && NET 93 + depends on HAS_IOMEM && PCI 94 + depends on NET 94 95 imply PTP_1588_CLOCK 95 96 help 96 97 This driver adds support for using the PCH EG20T as a PTP
+5 -7
include/net/flow_offload.h
··· 319 319 if (flow_offload_has_one_action(action)) 320 320 return true; 321 321 322 - if (action) { 323 - flow_action_for_each(i, action_entry, action) { 324 - if (i && action_entry->hw_stats != last_hw_stats) { 325 - NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported"); 326 - return false; 327 - } 328 - last_hw_stats = action_entry->hw_stats; 322 + flow_action_for_each(i, action_entry, action) { 323 + if (i && action_entry->hw_stats != last_hw_stats) { 324 + NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported"); 325 + return false; 329 326 } 327 + last_hw_stats = action_entry->hw_stats; 330 328 } 331 329 return true; 332 330 }
+16 -6
kernel/bpf/helpers.c
··· 353 353 #ifdef CONFIG_CGROUPS 354 354 BPF_CALL_0(bpf_get_current_cgroup_id) 355 355 { 356 - struct cgroup *cgrp = task_dfl_cgroup(current); 356 + struct cgroup *cgrp; 357 + u64 cgrp_id; 357 358 358 - return cgroup_id(cgrp); 359 + rcu_read_lock(); 360 + cgrp = task_dfl_cgroup(current); 361 + cgrp_id = cgroup_id(cgrp); 362 + rcu_read_unlock(); 363 + 364 + return cgrp_id; 359 365 } 360 366 361 367 const struct bpf_func_proto bpf_get_current_cgroup_id_proto = { ··· 372 366 373 367 BPF_CALL_1(bpf_get_current_ancestor_cgroup_id, int, ancestor_level) 374 368 { 375 - struct cgroup *cgrp = task_dfl_cgroup(current); 369 + struct cgroup *cgrp; 376 370 struct cgroup *ancestor; 371 + u64 cgrp_id; 377 372 373 + rcu_read_lock(); 374 + cgrp = task_dfl_cgroup(current); 378 375 ancestor = cgroup_ancestor(cgrp, ancestor_level); 379 - if (!ancestor) 380 - return 0; 381 - return cgroup_id(ancestor); 376 + cgrp_id = ancestor ? cgroup_id(ancestor) : 0; 377 + rcu_read_unlock(); 378 + 379 + return cgrp_id; 382 380 } 383 381 384 382 const struct bpf_func_proto bpf_get_current_ancestor_cgroup_id_proto = {
+1
kernel/bpf/verifier.c
··· 11663 11663 if (aux_data[i].seen) 11664 11664 continue; 11665 11665 memcpy(insn + i, &trap, sizeof(trap)); 11666 + aux_data[i].zext_dst = false; 11666 11667 } 11667 11668 } 11668 11669
+2
net/mac80211/main.c
··· 260 260 flush_work(&local->radar_detected_work); 261 261 262 262 rtnl_lock(); 263 + /* we might do interface manipulations, so need both */ 264 + wiphy_lock(local->hw.wiphy); 263 265 264 266 WARN(test_bit(SCAN_HW_SCANNING, &local->scanning), 265 267 "%s called with hardware scan in progress\n", __func__);
+3 -7
net/mptcp/options.c
··· 885 885 return subflow->mp_capable; 886 886 } 887 887 888 - if (mp_opt->dss && mp_opt->use_ack) { 888 + if ((mp_opt->dss && mp_opt->use_ack) || 889 + (mp_opt->add_addr && !mp_opt->echo)) { 889 890 /* subflows are fully established as soon as we get any 890 - * additional ack. 891 + * additional ack, including ADD_ADDR. 891 892 */ 892 893 subflow->fully_established = 1; 893 894 WRITE_ONCE(msk->fully_established, true); 894 895 goto fully_established; 895 - } 896 - 897 - if (mp_opt->add_addr) { 898 - WRITE_ONCE(msk->fully_established, true); 899 - return true; 900 896 } 901 897 902 898 /* If the first established packet does not contain MP_CAPABLE + data
+12 -32
net/mptcp/pm_netlink.c
··· 1135 1135 return 0; 1136 1136 } 1137 1137 1138 - struct addr_entry_release_work { 1139 - struct rcu_work rwork; 1140 - struct mptcp_pm_addr_entry *entry; 1141 - }; 1142 - 1143 - static void mptcp_pm_release_addr_entry(struct work_struct *work) 1138 + /* caller must ensure the RCU grace period is already elapsed */ 1139 + static void __mptcp_pm_release_addr_entry(struct mptcp_pm_addr_entry *entry) 1144 1140 { 1145 - struct addr_entry_release_work *w; 1146 - struct mptcp_pm_addr_entry *entry; 1147 - 1148 - w = container_of(to_rcu_work(work), struct addr_entry_release_work, rwork); 1149 - entry = w->entry; 1150 - if (entry) { 1151 - if (entry->lsk) 1152 - sock_release(entry->lsk); 1153 - kfree(entry); 1154 - } 1155 - kfree(w); 1156 - } 1157 - 1158 - static void mptcp_pm_free_addr_entry(struct mptcp_pm_addr_entry *entry) 1159 - { 1160 - struct addr_entry_release_work *w; 1161 - 1162 - w = kmalloc(sizeof(*w), GFP_ATOMIC); 1163 - if (w) { 1164 - INIT_RCU_WORK(&w->rwork, mptcp_pm_release_addr_entry); 1165 - w->entry = entry; 1166 - queue_rcu_work(system_wq, &w->rwork); 1167 - } 1141 + if (entry->lsk) 1142 + sock_release(entry->lsk); 1143 + kfree(entry); 1168 1144 } 1169 1145 1170 1146 static int mptcp_nl_remove_id_zero_address(struct net *net, ··· 1220 1244 spin_unlock_bh(&pernet->lock); 1221 1245 1222 1246 mptcp_nl_remove_subflow_and_signal_addr(sock_net(skb->sk), &entry->addr); 1223 - mptcp_pm_free_addr_entry(entry); 1247 + synchronize_rcu(); 1248 + __mptcp_pm_release_addr_entry(entry); 1224 1249 1225 1250 return ret; 1226 1251 } ··· 1274 1297 } 1275 1298 } 1276 1299 1300 + /* caller must ensure the RCU grace period is already elapsed */ 1277 1301 static void __flush_addrs(struct list_head *list) 1278 1302 { 1279 1303 while (!list_empty(list)) { ··· 1283 1305 cur = list_entry(list->next, 1284 1306 struct mptcp_pm_addr_entry, list); 1285 1307 list_del_rcu(&cur->list); 1286 - mptcp_pm_free_addr_entry(cur); 1308 + __mptcp_pm_release_addr_entry(cur); 1287 1309 } 1288 1310 } 1289 1311 ··· 1307 1329 bitmap_zero(pernet->id_bitmap, MAX_ADDR_ID + 1); 1308 1330 spin_unlock_bh(&pernet->lock); 1309 1331 mptcp_nl_remove_addrs_list(sock_net(skb->sk), &free_list); 1332 + synchronize_rcu(); 1310 1333 __flush_addrs(&free_list); 1311 1334 return 0; 1312 1335 } ··· 1918 1939 struct pm_nl_pernet *pernet = net_generic(net, pm_nl_pernet_id); 1919 1940 1920 1941 /* net is removed from namespace list, can't race with 1921 - * other modifiers 1942 + * other modifiers, also netns core already waited for a 1943 + * RCU grace period. 1922 1944 */ 1923 1945 __flush_addrs(&pernet->local_addr_list); 1924 1946 }
+1
net/openvswitch/vport.c
··· 507 507 } 508 508 509 509 skb->dev = vport->dev; 510 + skb->tstamp = 0; 510 511 vport->ops->send(skb); 511 512 return; 512 513
+2 -2
net/rds/ib_frmr.c
··· 131 131 cpu_relax(); 132 132 } 133 133 134 - ret = ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_len, 134 + ret = ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_dma_len, 135 135 &off, PAGE_SIZE); 136 - if (unlikely(ret != ibmr->sg_len)) 136 + if (unlikely(ret != ibmr->sg_dma_len)) 137 137 return ret < 0 ? ret : -EINVAL; 138 138 139 139 if (cmpxchg(&frmr->fr_state,
+1 -1
net/sched/sch_cake.c
··· 720 720 skip_hash: 721 721 if (flow_override) 722 722 flow_hash = flow_override - 1; 723 - else if (use_skbhash) 723 + else if (use_skbhash && (flow_mode & CAKE_FLOW_FLOWS)) 724 724 flow_hash = skb->hash; 725 725 if (host_override) { 726 726 dsthost_hash = host_override - 1;
+1 -1
net/tipc/socket.c
··· 1518 1518 1519 1519 if (unlikely(syn && !rc)) { 1520 1520 tipc_set_sk_state(sk, TIPC_CONNECTING); 1521 - if (timeout) { 1521 + if (dlen && timeout) { 1522 1522 timeout = msecs_to_jiffies(timeout); 1523 1523 tipc_wait_for_connect(sock, &timeout); 1524 1524 }
+12
tools/testing/selftests/bpf/verifier/dead_code.c
··· 159 159 .result = ACCEPT, 160 160 .retval = 2, 161 161 }, 162 + { 163 + "dead code: zero extension", 164 + .insns = { 165 + BPF_MOV64_IMM(BPF_REG_0, 0), 166 + BPF_STX_MEM(BPF_W, BPF_REG_10, BPF_REG_0, -4), 167 + BPF_JMP_IMM(BPF_JGE, BPF_REG_0, 0, 1), 168 + BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_10, -4), 169 + BPF_EXIT_INSN(), 170 + }, 171 + .result = ACCEPT, 172 + .retval = 0, 173 + },