Skip to content

Commit 3ac88fa

Browse files
committed
Merge tag 'net-6.2-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Fixes from the main networking tree only, probably because all sub-trees have backed off and haven't submitted their changes. None of the fixes here are particularly scary and no outstanding regressions. In an ideal world the "current release" sections would be empty at this stage but that never happens. Current release - regressions: - fix unwanted sign extension in netdev_stats_to_stats64() Current release - new code bugs: - initialize net->notrefcnt_tracker earlier - devlink: fix netdev notifier chain corruption - nfp: make sure mbox accesses in IPsec code are atomic - ice: fix check for weight and priority of a scheduling node Previous releases - regressions: - ice: xsk: fix cleaning of XDP_TX frame, prevent inf loop - igb: fix I2C bit banging config with external thermal sensor Previous releases - always broken: - sched: tcindex: update imperfect hash filters respecting rcu - mpls: fix stale pointer if allocation fails during device rename - dccp/tcp: avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions - remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues() - af_key: fix heap information leak - ipv6: fix socket connection with DSCP (correct interpretation of the tclass field vs fib rule matching) - tipc: fix kernel warning when sending SYN message - vmxnet3: read RSS information from the correct descriptor (eop)" * tag 'net-6.2-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (35 commits) devlink: Fix netdev notifier chain corruption igb: conditionalize I2C bit banging on external thermal sensor support net: mpls: fix stale pointer if allocation fails during device rename net/sched: tcindex: search key must be 16 bits tipc: fix kernel warning when sending SYN message igb: Fix PPS input and output using 3rd and 4th SDP net: use a bounce buffer for copying skb->mark ixgbe: add double of VLAN header when computing the max MTU i40e: add double of VLAN header when computing the max MTU ixgbe: allow to increase MTU to 3K with XDP enabled net: stmmac: Restrict warning on disabling DMA store and fwd mode net/sched: act_ctinfo: use percpu stats net: stmmac: fix order of dwmac5 FlexPPS parametrization sequence ice: fix lost multicast packets in promisc mode ice: Fix check for weight and priority of a scheduling node bnxt_en: Fix mqprio and XDP ring checking logic net: Fix unwanted sign extension in netdev_stats_to_stats64() net/usb: kalmia: Don't pass act_len in usb_bulk_msg error path net: openvswitch: fix possible memory leak in ovs_meter_cmd_set() af_key: Fix heap information leak ...
2 parents d3d6f0e + b20b8ae commit 3ac88fa

File tree

39 files changed

+508
-194
lines changed

39 files changed

+508
-194
lines changed

drivers/net/ethernet/broadcom/bgmac-bcma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_device *core)
240240
bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
241241
bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
242242
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
243-
if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
244-
ci->pkg == BCMA_PKG_ID_BCM47186) {
243+
if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
244+
(ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
245245
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
246246
bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
247247
}
248-
if (ci->pkg == BCMA_PKG_ID_BCM5358)
248+
if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
249249
bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
250250
break;
251251
case BCMA_CHIP_ID_BCM53573:

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9274,10 +9274,14 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
92749274
netdev_err(bp->dev, "ring reservation/IRQ init failure rc: %d\n", rc);
92759275
return rc;
92769276
}
9277-
if (tcs && (bp->tx_nr_rings_per_tc * tcs != bp->tx_nr_rings)) {
9277+
if (tcs && (bp->tx_nr_rings_per_tc * tcs !=
9278+
bp->tx_nr_rings - bp->tx_nr_rings_xdp)) {
92789279
netdev_err(bp->dev, "tx ring reservation failure\n");
92799280
netdev_reset_tc(bp->dev);
9280-
bp->tx_nr_rings_per_tc = bp->tx_nr_rings;
9281+
if (bp->tx_nr_rings_xdp)
9282+
bp->tx_nr_rings_per_tc = bp->tx_nr_rings_xdp;
9283+
else
9284+
bp->tx_nr_rings_per_tc = bp->tx_nr_rings;
92819285
return -ENOMEM;
92829286
}
92839287
return 0;

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2921,7 +2921,7 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)
29212921
struct i40e_pf *pf = vsi->back;
29222922

29232923
if (i40e_enabled_xdp_vsi(vsi)) {
2924-
int frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
2924+
int frame_size = new_mtu + I40E_PACKET_HDR_PAD;
29252925

29262926
if (frame_size > i40e_max_xdp_frame_size(vsi))
29272927
return -EINVAL;
@@ -13167,6 +13167,8 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev,
1316713167
}
1316813168

