Skip to content

Commit cbf658d

Browse files
committed
Merge tag 'net-6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from wireless. No known regressions at this point. Current release - fix to a fix: - eth: Revert "net/mlx5e: Update and set Xon/Xoff upon port speed set" - wifi: iwlwifi: pcie: fix byte count table for 7000/8000 devices - net: clear sk->sk_ino in sk_set_socket(sk, NULL), fix CRIU Previous releases - regressions: - bonding: set random address only when slaves already exist - rxrpc: fix untrusted unsigned subtract - eth: - ice: fix Rx page leak on multi-buffer frames - mlx5: don't return mlx5_link_info table when speed is unknown Previous releases - always broken: - tls: make sure to abort the stream if headers are bogus - tcp: fix null-deref when using TCP-AO with TCP_REPAIR - dpll: fix skipping last entry in clock quality level reporting - eth: qed: don't collect too many protection override GRC elements, fix memory corruption" * tag 'net-6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits) octeontx2-pf: Fix use-after-free bugs in otx2_sync_tstamp() cnic: Fix use-after-free bugs in cnic_delete_task devlink rate: Remove unnecessary 'static' from a couple places MAINTAINERS: update sundance entry net: liquidio: fix overflow in octeon_init_instr_queue() net: clear sk->sk_ino in sk_set_socket(sk, NULL) Revert "net/mlx5e: Update and set Xon/Xoff upon port speed set" selftests: tls: test skb copy under mem pressure and OOB tls: make sure to abort the stream if headers are bogus selftest: packetdrill: Add tcp_fastopen_server_reset-after-disconnect.pkt. tcp: Clear tcp_sk(sk)->fastopen_rsk in tcp_disconnect(). octeon_ep: fix VF MAC address lifecycle handling selftests: bonding: add vlan over bond testing bonding: don't set oif to bond dev when getting NS target destination net: rfkill: gpio: Fix crash due to dereferencering uninitialized pointer net/mlx5e: Add a miss level for ipsec crypto offload net/mlx5e: Harden uplink netdev access against device unbind MAINTAINERS: make the DPLL entry cover drivers doc/netlink: Fix typos in operation attributes igc: don't fail igc_probe() on LED setup error ...
2 parents 86cc796 + f8b4687 commit cbf658d

File tree

64 files changed

+640
-179
lines changed

Some content is hidden

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

64 files changed

+640
-179
lines changed

Documentation/netlink/specs/conntrack.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,8 @@ operations:
575575
- nat-dst
576576
- timeout
577577
- mark
578-
- counter-orig
579-
- counter-reply
578+
- counters-orig
579+
- counters-reply
580580
- use
581581
- id
582582
- nat-dst
@@ -591,7 +591,6 @@ operations:
591591
request:
592592
value: 0x101
593593
attributes:
594-
- nfgen-family
595594
- mark
596595
- filter
597596
- status
@@ -608,8 +607,8 @@ operations:
608607
- nat-dst
609608
- timeout
610609
- mark
611-
- counter-orig
612-
- counter-reply
610+
- counters-orig
611+
- counters-reply
613612
- use
614613
- id
615614
- nat-dst

