Skip to content

Commit 0e8860d

Browse files
committed
Merge tag 'net-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from ipsec and netfilter. No known outstanding regressions. Fixes to fixes: - virtio-net: set queues after driver_ok, avoid a potential race added by recent fix - Revert "vlan: Fix VLAN 0 memory leak", it may lead to a warning when VLAN 0 is registered explicitly - nf_tables: - fix false-positive lockdep splat in recent fixes - don't fail inserts if duplicate has expired (fix test failures) - fix races between garbage collection and netns dismantle Current release - new code bugs: - mlx5: Fix mlx5_cmd_update_root_ft() error flow Previous releases - regressions: - phy: fix IRQ-based wake-on-lan over hibernate / power off Previous releases - always broken: - sock: fix misuse of sk_under_memory_pressure() preventing system from exiting global TCP memory pressure if a single cgroup is under pressure - fix the RTO timer retransmitting skb every 1ms if linear option is enabled - af_key: fix sadb_x_filter validation, amment netlink policy - ipsec: fix slab-use-after-free in decode_session6() - macb: in ZynqMP resume always configure PS GTR for non-wakeup source Misc: - netfilter: set default timeout to 3 secs for sctp shutdown send and recv state (from 300ms), align with protocol timers" * tag 'net-6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (49 commits) ice: Block switchdev mode when ADQ is active and vice versa qede: fix firmware halt over suspend and resume net: do not allow gso_size to be set to GSO_BY_FRAGS sock: Fix misuse of sk_under_memory_pressure() sfc: don't fail probe if MAE/TC setup fails sfc: don't unregister flow_indr if it was never registered net: dsa: mv88e6xxx: Wait for EEPROM done before HW reset net/mlx5: Fix mlx5_cmd_update_root_ft() error flow net/mlx5e: XDP, Fix fifo overrun on XDP_REDIRECT i40e: fix misleading debug logs iavf: fix FDIR rule fields masks validation ipv6: fix indentation of a config attribute mailmap: add entries for Simon Horman broadcom: b44: Use b44_writephy() return value net: openvswitch: reject negative ifindex team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves net: phy: broadcom: stub c45 read/write for 54810 netfilter: nft_dynset: disallow object maps netfilter: nf_tables: GC transaction race with netns dismantle netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path ...
2 parents 1ada9c0 + 820a38d commit 0e8860d

File tree

48 files changed

+313
-118
lines changed

Some content is hidden

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

48 files changed

+313
-118
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,8 @@ Shuah Khan <shuah@kernel.org> <shuah.kh@samsung.com>
538538
Sibi Sankar <quic_sibis@quicinc.com> <sibis@codeaurora.org>
539539
Sid Manning <quic_sidneym@quicinc.com> <sidneym@codeaurora.org>
540540
Simon Arlott <simon@octiron.net> <simon@fire.lp0.eu>
541+
Simon Horman <horms@kernel.org> <simon.horman@corigine.com>
542+
Simon Horman <horms@kernel.org> <simon.horman@netronome.com>
541543
Simon Kelley <simon@thekelleys.org.uk>
542544
Sricharan Ramabadhran <quic_srichara@quicinc.com> <sricharan@codeaurora.org>
543545
Srinivas Ramana <quic_sramana@quicinc.com> <sramana@codeaurora.org>

Documentation/networking/nf_conntrack-sysctl.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ nf_conntrack_sctp_timeout_established - INTEGER (seconds)
178178
Default is set to (hb_interval * path_max_retrans + rto_max)
179179

180180
nf_conntrack_sctp_timeout_shutdown_sent - INTEGER (seconds)
181-
default 0.3
181+
default 3
182182

183183
nf_conntrack_sctp_timeout_shutdown_recd - INTEGER (seconds)
184-
default 0.3
184+
default 3
185185

186186
nf_conntrack_sctp_timeout_shutdown_ack_sent - INTEGER (seconds)
187187
default 3

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,6 +3034,14 @@ static void mv88e6xxx_hardware_reset(struct mv88e6xxx_chip *chip)
30343034

