Skip to content

Commit ce69b40

Browse files
committed
Merge tag 'net-6.13-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Notably this includes fixes for a few regressions spotted very recently. No known outstanding ones. Current release - regressions: - core: avoid CFI problems with sock priv helpers - xsk: bring back busy polling support - netpoll: ensure skb_pool list is always initialized Current release - new code bugs: - core: make page_pool_ref_netmem work with net iovs - ipv4: route: fix drop reason being overridden in ip_route_input_slow - udp: make rehash4 independent in udp_lib_rehash() Previous releases - regressions: - bpf: fix bpf_sk_select_reuseport() memory leak - openvswitch: fix lockup on tx to unregistering netdev with carrier - mptcp: be sure to send ack when mptcp-level window re-opens - eth: - bnxt: always recalculate features after XDP clearing, fix null-deref - mlx5: fix sub-function add port error handling - fec: handle page_pool_dev_alloc_pages error Previous releases - always broken: - vsock: some fixes due to transport de-assignment - eth: - ice: fix E825 initialization - mlx5e: fix inversion dependency warning while enabling IPsec tunnel - gtp: destroy device along with udp socket's netns dismantle. - xilinx: axienet: Fix IRQ coalescing packet count overflow" * tag 'net-6.13-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (44 commits) netdev: avoid CFI problems with sock priv helpers net/mlx5e: Always start IPsec sequence number from 1 net/mlx5e: Rely on reqid in IPsec tunnel mode net/mlx5e: Fix inversion dependency warning while enabling IPsec tunnel net/mlx5: Clear port select structure when fail to create net/mlx5: SF, Fix add port error handling net/mlx5: Fix a lockdep warning as part of the write combining test net/mlx5: Fix RDMA TX steering prio net: make page_pool_ref_netmem work with net iovs net: ethernet: xgbe: re-add aneg to supported features in PHY quirks net: pcs: xpcs: actively unset DW_VR_MII_DIG_CTRL1_2G5_EN for 1G SGMII net: pcs: xpcs: fix DW_VR_MII_DIG_CTRL1_2G5_EN bit being set for 1G SGMII w/o inband selftests: net: Adapt ethtool mq tests to fix in qdisc graft net: fec: handle page_pool_dev_alloc_pages error net: netpoll: ensure skb_pool list is always initialized net: xilinx: axienet: Fix IRQ coalescing packet count overflow nfp: bpf: prevent integer overflow in nfp_bpf_event_output() selftests: mptcp: avoid spurious errors on disconnect mptcp: fix spurious wake-up on under memory pressure mptcp: be sure to send ack when mptcp-level window re-opens ...
2 parents 6b4ccf1 + a50da36 commit ce69b40

Some content is hidden

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

54 files changed

+552
-399
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,6 @@ static void xgbe_phy_free_phy_device(struct xgbe_prv_data *pdata)
923923