1316913169
br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
13170+
if (!br_spec)
13171+
return -EINVAL;
1317013172

1317113173
nla_for_each_nested(attr, br_spec, rem) {
1317213174
__u16 mode;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static int ice_set_object_tx_priority(struct ice_port_info *pi, struct ice_sched
899899
{
900900
int status;
901901

902-
if (node->tx_priority >= 8) {
902+
if (priority >= 8) {
903903
NL_SET_ERR_MSG_MOD(extack, "Priority should be less than 8");
904904
return -EINVAL;
905905
}
@@ -929,7 +929,7 @@ static int ice_set_object_tx_weight(struct ice_port_info *pi, struct ice_sched_n
929929
{
930930
int status;
931931

932-
if (node->tx_weight > 200 || node->tx_weight < 1) {
932+
if (weight > 200 || weight < 1) {
933933
NL_SET_ERR_MSG_MOD(extack, "Weight must be between 1 and 200");
934934
return -EINVAL;
935935
}

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m)
275275
if (status && status != -EEXIST)
276276
return status;
277277

278+
netdev_dbg(vsi->netdev, "set promisc filter bits for VSI %i: 0x%x\n",
279+
vsi->vsi_num, promisc_m);
278280
return 0;
279281
}
280282

@@ -300,6 +302,8 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)
300302
promisc_m, 0);
301303
}
302304

305+
netdev_dbg(vsi->netdev, "clear promisc filter bits for VSI %i: 0x%x\n",
306+
vsi->vsi_num, promisc_m);
303307
return status;
304308
}
305309

@@ -414,6 +418,16 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
414418
}
415419
err = 0;
416420
vlan_ops->dis_rx_filtering(vsi);
421+
422+
/* promiscuous mode implies allmulticast so
423+
* that VSIs that are in promiscuous mode are
424+
* subscribed to multicast packets coming to
425+
* the port
426+
*/
427+
err = ice_set_promisc(vsi,
428+
ICE_MCAST_PROMISC_BITS);
429+
if (err)
430+
goto out_promisc;
417431
}
418432
} else {
419433
/* Clear Rx filter to remove traffic from wire */
@@ -430,6 +444,18 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
430444
NETIF_F_HW_VLAN_CTAG_FILTER)
431445
vlan_ops->ena_rx_filtering(vsi);
432446
}
447+
448+
/* disable allmulti here, but only if allmulti is not
449+
* still enabled for the netdev
450+
*/
451+
if (!(vsi->current_netdev_flags & IFF_ALLMULTI)) {
452+
err = ice_clear_promisc(vsi,
453+
ICE_MCAST_PROMISC_BITS);
454+
if (err) {
455+
netdev_err(netdev, "Error %d clearing multicast promiscuous on VSI %i\n",
456+
err, vsi->vsi_num);
457+
}
458+
}
433459
}
434460
}
435461
goto exit;

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ static void ice_clean_xdp_irq_zc(struct ice_tx_ring *xdp_ring)
800800
struct ice_tx_desc *tx_desc;
801801
u16 cnt = xdp_ring->count;
802802
struct ice_tx_buf *tx_buf;
803+
u16 completed_frames = 0;
803804
u16 xsk_frames = 0;
804805
u16 last_rs;
805806
int i;
@@ -809,19 +810,21 @@ static void ice_clean_xdp_irq_zc(struct ice_tx_ring *xdp_ring)
809810
if ((tx_desc->cmd_type_offset_bsz &
810811
cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE))) {
811812
if (last_rs >= ntc)
812-
xsk_frames = last_rs - ntc + 1;
813+
completed_frames = last_rs - ntc + 1;
813814
else
814-
xsk_frames = last_rs + cnt - ntc + 1;
815+
completed_frames = last_rs + cnt - ntc + 1;
815816
}
816817

817-
if (!xsk_frames)
818+
if (!completed_frames)
818819
return;
819820

820-
if (likely(!xdp_ring->xdp_tx_active))
821+
if (likely(!xdp_ring->xdp_tx_active)) {
822+
xsk_frames = completed_frames;
821823
goto skip;
824+
}
822825

