Skip to content

Commit

Permalink
Merge tag 'net-5.17-final' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/netdev/net

Pull networking fixes from Jakub Kicinski:
 "Including fixes from netfilter, ipsec, and wireless.

  A few last minute revert / disable and fix patches came down from our
  sub-trees. We're not waiting for any fixes at this point.

  Current release - regressions:

   - Revert "netfilter: nat: force port remap to prevent shadowing
     well-known ports", restore working conntrack on asymmetric paths

   - Revert "ath10k: drop beacon and probe response which leak from
     other channel", restore working AP and mesh mode on QCA9984

   - eth: intel: fix hang during reboot/shutdown

  Current release - new code bugs:

   - netfilter: nf_tables: disable register tracking, it needs more work
     to cover all corner cases

  Previous releases - regressions:

   - ipv6: fix skb_over_panic in __ip6_append_data when (admin-only)
     extension headers get specified

   - esp6: fix ESP over TCP/UDP, interpret ipv6_skip_exthdr's return
     value more selectively

   - bnx2x: fix driver load failure when FW not present in initrd

  Previous releases - always broken:

   - vsock: stop destroying unrelated sockets in nested virtualization

   - packet: fix slab-out-of-bounds access in packet_recvmsg()

  Misc:

   - add Paolo Abeni to networking maintainers!"

* tag 'net-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (26 commits)
  iavf: Fix hang during reboot/shutdown
  net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower offload
  net: bcmgenet: skip invalid partial checksums
  bnx2x: fix built-in kernel driver load failure
  net: phy: mscc: Add MODULE_FIRMWARE macros
  net: dsa: Add missing of_node_put() in dsa_port_parse_of
  net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit()
  Revert "ath10k: drop beacon and probe response which leak from other channel"
  hv_netvsc: Add check for kvmalloc_array
  iavf: Fix double free in iavf_reset_task
  ice: destroy flow director filter mutex after releasing VSIs
  ice: fix NULL pointer dereference in ice_update_vsi_tx_ring_stats()
  Add Paolo Abeni to networking maintainers
  atm: eni: Add check for dma_map_single
  net/packet: fix slab-out-of-bounds access in packet_recvmsg()
  net: mdio: mscc-miim: fix duplicate debugfs entry
  net: phy: marvell: Fix invalid comparison in the resume and suspend functions
  esp6: fix check on ipv6_skip_exthdr's return value
  net: dsa: microchip: add spi_device_id tables
  netfilter: nf_tables: disable register tracking
  ...
  • Loading branch information
torvalds committed Mar 17, 2022
2 parents c81801e + b04683f commit 551acdc
Show file tree
Hide file tree
Showing 33 changed files with 154 additions and 133 deletions.
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -13376,6 +13376,7 @@ F: net/core/drop_monitor.c
NETWORKING DRIVERS
M: "David S. Miller" <[email protected]>
M: Jakub Kicinski <[email protected]>
M: Paolo Abeni <[email protected]>
L: [email protected]
S: Maintained
Q: https://patchwork.kernel.org/project/netdevbpf/list/
Expand Down Expand Up @@ -13422,6 +13423,7 @@ F: tools/testing/selftests/drivers/net/dsa/
NETWORKING [GENERAL]
M: "David S. Miller" <[email protected]>
M: Jakub Kicinski <[email protected]>
M: Paolo Abeni <[email protected]>
L: [email protected]
S: Maintained
Q: https://patchwork.kernel.org/project/netdevbpf/list/
Expand Down
2 changes: 2 additions & 0 deletions drivers/atm/eni.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags);
skb_data3 = skb->data[3];
paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len,
DMA_TO_DEVICE);
if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr))
return enq_next;
ENI_PRV_PADDR(skb) = paddr;
/* prepare DMA queue entries */
j = 0;
Expand Down
11 changes: 11 additions & 0 deletions drivers/net/dsa/microchip/ksz8795_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,23 @@ static const struct of_device_id ksz8795_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, ksz8795_dt_ids);

static const struct spi_device_id ksz8795_spi_ids[] = {
{ "ksz8765" },
{ "ksz8794" },
{ "ksz8795" },
{ "ksz8863" },
{ "ksz8873" },
{ },
};
MODULE_DEVICE_TABLE(spi, ksz8795_spi_ids);