924924
static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
925925
{
926-
__ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
927926
struct xgbe_phy_data *phy_data = pdata->phy_data;
928927
unsigned int phy_id = phy_data->phydev->phy_id;
929928

@@ -945,14 +944,7 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
945944
phy_write(phy_data->phydev, 0x04, 0x0d01);
946945
phy_write(phy_data->phydev, 0x00, 0x9140);
947946

948-
linkmode_set_bit_array(phy_10_100_features_array,
949-
ARRAY_SIZE(phy_10_100_features_array),
950-
supported);
951-
linkmode_set_bit_array(phy_gbit_features_array,
952-
ARRAY_SIZE(phy_gbit_features_array),
953-
supported);
954-
955-
linkmode_copy(phy_data->phydev->supported, supported);
947+
linkmode_copy(phy_data->phydev->supported, PHY_GBIT_FEATURES);
956948

957949
phy_support_asym_pause(phy_data->phydev);
958950

@@ -964,7 +956,6 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
964956

965957
static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
966958
{
967-
__ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
968959
struct xgbe_phy_data *phy_data = pdata->phy_data;
969960
struct xgbe_sfp_eeprom *sfp_eeprom = &phy_data->sfp_eeprom;
970961
unsigned int phy_id = phy_data->phydev->phy_id;
@@ -1028,13 +1019,7 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
10281019
reg = phy_read(phy_data->phydev, 0x00);
10291020
phy_write(phy_data->phydev, 0x00, reg & ~0x00800);
10301021

1031-
linkmode_set_bit_array(phy_10_100_features_array,
1032-
ARRAY_SIZE(phy_10_100_features_array),
1033-
supported);
1034-
linkmode_set_bit_array(phy_gbit_features_array,
1035-
ARRAY_SIZE(phy_gbit_features_array),
1036-
supported);
1037-
linkmode_copy(phy_data->phydev->supported, supported);
1022+
linkmode_copy(phy_data->phydev->supported, PHY_GBIT_FEATURES);
10381023
phy_support_asym_pause(phy_data->phydev);
10391024

10401025
netif_dbg(pdata, drv, pdata->netdev,

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4708,7 +4708,7 @@ void bnxt_set_ring_params(struct bnxt *bp)
47084708
/* Changing allocation mode of RX rings.
47094709
* TODO: Update when extending xdp_rxq_info to support allocation modes.
47104710
*/
4711-
int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
4711+
static void __bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
47124712
{
47134713
struct net_device *dev = bp->dev;
47144714

@@ -4729,15 +4729,30 @@ int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
47294729
bp->rx_skb_func = bnxt_rx_page_skb;
47304730
}
47314731
bp->rx_dir = DMA_BIDIRECTIONAL;
4732-
/* Disable LRO or GRO_HW */
4733-
netdev_update_features(dev);
47344732
} else {
47354733
dev->max_mtu = bp->max_mtu;
47364734
bp->flags &= ~BNXT_FLAG_RX_PAGE_MODE;
47374735
bp->rx_dir = DMA_FROM_DEVICE;
47384736
bp->rx_skb_func = bnxt_rx_skb;
47394737
}
4740-
return 0;
4738+
}
4739+
4740+
void bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
4741+
{
4742+
__bnxt_set_rx_skb_mode(bp, page_mode);
4743+
4744+
if (!page_mode) {
4745+
int rx, tx;
4746+
4747+
bnxt_get_max_rings(bp, &rx, &tx, true);
4748+
if (rx > 1) {
4749+
bp->flags &= ~BNXT_FLAG_NO_AGG_RINGS;
4750+
bp->dev->hw_features |= NETIF_F_LRO;
4751+
}
4752+
}
4753+
4754+
/* Update LRO and GRO_HW availability */
4755+
netdev_update_features(bp->dev);
47414756
}
47424757

47434758
static void bnxt_free_vnic_attributes(struct bnxt *bp)
@@ -16214,7 +16229,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1621416229
if (bp->max_fltr < BNXT_MAX_FLTR)
1621516230
bp->max_fltr = BNXT_MAX_FLTR;
1621616231
bnxt_init_l2_fltr_tbl(bp);
16217-
bnxt_set_rx_skb_mode(bp, false);
16232+
__bnxt_set_rx_skb_mode(bp, false);
1621816233
bnxt_set_tpa_flags(bp);
1621916234
bnxt_set_ring_params(bp);
1622016235
bnxt_rdma_aux_device_init(bp);

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2846,7 +2846,7 @@ u32 bnxt_fw_health_readl(struct bnxt *bp, int reg_idx);
28462846
bool bnxt_bs_trace_avail(struct bnxt *bp, u16 type);
28472847
void bnxt_set_tpa_flags(struct bnxt *bp);
28482848
void bnxt_set_ring_params(struct bnxt *);
2849-
int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode);
2849+
void bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode);
28502850
void bnxt_insert_usr_fltr(struct bnxt *bp, struct bnxt_filter_base *fltr);
28512851
void bnxt_del_one_usr_fltr(struct bnxt *bp, struct bnxt_filter_base *fltr);
28522852
int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap,

drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,8 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
422422
bnxt_set_rx_skb_mode(bp, true);
423423
xdp_features_set_redirect_target(dev, true);
424424
} else {
425-
int rx, tx;
426-
427425
xdp_features_clear_redirect_target(dev);
428426
bnxt_set_rx_skb_mode(bp, false);
429-
bnxt_get_max_rings(bp, &rx, &tx, true);
430-
if (rx > 1) {
431-
bp->flags &= ~BNXT_FLAG_NO_AGG_RINGS;
432-
bp->dev->hw_features |= NETIF_F_LRO;
433-
}
434427
}
435428
bp->tx_nr_rings_xdp = tx_xdp;
436429
bp->tx_nr_rings = bp->tx_nr_rings_per_tc * tc + tx_xdp;

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,19 +1591,22 @@ static void fec_enet_tx(struct net_device *ndev, int budget)
15911591
fec_enet_tx_queue(ndev, i, budget);
15921592
}
15931593