823826
ntc = xdp_ring->next_to_clean;
824-
for (i = 0; i < xsk_frames; i++) {
827+
for (i = 0; i < completed_frames; i++) {
825828
tx_buf = &xdp_ring->tx_buf[ntc];
826829

827830
if (tx_buf->raw_buf) {
@@ -837,7 +840,7 @@ static void ice_clean_xdp_irq_zc(struct ice_tx_ring *xdp_ring)
837840
}
838841
skip:
839842
tx_desc->cmd_type_offset_bsz = 0;
840-
xdp_ring->next_to_clean += xsk_frames;
843+
xdp_ring->next_to_clean += completed_frames;
841844
if (xdp_ring->next_to_clean >= cnt)
842845
xdp_ring->next_to_clean -= cnt;
843846
if (xsk_frames)

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,6 +2256,30 @@ static void igb_enable_mas(struct igb_adapter *adapter)
22562256
}
22572257
}
22582258

2259+
#ifdef CONFIG_IGB_HWMON
2260+
/**
2261+
* igb_set_i2c_bb - Init I2C interface
2262+
* @hw: pointer to hardware structure
2263+
**/
2264+
static void igb_set_i2c_bb(struct e1000_hw *hw)
2265+
{
2266+
u32 ctrl_ext;
2267+
s32 i2cctl;
2268+
2269+
ctrl_ext = rd32(E1000_CTRL_EXT);
2270+
ctrl_ext |= E1000_CTRL_I2C_ENA;
2271+
wr32(E1000_CTRL_EXT, ctrl_ext);
2272+
wrfl();
2273+
2274+
i2cctl = rd32(E1000_I2CPARAMS);
2275+
i2cctl |= E1000_I2CBB_EN
2276+
| E1000_I2C_CLK_OE_N
2277+
| E1000_I2C_DATA_OE_N;
2278+
wr32(E1000_I2CPARAMS, i2cctl);
2279+
wrfl();
2280+
}
2281+
#endif
2282+
22592283
void igb_reset(struct igb_adapter *adapter)
22602284
{
22612285
struct pci_dev *pdev = adapter->pdev;
@@ -2400,7 +2424,8 @@ void igb_reset(struct igb_adapter *adapter)
24002424
* interface.
24012425
*/
24022426
if (adapter->ets)
2403-
mac->ops.init_thermal_sensor_thresh(hw);
2427+
igb_set_i2c_bb(hw);
2428+
mac->ops.init_thermal_sensor_thresh(hw);
24042429
}
24052430
}
24062431
#endif
@@ -3117,21 +3142,12 @@ static void igb_init_mas(struct igb_adapter *adapter)
31173142
**/
31183143
static s32 igb_init_i2c(struct igb_adapter *adapter)
31193144
{
3120-
struct e1000_hw *hw = &adapter->hw;
31213145
s32 status = 0;
3122-
s32 i2cctl;
31233146

31243147
/* I2C interface supported on i350 devices */
31253148
if (adapter->hw.mac.type != e1000_i350)
31263149
return 0;
31273150

3128-
i2cctl = rd32(E1000_I2CPARAMS);
3129-
i2cctl |= E1000_I2CBB_EN
3130-
| E1000_I2C_CLK_OUT | E1000_I2C_CLK_OE_N
3131-
| E1000_I2C_DATA_OUT | E1000_I2C_DATA_OE_N;
3132-
wr32(E1000_I2CPARAMS, i2cctl);
3133-
wrfl();
3134-
31353151
/* Initialize the i2c bus which is controlled by the registers.
31363152
* This bus will use the i2c_algo_bit structure that implements
31373153
* the protocol through toggling of the 4 bits in the register.
@@ -3521,6 +3537,12 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
35213537
adapter->ets = true;
35223538
else
35233539
adapter->ets = false;
3540+
/* Only enable I2C bit banging if an external thermal
3541+
* sensor is supported.
3542+
*/
3543+
if (adapter->ets)
3544+
igb_set_i2c_bb(hw);
3545+
hw->mac.ops.init_thermal_sensor_thresh(hw);
35243546
if (igb_sysfs_init(adapter))
35253547
dev_err(&pdev->dev,
35263548
"failed to allocate sysfs resources\n");
@@ -6794,15 +6816,15 @@ static void igb_perout(struct igb_adapter *adapter, int tsintr_tt)
67946816
struct timespec64 ts;
67956817
u32 tsauxc;
67966818

6797-
if (pin < 0 || pin >= IGB_N_PEROUT)
6819+
if (pin < 0 || pin >= IGB_N_SDP)
67986820
return;
67996821

68006822
spin_lock(&adapter->tmreg_lock);
68016823

68026824
if (hw->mac.type == e1000_82580 ||
68036825
hw->mac.type == e1000_i354 ||
68046826
hw->mac.type == e1000_i350) {
6805-
s64 ns = timespec64_to_ns(&adapter->perout[pin].period);
6827+
s64 ns = timespec64_to_ns(&adapter->perout[tsintr_tt].period);
68066828
u32 systiml, systimh, level_mask, level, rem;
68076829
u64 systim, now;
68086830

@@ -6850,8 +6872,8 @@ static void igb_perout(struct igb_adapter *adapter, int tsintr_tt)
68506872
ts.tv_nsec = (u32)systim;
68516873
ts.tv_sec = ((u32)(systim >> 32)) & 0xFF;
68526874
} else {
6853-
ts = timespec64_add(adapter->perout[pin].start,
6854-
adapter->perout[pin].period);
6875+
ts = timespec64_add(adapter->perout[tsintr_tt].start,
6876+
adapter->perout[tsintr_tt].period);
68556877
}
68566878

68576879
/* u32 conversion of tv_sec is safe until y2106 */
@@ -6860,7 +6882,7 @@ static void igb_perout(struct igb_adapter *adapter, int tsintr_tt)
68606882
tsauxc = rd32(E1000_TSAUXC);
68616883
tsauxc |= TSAUXC_EN_TT0;
68626884
wr32(E1000_TSAUXC, tsauxc);
6863-
adapter->perout[pin].start = ts;
6885+
adapter->perout[tsintr_tt].start = ts;
68646886

68656887
spin_unlock(&adapter->tmreg_lock);
68666888
}
@@ -6874,7 +6896,7 @@ static void igb_extts(struct igb_adapter *adapter, int tsintr_tt)
68746896
struct ptp_clock_event event;
68756897
struct timespec64 ts;
68766898