static struct spi_driver ksz8795_spi_driver = {
.driver = {
.name = "ksz8795-switch",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(ksz8795_dt_ids),
},
.id_table = ksz8795_spi_ids,
.probe = ksz8795_spi_probe,
.remove = ksz8795_spi_remove,
.shutdown = ksz8795_spi_shutdown,
Expand Down
12 changes: 12 additions & 0 deletions drivers/net/dsa/microchip/ksz9477_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,24 @@ static const struct of_device_id ksz9477_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, ksz9477_dt_ids);

static const struct spi_device_id ksz9477_spi_ids[] = {
{ "ksz9477" },
{ "ksz9897" },
{ "ksz9893" },
{ "ksz9563" },
{ "ksz8563" },
{ "ksz9567" },
{ },
};
MODULE_DEVICE_TABLE(spi, ksz9477_spi_ids);

static struct spi_driver ksz9477_spi_driver = {
.driver = {
.name = "ksz9477-switch",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(ksz9477_dt_ids),
},
.id_table = ksz9477_spi_ids,
.probe = ksz9477_spi_probe,
.remove = ksz9477_spi_remove,
.shutdown = ksz9477_spi_shutdown,
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/ethernet/atheros/alx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,11 @@ static int alx_change_mtu(struct net_device *netdev, int mtu)
alx->hw.mtu = mtu;
alx->rxbuf_size = max(max_frame, ALX_DEF_RXBUF_SIZE);
netdev_update_features(netdev);
if (netif_running(netdev))
if (netif_running(netdev)) {
mutex_lock(&alx->mtx);
alx_reinit(alx);
mutex_unlock(&alx->mtx);
}
return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -2533,6 +2533,4 @@ void bnx2x_register_phc(struct bnx2x *bp);
* Meant for implicit re-load flows.
*/
int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp);
int bnx2x_init_firmware(struct bnx2x *bp);
void bnx2x_release_firmware(struct bnx2x *bp);
#endif /* bnx2x.h */
28 changes: 17 additions & 11 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2364,24 +2364,30 @@ int bnx2x_compare_fw_ver(struct bnx2x *bp, u32 load_code, bool print_err)
/* is another pf loaded on this engine? */
if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP &&
load_code != FW_MSG_CODE_DRV_LOAD_COMMON) {
/* build my FW version dword */
u32 my_fw = (bp->fw_major) + (bp->fw_minor << 8) +
(bp->fw_rev << 16) + (bp->fw_eng << 24);
u8 loaded_fw_major, loaded_fw_minor, loaded_fw_rev, loaded_fw_eng;
u32 loaded_fw;

/* read loaded FW from chip */
u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM);
loaded_fw = REG_RD(bp, XSEM_REG_PRAM);

DP(BNX2X_MSG_SP, "loaded fw %x, my fw %x\n",
loaded_fw, my_fw);
loaded_fw_major = loaded_fw & 0xff;
loaded_fw_minor = (loaded_fw >> 8) & 0xff;
loaded_fw_rev = (loaded_fw >> 16) & 0xff;
loaded_fw_eng = (loaded_fw >> 24) & 0xff;

DP(BNX2X_MSG_SP, "loaded fw 0x%x major 0x%x minor 0x%x rev 0x%x eng 0x%x\n",
loaded_fw, loaded_fw_major, loaded_fw_minor, loaded_fw_rev, loaded_fw_eng);

/* abort nic load if version mismatch */
if (my_fw != loaded_fw) {
if (loaded_fw_major != BCM_5710_FW_MAJOR_VERSION ||
loaded_fw_minor != BCM_5710_FW_MINOR_VERSION ||
loaded_fw_eng != BCM_5710_FW_ENGINEERING_VERSION ||
loaded_fw_rev < BCM_5710_FW_REVISION_VERSION_V15) {
if (print_err)
BNX2X_ERR("bnx2x with FW %x was already loaded which mismatches my %x FW. Aborting\n",
loaded_fw, my_fw);
BNX2X_ERR("loaded FW incompatible. Aborting\n");
else
BNX2X_DEV_INFO("bnx2x with FW %x was already loaded which mismatches my %x FW, possibly due to MF UNDI\n",
loaded_fw, my_fw);
BNX2X_DEV_INFO("loaded FW incompatible, possibly due to MF UNDI\n");

return -EBUSY;
}
}
Expand Down
15 changes: 2 additions & 13 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12319,15 +12319,6 @@ static int bnx2x_init_bp(struct bnx2x *bp)