Documentation/netlink/specs/mptcp_pm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ definitions:
2828
traffic-patterns it can take a long time until the
2929
MPTCP_EVENT_ESTABLISHED is sent.
3030
Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
31-
dport, server-side.
31+
dport, server-side, [flags].
3232
-
3333
name: established
3434
doc: >-
3535
A MPTCP connection is established (can start new subflows).
3636
Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
37-
dport, server-side.
37+
dport, server-side, [flags].
3838
-
3939
name: closed
4040
doc: >-

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7430,7 +7430,7 @@ S: Supported
74307430
F: Documentation/devicetree/bindings/dpll/dpll-device.yaml
74317431
F: Documentation/devicetree/bindings/dpll/dpll-pin.yaml
74327432
F: Documentation/driver-api/dpll.rst
7433-
F: drivers/dpll/*
7433+
F: drivers/dpll/
74347434
F: include/linux/dpll.h
74357435
F: include/uapi/linux/dpll.h
74367436

@@ -24259,7 +24259,7 @@ F: Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
2425924259
F: drivers/input/keyboard/sun4i-lradc-keys.c
2426024260

2426124261
SUNDANCE NETWORK DRIVER
24262-
M: Denis Kirjanov <[email protected]>
24262+
M: Denis Kirjanov <[email protected]>
2426324263
2426424264
S: Maintained
2426524265
F: drivers/net/ethernet/dlink/sundance.c

drivers/dpll/dpll_netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ static int
211211
dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device *dpll,
212212
struct netlink_ext_ack *extack)
213213
{
214+
DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1) = { 0 };
214215
const struct dpll_device_ops *ops = dpll_device_ops(dpll);
215-
DECLARE_BITMAP(qls, DPLL_CLOCK_QUALITY_LEVEL_MAX) = { 0 };
216216
enum dpll_clock_quality_level ql;
217217
int ret;
218218

@@ -221,7 +221,7 @@ dpll_msg_add_clock_quality_level(struct sk_buff *msg, struct dpll_device *dpll,
221221
ret = ops->clock_quality_level_get(dpll, dpll_priv(dpll), qls, extack);
222222
if (ret)
223223
return ret;
224-
for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX)
224+
for_each_set_bit(ql, qls, DPLL_CLOCK_QUALITY_LEVEL_MAX + 1)
225225
if (nla_put_u32(msg, DPLL_A_CLOCK_QUALITY_LEVEL, ql))
226226
return -EMSGSIZE;
227227

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,6 +2132,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
21322132
memcpy(ss.__data, bond_dev->dev_addr, bond_dev->addr_len);
21332133
} else if (bond->params.fail_over_mac == BOND_FOM_FOLLOW &&
21342134
BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP &&
2135+
bond_has_slaves(bond) &&
21352136
memcmp(slave_dev->dev_addr, bond_dev->dev_addr, bond_dev->addr_len) == 0) {
21362137
/* Set slave to random address to avoid duplicate mac
21372138
* address in later fail over.
@@ -3355,7 +3356,6 @@ static void bond_ns_send_all(struct bonding *bond, struct slave *slave)
33553356
/* Find out through which dev should the packet go */
33563357
memset(&fl6, 0, sizeof(struct flowi6));
33573358
fl6.daddr = targets[i];
3358-
fl6.flowi6_oif = bond->dev->ifindex;
33593359