6877-
if (pin < 0 || pin >= IGB_N_EXTTS)
6899+
if (pin < 0 || pin >= IGB_N_SDP)
68786900
return;
68796901

68806902
if (hw->mac.type == e1000_82580 ||

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
#define IXGBE_RXBUFFER_4K 4096
7474
#define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */
7575

76+
#define IXGBE_PKT_HDR_PAD (ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2))
77+
7678
/* Attempt to maximize the headroom available for incoming frames. We
7779
* use a 2K buffer for receives and need 1536/1534 to store the data for
7880
* the frame. This leaves us with 512 bytes of room. From that we need

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6777,6 +6777,18 @@ static void ixgbe_free_all_rx_resources(struct ixgbe_adapter *adapter)
67776777
ixgbe_free_rx_resources(adapter->rx_ring[i]);
67786778
}
67796779

6780+
/**
6781+
* ixgbe_max_xdp_frame_size - returns the maximum allowed frame size for XDP
6782+
* @adapter: device handle, pointer to adapter
6783+
*/
6784+
static int ixgbe_max_xdp_frame_size(struct ixgbe_adapter *adapter)
6785+
{
6786+
if (PAGE_SIZE >= 8192 || adapter->flags2 & IXGBE_FLAG2_RX_LEGACY)
6787+
return IXGBE_RXBUFFER_2K;
6788+
else
6789+
return IXGBE_RXBUFFER_3K;
6790+
}
6791+
67806792
/**
67816793
* ixgbe_change_mtu - Change the Maximum Transfer Unit
67826794
* @netdev: network interface device structure
@@ -6788,18 +6800,12 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
67886800
{
67896801
struct ixgbe_adapter *adapter = netdev_priv(netdev);
67906802

6791-
if (adapter->xdp_prog) {
6792-
int new_frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN +
6793-
VLAN_HLEN;
6794-
int i;
6795-
6796-
for (i = 0; i < adapter->num_rx_queues; i++) {
6797-
struct ixgbe_ring *ring = adapter->rx_ring[i];
6803+
if (ixgbe_enabled_xdp_adapter(adapter)) {
6804+
int new_frame_size = new_mtu + IXGBE_PKT_HDR_PAD;
67986805

6799-
if (new_frame_size > ixgbe_rx_bufsz(ring)) {
6800-
e_warn(probe, "Requested MTU size is not supported with XDP\n");
6801-
return -EINVAL;
6802-
}
6806+
if (new_frame_size > ixgbe_max_xdp_frame_size(adapter)) {
6807+
e_warn(probe, "Requested MTU size is not supported with XDP\n");
6808+
return -EINVAL;
68036809
}
68046810
}
68056811

0 commit comments

Comments
 (0)