1594-
static void fec_enet_update_cbd(struct fec_enet_priv_rx_q *rxq,
1594+
static int fec_enet_update_cbd(struct fec_enet_priv_rx_q *rxq,
15951595
struct bufdesc *bdp, int index)
15961596
{
15971597
struct page *new_page;
15981598
dma_addr_t phys_addr;
15991599

16001600
new_page = page_pool_dev_alloc_pages(rxq->page_pool);
1601-
WARN_ON(!new_page);
1602-
rxq->rx_skb_info[index].page = new_page;
1601+
if (unlikely(!new_page))
1602+
return -ENOMEM;
16031603

1604+
rxq->rx_skb_info[index].page = new_page;
16041605
rxq->rx_skb_info[index].offset = FEC_ENET_XDP_HEADROOM;
16051606
phys_addr = page_pool_get_dma_addr(new_page) + FEC_ENET_XDP_HEADROOM;
16061607
bdp->cbd_bufaddr = cpu_to_fec32(phys_addr);
1608+
1609+
return 0;
16071610
}
16081611

16091612
static u32
@@ -1698,6 +1701,7 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
16981701
int cpu = smp_processor_id();
16991702
struct xdp_buff xdp;
17001703
struct page *page;
1704+
__fec32 cbd_bufaddr;
17011705
u32 sub_len = 4;
17021706

17031707
#if !defined(CONFIG_M5272)
@@ -1766,12 +1770,17 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
17661770

17671771
index = fec_enet_get_bd_index(bdp, &rxq->bd);
17681772
page = rxq->rx_skb_info[index].page;
1773+
cbd_bufaddr = bdp->cbd_bufaddr;
1774+
if (fec_enet_update_cbd(rxq, bdp, index)) {
1775+
ndev->stats.rx_dropped++;
1776+
goto rx_processing_done;
1777+
}
1778+
17691779
dma_sync_single_for_cpu(&fep->pdev->dev,
1770-
fec32_to_cpu(bdp->cbd_bufaddr),
1780+
fec32_to_cpu(cbd_bufaddr),
17711781
pkt_len,
17721782
DMA_FROM_DEVICE);
17731783
prefetch(page_address(page));
1774-
fec_enet_update_cbd(rxq, bdp, index);
17751784

17761785
if (xdp_prog) {
17771786
xdp_buff_clear_frags_flag(&xdp);

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,6 +1665,7 @@ struct ice_aqc_get_port_options_elem {
16651665
#define ICE_AQC_PORT_OPT_MAX_LANE_25G 5
16661666
#define ICE_AQC_PORT_OPT_MAX_LANE_50G 6
16671667
#define ICE_AQC_PORT_OPT_MAX_LANE_100G 7
1668+
#define ICE_AQC_PORT_OPT_MAX_LANE_200G 8
16681669

16691670
u8 global_scid[2];
16701671
u8 phy_scid[2];

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4095,6 +4095,57 @@ ice_aq_set_port_option(struct ice_hw *hw, u8 lport, u8 lport_valid,
40954095
return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);
40964096
}
40974097

4098+
/**
4099+
* ice_get_phy_lane_number - Get PHY lane number for current adapter
4100+
* @hw: pointer to the hw struct
4101+
*
4102+
* Return: PHY lane number on success, negative error code otherwise.
4103+
*/
4104+
int ice_get_phy_lane_number(struct ice_hw *hw)
4105+
{
4106+
struct ice_aqc_get_port_options_elem *options;
4107+
unsigned int lport = 0;
4108+
unsigned int lane;
4109+
int err;
4110+
4111+
options = kcalloc(ICE_AQC_PORT_OPT_MAX, sizeof(*options), GFP_KERNEL);
4112+
if (!options)
4113+
return -ENOMEM;
4114+
4115+
for (lane = 0; lane < ICE_MAX_PORT_PER_PCI_DEV; lane++) {
4116+
u8 options_count = ICE_AQC_PORT_OPT_MAX;
4117+
u8 speed, active_idx, pending_idx;
4118+
bool active_valid, pending_valid;
4119+
4120+
err = ice_aq_get_port_options(hw, options, &options_count, lane,
4121+
true, &active_idx, &active_valid,
4122+
&pending_idx, &pending_valid);
4123+
if (err)
4124+
goto err;
4125+
4126+
if (!active_valid)
4127+
continue;
4128+
4129+
speed = options[active_idx].max_lane_speed;
4130+
/* If we don't get speed for this lane, it's unoccupied */
4131+
if (speed > ICE_AQC_PORT_OPT_MAX_LANE_200G)
4132+
continue;
4133+
4134+
if (hw->pf_id == lport) {
4135+
kfree(options);
4136+
return lane;
4137+
}
4138+
4139+
lport++;
4140+
}
4141+
4142+
/* PHY lane not found */
4143+
err = -ENXIO;
4144+
err:
4145+
kfree(options);
4146+
return err;
4147+
}
4148+
40984149
/**
40994150
* ice_aq_sff_eeprom
41004151
* @hw: pointer to the HW struct

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ ice_aq_get_port_options(struct ice_hw *hw,
193193
int
194194
ice_aq_set_port_option(struct ice_hw *hw, u8 lport, u8 lport_valid,
195195
u8 new_option);
196+
int ice_get_phy_lane_number(struct ice_hw *hw);
196197
int
197198
ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr,
198199
u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length,

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,
11441144
if (link_up == old_link && link_speed == old_link_speed)
11451145
return 0;
11461146

1147-
ice_ptp_link_change(pf, pf->hw.pf_id, link_up);
1147+
ice_ptp_link_change(pf, link_up);
11481148

11491149
if (ice_is_dcb_active(pf)) {
11501150
if (test_bit(ICE_FLAG_DCB_ENA, pf->flags))
@@ -6790,7 +6790,7 @@ static int ice_up_complete(struct ice_vsi *vsi)
67906790
ice_print_link_msg(vsi, true);
67916791
netif_tx_start_all_queues(vsi->netdev);
67926792
netif_carrier_on(vsi->netdev);
6793-
ice_ptp_link_change(pf, pf->hw.pf_id, true);
6793+
ice_ptp_link_change(pf, true);
67946794
}
67956795

67966796
/* Perform an initial read of the statistics registers now to
@@ -7260,7 +7260,7 @@ int ice_down(struct ice_vsi *vsi)
72607260

72617261
if (vsi->netdev) {
72627262
vlan_err = ice_vsi_del_vlan_zero(vsi);
7263-
ice_ptp_link_change(vsi->back, vsi->back->hw.pf_id, false);
7263+
ice_ptp_link_change(vsi->back, false);
72647264
netif_carrier_off(vsi->netdev);
72657265
netif_tx_disable(vsi->netdev);
72667266
}

drivers/net/ethernet/intel/ice/ice_ptp.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,25 +1388,17 @@ ice_ptp_port_phy_restart(struct ice_ptp_port *ptp_port)
13881388
/**
13891389
* ice_ptp_link_change - Reconfigure PTP after link status change
13901390
* @pf: Board private structure
1391-
* @port: Port for which the PHY start is set
13921391
* @linkup: Link is up or down
13931392
*/
1394-
void ice_ptp_link_change(struct ice_pf *pf, u8 port, bool linkup)
1393+
void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
13951394
{
13961395
struct ice_ptp_port *ptp_port;
13971396
struct ice_hw *hw = &pf->hw;
13981397

13991398
if (pf->ptp.state != ICE_PTP_READY)
14001399
return;
14011400

1402-
if (WARN_ON_ONCE(port >= hw->ptp.num_lports))
1403-
return;
1404-
14051401
ptp_port = &pf->ptp.port;
1406-
if (ice_is_e825c(hw) && hw->ptp.is_2x50g_muxed_topo)
1407-
port *= 2;
1408-
if (WARN_ON_ONCE(ptp_port->port_num != port))
1409-
return;
14101402

14111403
/* Update cached link status for this port immediately */
14121404
ptp_port->link_up = linkup;
@@ -3164,10 +3156,17 @@ void ice_ptp_init(struct ice_pf *pf)
31643156
{
31653157
struct ice_ptp *ptp = &pf->ptp;
31663158
struct ice_hw *hw = &pf->hw;
3167-
int err;
3159+
int lane_num, err;
31683160

31693161
ptp->state = ICE_PTP_INITIALIZING;
31703162

3163+
lane_num = ice_get_phy_lane_number(hw);
3164+
if (lane_num < 0) {
3165+
err = lane_num;
3166+
goto err_exit;
3167+
}
3168+
3169+
ptp->port.port_num = (u8)lane_num;
31713170
ice_ptp_init_hw(hw);
31723171

31733172
ice_ptp_init_tx_interrupt_mode(pf);
@@ -3188,10 +3187,6 @@ void ice_ptp_init(struct ice_pf *pf)
31883187
if (err)
31893188
goto err_exit;
31903189

3191-
ptp->port.port_num = hw->pf_id;
3192-
if (ice_is_e825c(hw) && hw->ptp.is_2x50g_muxed_topo)
3193-
ptp->port.port_num = hw->pf_id * 2;
3194-
31953190
err = ice_ptp_init_port(pf, &ptp->port);
31963191
if (err)
31973192
goto err_exit;

0 commit comments

Comments
 (0)