30353035
/* If there is a GPIO connected to the reset pin, toggle it */
30363036
if (gpiod) {
3037+
/* If the switch has just been reset and not yet completed
3038+
* loading EEPROM, the reset may interrupt the I2C transaction
3039+
* mid-byte, causing the first EEPROM read after the reset
3040+
* from the wrong location resulting in the switch booting
3041+
* to wrong mode and inoperable.
3042+
*/
3043+
mv88e6xxx_g1_wait_eeprom_done(chip);
3044+
30373045
gpiod_set_value_cansleep(gpiod, 1);
30383046
usleep_range(10000, 20000);
30393047
gpiod_set_value_cansleep(gpiod, 0);

drivers/net/ethernet/broadcom/b44.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,11 +1793,9 @@ static int b44_nway_reset(struct net_device *dev)
17931793
b44_readphy(bp, MII_BMCR, &bmcr);
17941794
b44_readphy(bp, MII_BMCR, &bmcr);
17951795
r = -EINVAL;
1796-
if (bmcr & BMCR_ANENABLE) {
1797-
b44_writephy(bp, MII_BMCR,
1798-
bmcr | BMCR_ANRESTART);
1799-
r = 0;
1800-
}
1796+
if (bmcr & BMCR_ANENABLE)
1797+
r = b44_writephy(bp, MII_BMCR,
1798+
bmcr | BMCR_ANRESTART);
18011799
spin_unlock_irq(&bp->lock);
18021800

18031801
return r;

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5194,6 +5194,9 @@ static int __maybe_unused macb_suspend(struct device *dev)
51945194
unsigned int q;
51955195
int err;
51965196

5197+
if (!device_may_wakeup(&bp->dev->dev))
5198+
phy_exit(bp->sgmii_phy);
5199+
51975200
if (!netif_running(netdev))
51985201
return 0;
51995202

@@ -5254,7 +5257,6 @@ static int __maybe_unused macb_suspend(struct device *dev)
52545257
if (!(bp->wol & MACB_WOL_ENABLED)) {
52555258
rtnl_lock();
52565259
phylink_stop(bp->phylink);
5257-
phy_exit(bp->sgmii_phy);
52585260
rtnl_unlock();
52595261
spin_lock_irqsave(&bp->lock, flags);
52605262
macb_reset_hw(bp);
@@ -5284,6 +5286,9 @@ static int __maybe_unused macb_resume(struct device *dev)
52845286
unsigned int q;
52855287
int err;
52865288

5289+
if (!device_may_wakeup(&bp->dev->dev))
5290+
phy_init(bp->sgmii_phy);
5291+
52875292
if (!netif_running(netdev))
52885293
return 0;
52895294

@@ -5344,8 +5349,6 @@ static int __maybe_unused macb_resume(struct device *dev)
53445349
macb_set_rx_mode(netdev);
53455350
macb_restore_features(bp);
53465351
rtnl_lock();
5347-
if (!device_may_wakeup(&bp->dev->dev))
5348-
phy_init(bp->sgmii_phy);
53495352

53505353
phylink_start(bp->phylink);
53515354
rtnl_unlock();

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ static int i40e_read_nvm_word_srctl(struct i40e_hw *hw, u16 offset,
210210
* @hw: pointer to the HW structure.
211211
* @module_pointer: module pointer location in words from the NVM beginning
212212
* @offset: offset in words from module start
213-
* @words: number of words to write
214-
* @data: buffer with words to write to the Shadow RAM
213+
* @words: number of words to read
214+
* @data: buffer with words to read to the Shadow RAM
215215
* @last_command: tells the AdminQ that this is the last command
216216
*
217-
* Writes a 16 bit words buffer to the Shadow RAM using the admin command.
217+
* Reads a 16 bit words buffer to the Shadow RAM using the admin command.
218218
**/
219219
static int i40e_read_nvm_aq(struct i40e_hw *hw,
220220
u8 module_pointer, u32 offset,
@@ -234,18 +234,18 @@ static int i40e_read_nvm_aq(struct i40e_hw *hw,
234234
*/
235235
if ((offset + words) > hw->nvm.sr_size)
236236
i40e_debug(hw, I40E_DEBUG_NVM,
237-
"NVM write error: offset %d beyond Shadow RAM limit %d\n",
237+
"NVM read error: offset %d beyond Shadow RAM limit %d\n",
238238
(offset + words), hw->nvm.sr_size);
239239
else if (words > I40E_SR_SECTOR_SIZE_IN_WORDS)
240-
/* We can write only up to 4KB (one sector), in one AQ write */
240+
/* We can read only up to 4KB (one sector), in one AQ write */
241241
i40e_debug(hw, I40E_DEBUG_NVM,
242-
"NVM write fail error: tried to write %d words, limit is %d.\n",
242+
"NVM read fail error: tried to read %d words, limit is %d.\n",
243243
words, I40E_SR_SECTOR_SIZE_IN_WORDS);
244244
else if (((offset + (words - 1)) / I40E_SR_SECTOR_SIZE_IN_WORDS)
245245
!= (offset / I40E_SR_SECTOR_SIZE_IN_WORDS))
246-
/* A single write cannot spread over two sectors */
246+
/* A single read cannot spread over two sectors */
247247
i40e_debug(hw, I40E_DEBUG_NVM,
248-
"NVM write error: cannot spread over two sectors in a single write offset=%d words=%d\n",
248+
"NVM read error: cannot spread over two sectors in a single read offset=%d words=%d\n",
249249
offset, words);
250250
else
251251
ret_code = i40e_aq_read_nvm(hw, module_pointer,

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,7 @@ iavf_add_fdir_fltr_info(struct iavf_adapter *adapter, struct ethtool_rx_flow_spe
12891289
fltr->ip_mask.src_port = fsp->m_u.tcp_ip4_spec.psrc;
12901290
fltr->ip_mask.dst_port = fsp->m_u.tcp_ip4_spec.pdst;
12911291
fltr->ip_mask.tos = fsp->m_u.tcp_ip4_spec.tos;
1292+
fltr->ip_ver = 4;
12921293
break;
12931294
case AH_V4_FLOW:
12941295
case ESP_V4_FLOW:
@@ -1300,6 +1301,7 @@ iavf_add_fdir_fltr_info(struct iavf_adapter *adapter, struct ethtool_rx_flow_spe
13001301
fltr->ip_mask.v4_addrs.dst_ip = fsp->m_u.ah_ip4_spec.ip4dst;
13011302
fltr->ip_mask.spi = fsp->m_u.ah_ip4_spec.spi;
13021303
fltr->ip_mask.tos = fsp->m_u.ah_ip4_spec.tos;
1304+
fltr->ip_ver = 4;
13031305
break;
13041306
case IPV4_USER_FLOW:
13051307
fltr->ip_data.v4_addrs.src_ip = fsp->h_u.usr_ip4_spec.ip4src;
@@ -1312,6 +1314,7 @@ iavf_add_fdir_fltr_info(struct iavf_adapter *adapter, struct ethtool_rx_flow_spe
13121314
fltr->ip_mask.l4_header = fsp->m_u.usr_ip4_spec.l4_4_bytes;
13131315
fltr->ip_mask.tos = fsp->m_u.usr_ip4_spec.tos;
13141316
fltr->ip_mask.proto = fsp->m_u.usr_ip4_spec.proto;
1317+
fltr->ip_ver = 4;
13151318
break;
13161319
case TCP_V6_FLOW:
13171320
case UDP_V6_FLOW:
@@ -1330,6 +1333,7 @@ iavf_add_fdir_fltr_info(struct iavf_adapter *adapter, struct ethtool_rx_flow_spe
13301333
fltr->ip_mask.src_port = fsp->m_u.tcp_ip6_spec.psrc;
13311334
fltr->ip_mask.dst_port = fsp->m_u.tcp_ip6_spec.pdst;
13321335
fltr->ip_mask.tclass = fsp->m_u.tcp_ip6_spec.tclass;
1336+
fltr->ip_ver = 6;
13331337
break;
13341338
case AH_V6_FLOW:
13351339
case ESP_V6_FLOW:
@@ -1345,6 +1349,7 @@ iavf_add_fdir_fltr_info(struct iavf_adapter *adapter, struct ethtool_rx_flow_spe
13451349
sizeof(struct in6_addr));
13461350
fltr->ip_mask.spi = fsp->m_u.ah_ip6_spec.spi;
13471351
fltr->ip_mask.tclass = fsp->m_u.ah_ip6_spec.tclass;
1352+
fltr->ip_ver = 6;
13481353
break;
13491354
case IPV6_USER_FLOW:
13501355
memcpy(&fltr->ip_data.v6_addrs.src_ip, fsp->h_u.usr_ip6_spec.ip6src,
@@ -1361,6 +1366,7 @@ iavf_add_fdir_fltr_info(struct iavf_adapter *adapter, struct ethtool_rx_flow_spe
13611366
fltr->ip_mask.l4_header = fsp->m_u.usr_ip6_spec.l4_4_bytes;
13621367
fltr->ip_mask.tclass = fsp->m_u.usr_ip6_spec.tclass;
13631368
fltr->ip_mask.proto = fsp->m_u.usr_ip6_spec.l4_proto;
1369+
fltr->ip_ver = 6;
13641370
break;
13651371
case ETHER_FLOW:
13661372
fltr->eth_data.etype = fsp->h_u.ether_spec.h_proto;
@@ -1371,6 +1377,10 @@ iavf_add_fdir_fltr_info(struct iavf_adapter *adapter, struct ethtool_rx_flow_spe
13711377
return -EINVAL;
13721378
}
13731379

1380+
err = iavf_validate_fdir_fltr_masks(adapter, fltr);
1381+
if (err)
1382+
return err;
1383+
13741384
if (iavf_fdir_is_dup_fltr(adapter, fltr))
13751385
return -EEXIST;
13761386

drivers/net/ethernet/intel/iavf/iavf_fdir.c

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,79 @@ static const struct in6_addr ipv6_addr_full_mask = {
1818
}
1919
};
2020

21+
static const struct in6_addr ipv6_addr_zero_mask = {
22+
.in6_u = {
23+
.u6_addr8 = {
24+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
25+
}
26+
}
27+
};
28+
29+
/**
30+
* iavf_validate_fdir_fltr_masks - validate Flow Director filter fields masks
31+
* @adapter: pointer to the VF adapter structure
32+
* @fltr: Flow Director filter data structure
33+
*
34+
* Returns 0 if all masks of packet fields are either full or empty. Returns
35+
* error on at least one partial mask.
36+
*/
37+
int iavf_validate_fdir_fltr_masks(struct iavf_adapter *adapter,
38+
struct iavf_fdir_fltr *fltr)
39+
{
40+
if (fltr->eth_mask.etype && fltr->eth_mask.etype != htons(U16_MAX))
41+
goto partial_mask;
42+
43+
if (fltr->ip_ver == 4) {
44+
if (fltr->ip_mask.v4_addrs.src_ip &&
45+
fltr->ip_mask.v4_addrs.src_ip != htonl(U32_MAX))
46+
goto partial_mask;
47+
48+
if (fltr->ip_mask.v4_addrs.dst_ip &&
49+
fltr->ip_mask.v4_addrs.dst_ip != htonl(U32_MAX))
50+
goto partial_mask;
51+
52+
if (fltr->ip_mask.tos && fltr->ip_mask.tos != U8_MAX)
53+
goto partial_mask;
54+
} else if (fltr->ip_ver == 6) {
55+
if (memcmp(&fltr->ip_mask.v6_addrs.src_ip, &ipv6_addr_zero_mask,
56+
sizeof(struct in6_addr)) &&
57+
memcmp(&fltr->ip_mask.v6_addrs.src_ip, &ipv6_addr_full_mask,
58+
sizeof(struct in6_addr)))
59+
goto partial_mask;
60+
61+
if (memcmp(&fltr->ip_mask.v6_addrs.dst_ip, &ipv6_addr_zero_mask,
62+
sizeof(struct in6_addr)) &&
63+
memcmp(&fltr->ip_mask.v6_addrs.dst_ip, &ipv6_addr_full_mask,
64+
sizeof(struct in6_addr)))
65+
goto partial_mask;
66+
67+
if (fltr->ip_mask.tclass && fltr->ip_mask.tclass != U8_MAX)
68+
goto partial_mask;
69+
}
70+
71+
if (fltr->ip_mask.proto && fltr->ip_mask.proto != U8_MAX)
72+
goto partial_mask;
73+
74+
if (fltr->ip_mask.src_port && fltr->ip_mask.src_port != htons(U16_MAX))
75+
goto partial_mask;
76+
77+
if (fltr->ip_mask.dst_port && fltr->ip_mask.dst_port != htons(U16_MAX))
78+
goto partial_mask;
79+
80+
if (fltr->ip_mask.spi && fltr->ip_mask.spi != htonl(U32_MAX))
81+
goto partial_mask;
82+
83+
if (fltr->ip_mask.l4_header &&
84+
fltr->ip_mask.l4_header != htonl(U32_MAX))
85+
goto partial_mask;
86+
87+
return 0;
88+
89+
partial_mask:
90+
dev_err(&adapter->pdev->dev, "Failed to add Flow Director filter, partial masks are not supported\n");
91+
return -EOPNOTSUPP;
92+
}
93+
2194
/**
2295
* iavf_pkt_udp_no_pay_len - the length of UDP packet without payload
2396
* @fltr: Flow Director filter data structure
@@ -263,8 +336,6 @@ iavf_fill_fdir_ip4_hdr(struct iavf_fdir_fltr *fltr,
263336
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, DST);
264337
}
265338

266-
fltr->ip_ver = 4;
267-
268339
return 0;
269340
}
270341

@@ -309,8 +380,6 @@ iavf_fill_fdir_ip6_hdr(struct iavf_fdir_fltr *fltr,
309380
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, DST);
310381
}
311382

312-
fltr->ip_ver = 6;
313-
314383
return 0;
315384
}
316385

drivers/net/ethernet/intel/iavf/iavf_fdir.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ struct iavf_fdir_fltr {
110110
struct virtchnl_fdir_add vc_add_msg;
111111
};
112112

113+
int iavf_validate_fdir_fltr_masks(struct iavf_adapter *adapter,
114+
struct iavf_fdir_fltr *fltr);
113115
int iavf_fill_fdir_add_msg(struct iavf_adapter *adapter, struct iavf_fdir_fltr *fltr);
114116
void iavf_print_fdir_fltr(struct iavf_adapter *adapter, struct iavf_fdir_fltr *fltr);
115117
bool iavf_fdir_is_dup_fltr(struct iavf_adapter *adapter, struct iavf_fdir_fltr *fltr);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,12 @@ ice_eswitch_mode_set(struct devlink *devlink, u16 mode,
538538
break;
539539
case DEVLINK_ESWITCH_MODE_SWITCHDEV:
540540
{
541+
if (ice_is_adq_active(pf)) {
542+
dev_err(ice_pf_to_dev(pf), "Couldn't change eswitch mode to switchdev - ADQ is active. Delete ADQ configs and try again, e.g. tc qdisc del dev $PF root");
543+
NL_SET_ERR_MSG_MOD(extack, "Couldn't change eswitch mode to switchdev - ADQ is active. Delete ADQ configs and try again, e.g. tc qdisc del dev $PF root");
544+
return -EOPNOTSUPP;
545+
}
546+
541547
dev_info(ice_pf_to_dev(pf), "PF %d changed eswitch mode to switchdev",
542548
pf->hw.pf_id);
543549
NL_SET_ERR_MSG_MOD(extack, "Changed eswitch mode to switchdev");

0 commit comments

Comments
 (0)