33603360
dst = ip6_route_output(dev_net(bond->dev), NULL, &fl6);
33613361
if (dst->error) {

drivers/net/ethernet/broadcom/cnic.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4230,8 +4230,7 @@ static void cnic_cm_stop_bnx2x_hw(struct cnic_dev *dev)
42304230

42314231
cnic_bnx2x_delete_wait(dev, 0);
42324232

4233-
cancel_delayed_work(&cp->delete_task);
4234-
flush_workqueue(cnic_wq);
4233+
cancel_delayed_work_sync(&cp->delete_task);
42354234

42364235
if (atomic_read(&cp->iscsi_conn) != 0)
42374236
netdev_warn(dev->netdev, "%d iSCSI connections not destroyed\n",

drivers/net/ethernet/cavium/liquidio/request_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ int octeon_init_instr_queue(struct octeon_device *oct,
126126
oct->io_qmask.iq |= BIT_ULL(iq_no);
127127

128128
/* Set the 32B/64B mode for each input queue */
129-
oct->io_qmask.iq64B |= ((conf->instr_type == 64) << iq_no);
129+
oct->io_qmask.iq64B |= ((u64)(conf->instr_type == 64) << iq_no);
130130
iq->iqcmd_64B = (conf->instr_type == 64);
131131

132132
oct->fn_list.setup_iq_regs(oct, iq_no);

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ static int dpaa2_switch_setup_dpbp(struct ethsw_core *ethsw)
27362736
dev_err(dev, "dpsw_ctrl_if_set_pools() failed\n");
27372737
goto err_get_attr;
27382738
}
2739-
ethsw->bpid = dpbp_attrs.id;
2739+
ethsw->bpid = dpbp_attrs.bpid;
27402740

27412741
return 0;
27422742

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,9 +948,6 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
948948
if (!eop_desc)
949949
break;
950950

951-
/* prevent any other reads prior to eop_desc */
952-
smp_rmb();
953-
954951
i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);
955952
/* we have caught up to head, no work left to do */
956953
if (tx_head == tx_desc)

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

Lines changed: 34 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -894,10 +894,6 @@ ice_add_xdp_frag(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp,
894894
__skb_fill_page_desc_noacc(sinfo, sinfo->nr_frags++, rx_buf->page,
895895
rx_buf->page_offset, size);
896896
sinfo->xdp_frags_size += size;
897-
/* remember frag count before XDP prog execution; bpf_xdp_adjust_tail()
898-
* can pop off frags but driver has to handle it on its own
899-
*/
900-
rx_ring->nr_frags = sinfo->nr_frags;
901897

902898
if (page_is_pfmemalloc(rx_buf->page))
903899
xdp_buff_set_frag_pfmemalloc(xdp);
@@ -968,20 +964,20 @@ ice_get_rx_buf(struct ice_rx_ring *rx_ring, const unsigned int size,
968964
/**
969965
* ice_get_pgcnts - grab page_count() for gathered fragments
970966
* @rx_ring: Rx descriptor ring to store the page counts on
967+
* @ntc: the next to clean element (not included in this frame!)
971968
*
972969
* This function is intended to be called right before running XDP
973970
* program so that the page recycling mechanism will be able to take
974971
* a correct decision regarding underlying pages; this is done in such
975972
* way as XDP program can change the refcount of page
976973
*/
977-
static void ice_get_pgcnts(struct ice_rx_ring *rx_ring)
974+
static void ice_get_pgcnts(struct ice_rx_ring *rx_ring, unsigned int ntc)
978975
{
979-
u32 nr_frags = rx_ring->nr_frags + 1;
980976
u32 idx = rx_ring->first_desc;
981977
struct ice_rx_buf *rx_buf;
982978
u32 cnt = rx_ring->count;
983979

984-
for (int i = 0; i < nr_frags; i++) {
980+
while (idx != ntc) {
985981
rx_buf = &rx_ring->rx_buf[idx];
986982
rx_buf->pgcnt = page_count(rx_buf->page);
987983

@@ -1154,62 +1150,51 @@ ice_put_rx_buf(struct ice_rx_ring *rx_ring, struct ice_rx_buf *rx_buf)
11541150
}
11551151

11561152
/**
1157-
* ice_put_rx_mbuf - ice_put_rx_buf() caller, for all frame frags
1153+
* ice_put_rx_mbuf - ice_put_rx_buf() caller, for all buffers in frame
11581154
* @rx_ring: Rx ring with all the auxiliary data
11591155
* @xdp: XDP buffer carrying linear + frags part
1160-
* @xdp_xmit: XDP_TX/XDP_REDIRECT verdict storage
1161-
* @ntc: a current next_to_clean value to be stored at rx_ring
1156+
* @ntc: the next to clean element (not included in this frame!)
11621157
* @verdict: return code from XDP program execution
11631158
*
1164-
* Walk through gathered fragments and satisfy internal page
1165-
* recycle mechanism; we take here an action related to verdict
1166-
* returned by XDP program;
1159+
* Called after XDP program is completed, or on error with verdict set to
1160+
* ICE_XDP_CONSUMED.
1161+
*
1162+
* Walk through buffers from first_desc to the end of the frame, releasing
1163+
* buffers and satisfying internal page recycle mechanism. The action depends
1164+
* on verdict from XDP program.
11671165
*/
11681166
static void ice_put_rx_mbuf(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp,
1169-
u32 *xdp_xmit, u32 ntc, u32 verdict)
1167+
u32 ntc, u32 verdict)
11701168
{
1171-
u32 nr_frags = rx_ring->nr_frags + 1;
11721169
u32 idx = rx_ring->first_desc;
11731170
u32 cnt = rx_ring->count;
1174-
u32 post_xdp_frags = 1;
11751171
struct ice_rx_buf *buf;
1176-
int i;
1172+
u32 xdp_frags = 0;
1173+
int i = 0;
11771174

11781175
if (unlikely(xdp_buff_has_frags(xdp)))
1179-
post_xdp_frags += xdp_get_shared_info_from_buff(xdp)->nr_frags;
1176+
xdp_frags = xdp_get_shared_info_from_buff(xdp)->nr_frags;
11801177

1181-
for (i = 0; i < post_xdp_frags; i++) {
1178+
while (idx != ntc) {
11821179
buf = &rx_ring->rx_buf[idx];
1180+
if (++idx == cnt)
1181+
idx = 0;
11831182

1184-
if (verdict & (ICE_XDP_TX | ICE_XDP_REDIR)) {
1183+
/* An XDP program could release fragments from the end of the
1184+
* buffer. For these, we need to keep the pagecnt_bias as-is.
1185+
* To do this, only adjust pagecnt_bias for fragments up to
1186+
* the total remaining after the XDP program has run.
1187+
*/
1188+
if (verdict != ICE_XDP_CONSUMED)
11851189
ice_rx_buf_adjust_pg_offset(buf, xdp->frame_sz);
1186-
*xdp_xmit |= verdict;
1187-
} else if (verdict & ICE_XDP_CONSUMED) {
1190+
else if (i++ <= xdp_frags)
11881191
buf->pagecnt_bias++;
1189-
} else if (verdict == ICE_XDP_PASS) {
1190-
ice_rx_buf_adjust_pg_offset(buf, xdp->frame_sz);
1191-
}
11921192

11931193
ice_put_rx_buf(rx_ring, buf);
1194-
1195-
if (++idx == cnt)
1196-
idx = 0;
1197-
}
1198-
/* handle buffers that represented frags released by XDP prog;
1199-
* for these we keep pagecnt_bias as-is; refcount from struct page
1200-
* has been decremented within XDP prog and we do not have to increase
1201-
* the biased refcnt
1202-
*/
1203-
for (; i < nr_frags; i++) {
1204-
buf = &rx_ring->rx_buf[idx];
1205-
ice_put_rx_buf(rx_ring, buf);
1206-
if (++idx == cnt)
1207-
idx = 0;
12081194
}
12091195

12101196
xdp->data = NULL;
12111197
rx_ring->first_desc = ntc;
1212-
rx_ring->nr_frags = 0;
12131198
}
12141199

12151200
/**
@@ -1317,6 +1302,10 @@ static int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)
13171302
/* retrieve a buffer from the ring */
13181303
rx_buf = ice_get_rx_buf(rx_ring, size, ntc);
13191304

1305+
/* Increment ntc before calls to ice_put_rx_mbuf() */
1306+
if (++ntc == cnt)
1307+
ntc = 0;
1308+
13201309
if (!xdp->data) {
13211310
void *hard_start;
13221311

@@ -1325,24 +1314,23 @@ static int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)
13251314
xdp_prepare_buff(xdp, hard_start, offset, size, !!offset);
13261315
xdp_buff_clear_frags_flag(xdp);
13271316
} else if (ice_add_xdp_frag(rx_ring, xdp, rx_buf, size)) {
1328-
ice_put_rx_mbuf(rx_ring, xdp, NULL, ntc, ICE_XDP_CONSUMED);
1317+
ice_put_rx_mbuf(rx_ring, xdp, ntc, ICE_XDP_CONSUMED);
13291318
break;
13301319
}
1331-
if (++ntc == cnt)
1332-
ntc = 0;
13331320

13341321
/* skip if it is NOP desc */
13351322
if (ice_is_non_eop(rx_ring, rx_desc))
13361323
continue;
13371324

1338-
ice_get_pgcnts(rx_ring);
1325+
ice_get_pgcnts(rx_ring, ntc);
13391326
xdp_verdict = ice_run_xdp(rx_ring, xdp, xdp_prog, xdp_ring, rx_desc);
13401327
if (xdp_verdict == ICE_XDP_PASS)
13411328
goto construct_skb;
13421329
total_rx_bytes += xdp_get_buff_len(xdp);
13431330
total_rx_pkts++;
13441331

1345-
ice_put_rx_mbuf(rx_ring, xdp, &xdp_xmit, ntc, xdp_verdict);
1332+
ice_put_rx_mbuf(rx_ring, xdp, ntc, xdp_verdict);
1333+
xdp_xmit |= xdp_verdict & (ICE_XDP_TX | ICE_XDP_REDIR);
13461334

13471335
continue;
13481336
construct_skb:
@@ -1355,7 +1343,7 @@ static int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)
13551343
rx_ring->ring_stats->rx_stats.alloc_buf_failed++;
13561344
xdp_verdict = ICE_XDP_CONSUMED;
13571345
}
1358-
ice_put_rx_mbuf(rx_ring, xdp, &xdp_xmit, ntc, xdp_verdict);
1346+
ice_put_rx_mbuf(rx_ring, xdp, ntc, xdp_verdict);
13591347

13601348
if (!skb)
13611349
break;

0 commit comments

Comments
 (0)