bnx2x_read_fwinfo(bp);

if (IS_PF(bp)) {
rc = bnx2x_init_firmware(bp);

if (rc) {
bnx2x_free_mem_bp(bp);
return rc;
}
}

func = BP_FUNC(bp);

/* need to reset chip if undi was active */
Expand All @@ -12340,7 +12331,6 @@ static int bnx2x_init_bp(struct bnx2x *bp)

rc = bnx2x_prev_unload(bp);
if (rc) {
bnx2x_release_firmware(bp);
bnx2x_free_mem_bp(bp);
return rc;
}
Expand Down Expand Up @@ -13409,7 +13399,7 @@ do { \
(u8 *)bp->arr, len); \
} while (0)

int bnx2x_init_firmware(struct bnx2x *bp)
static int bnx2x_init_firmware(struct bnx2x *bp)
{
const char *fw_file_name, *fw_file_name_v15;
struct bnx2x_fw_file_hdr *fw_hdr;
Expand Down Expand Up @@ -13509,7 +13499,7 @@ int bnx2x_init_firmware(struct bnx2x *bp)
return rc;
}

void bnx2x_release_firmware(struct bnx2x *bp)
static void bnx2x_release_firmware(struct bnx2x *bp)
{
kfree(bp->init_ops_offsets);
kfree(bp->init_ops);
Expand Down Expand Up @@ -14026,7 +14016,6 @@ static int bnx2x_init_one(struct pci_dev *pdev,
return 0;

init_one_freemem:
bnx2x_release_firmware(bp);
bnx2x_free_mem_bp(bp);

init_one_exit:
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ethernet/broadcom/genet/bcmgenet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2287,8 +2287,10 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
dma_length_status = status->length_status;
if (dev->features & NETIF_F_RXCSUM) {
rx_csum = (__force __be16)(status->rx_csum & 0xffff);
skb->csum = (__force __wsum)ntohs(rx_csum);
skb->ip_summed = CHECKSUM_COMPLETE;
if (rx_csum) {
skb->csum = (__force __wsum)ntohs(rx_csum);
skb->ip_summed = CHECKSUM_COMPLETE;
}
}

/* DMA flags and length are still valid no matter how
Expand Down
15 changes: 14 additions & 1 deletion drivers/net/ethernet/intel/iavf/iavf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2541,6 +2541,13 @@ static void iavf_watchdog_task(struct work_struct *work)
queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2);
}

/**
* iavf_disable_vf - disable VF
* @adapter: board private structure
*
* Set communication failed flag and free all resources.
* NOTE: This function is expected to be called with crit_lock being held.
**/
static void iavf_disable_vf(struct iavf_adapter *adapter)
{
struct iavf_mac_filter *f, *ftmp;
Expand Down Expand Up @@ -2595,7 +2602,6 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
memset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE);
iavf_shutdown_adminq(&adapter->hw);
adapter->netdev->flags &= ~IFF_UP;
mutex_unlock(&adapter->crit_lock);
adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
iavf_change_state(adapter, __IAVF_DOWN);
wake_up(&adapter->down_waitqueue);
Expand Down Expand Up @@ -4614,6 +4620,13 @@ static void iavf_remove(struct pci_dev *pdev)
struct iavf_hw *hw = &adapter->hw;
int err;

/* When reboot/shutdown is in progress no need to do anything
* as the adapter is already REMOVE state that was set during
* iavf_shutdown() callback.
*/
if (adapter->state == __IAVF_REMOVE)
return;

set_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section);
/* Wait until port initialization is complete.
* There are flows where register/unregister netdev may race.
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/ethernet/intel/ice/ice_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4880,14 +4880,14 @@ static void ice_remove(struct pci_dev *pdev)
ice_devlink_unregister_params(pf);
set_bit(ICE_DOWN, pf->state);

mutex_destroy(&(&pf->hw)->fdir_fltr_lock);
ice_deinit_lag(pf);
if (test_bit(ICE_FLAG_PTP_SUPPORTED, pf->flags))
ice_ptp_release(pf);
if (!ice_is_safe_mode(pf))
ice_remove_arfs(pf);
ice_setup_mc_magic_wake(pf);
ice_vsi_release_all(pf);
mutex_destroy(&(&pf->hw)->fdir_fltr_lock);
ice_set_wake(pf);
ice_free_irq_msix_misc(pf);
ice_for_each_vsi(pf, i) {
Expand Down Expand Up @@ -5962,8 +5962,9 @@ ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi,
u64 pkts = 0, bytes = 0;

ring = READ_ONCE(rings[i]);
if (ring)
ice_fetch_u64_stats_per_ring(&ring->syncp, ring->stats, &pkts, &bytes);
if (!ring)
continue;
ice_fetch_u64_stats_per_ring(&ring->syncp, ring->stats, &pkts, &bytes);
vsi_stats->tx_packets += pkts;
vsi_stats->tx_bytes += bytes;
vsi->tx_restart += ring->tx_stats.restart_q;
Expand Down
16 changes: 15 additions & 1 deletion drivers/net/ethernet/mscc/ocelot_flower.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ static int ocelot_chain_to_block(int chain, bool ingress)
*/
static int ocelot_chain_to_lookup(int chain)
{
/* Backwards compatibility with older, single-chain tc-flower
* offload support in Ocelot
*/
if (chain == 0)
return 0;

return (chain / VCAP_LOOKUP) % 10;
}

Expand All @@ -68,7 +74,15 @@ static int ocelot_chain_to_lookup(int chain)
*/
static int ocelot_chain_to_pag(int chain)
{
int lookup = ocelot_chain_to_lookup(chain);
int lookup;

/* Backwards compatibility with older, single-chain tc-flower
* offload support in Ocelot
*/
if (chain == 0)
return 0;

lookup = ocelot_chain_to_lookup(chain);

/* calculate PAG value as chain index relative to the first PAG */
return chain - VCAP_IS2_CHAIN(lookup, 0);
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,9 @@ static void netvsc_get_ethtool_stats(struct net_device *dev,
pcpu_sum = kvmalloc_array(num_possible_cpus(),
sizeof(struct netvsc_ethtool_pcpu_stats),
GFP_KERNEL);
if (!pcpu_sum)
return;

netvsc_get_pcpu_stats(dev, pcpu_sum);
for_each_present_cpu(cpu) {
struct netvsc_ethtool_pcpu_stats *this_sum = &pcpu_sum[cpu];
Expand Down
9 changes: 8 additions & 1 deletion drivers/net/mdio/mdio-mscc-miim.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ static const struct regmap_config mscc_miim_regmap_config = {
.reg_stride = 4,
};

static const struct regmap_config mscc_miim_phy_regmap_config = {
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
.name = "phy",
};

int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name,
struct regmap *mii_regmap, int status_offset)
{
Expand Down Expand Up @@ -250,7 +257,7 @@ static int mscc_miim_probe(struct platform_device *pdev)
}

phy_regmap = devm_regmap_init_mmio(&pdev->dev, phy_regs,
&mscc_miim_regmap_config);
&mscc_miim_phy_regmap_config);
if (IS_ERR(phy_regmap)) {
dev_err(&pdev->dev, "Unable to create phy register regmap\n");
return PTR_ERR(phy_regmap);
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/phy/marvell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,8 +1687,8 @@ static int marvell_suspend(struct phy_device *phydev)
int err;

/* Suspend the fiber mode first */
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
phydev->supported)) {
if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
phydev->supported)) {
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
if (err < 0)
goto error;
Expand Down Expand Up @@ -1722,8 +1722,8 @@ static int marvell_resume(struct phy_device *phydev)
int err;

/* Resume the fiber mode first */
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
phydev->supported)) {
if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
phydev->supported)) {
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
if (err < 0)
goto error;
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/phy/mscc/mscc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2685,3 +2685,6 @@ MODULE_DEVICE_TABLE(mdio, vsc85xx_tbl);
MODULE_DESCRIPTION("Microsemi VSC85xx PHY driver");
MODULE_AUTHOR("Nagaraju Lakkaraju");
MODULE_LICENSE("Dual MIT/GPL");

MODULE_FIRMWARE(MSCC_VSC8584_REVB_INT8051_FW);
MODULE_FIRMWARE(MSCC_VSC8574_REVB_INT8051_FW);
Loading

0 comments on commit 551acdc

Please sign in to comment.