Skip to content

Commit b1983d4

Browse files
committed
Merge tag 'net-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from netfilter, wireless and ebpf. Current release - regressions: - netfilter: conntrack: gre: don't set assured flag for clash entries - wifi: iwlwifi: remove 'use_tfh' config to fix crash Previous releases - regressions: - ipv6: fix a potential refcount underflow for idev - icmp6: ifix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev() - bpf: fix max stack depth check for async callbacks - eth: mlx5e: - check for NOT_READY flag state after locking - fix page_pool page fragment tracking for XDP - eth: igc: - fix tx hang issue when QBV gate is closed - fix corner cases for TSN offload - eth: octeontx2-af: Move validation of ptp pointer before its usage - eth: ena: fix shift-out-of-bounds in exponential backoff Previous releases - always broken: - core: prevent skb corruption on frag list segmentation - sched: - cls_fw: fix improper refcount update leads to use-after-free - sch_qfq: account for stab overhead in qfq_enqueue - netfilter: - report use refcount overflow - prevent OOB access in nft_byteorder_eval - wifi: mt7921e: fix init command fail with enabled device - eth: ocelot: fix oversize frame dropping for preemptible TCs - eth: fec: recycle pages for transmitted XDP frames" * tag 'net-6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (79 commits) selftests: tc-testing: add test for qfq with stab overhead net/sched: sch_qfq: account for stab overhead in qfq_enqueue selftests: tc-testing: add tests for qfq mtu sanity check net/sched: sch_qfq: reintroduce lmax bound check for MTU wifi: cfg80211: fix receiving mesh packets without RFC1042 header wifi: rtw89: debug: fix error code in rtw89_debug_priv_send_h2c_set() net: txgbe: fix eeprom calculation error net/sched: make psched_mtu() RTNL-less safe net: ena: fix shift-out-of-bounds in exponential backoff netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() net/sched: flower: Ensure both minimum and maximum ports are specified MAINTAINERS: Add another mailing list for QUALCOMM ETHQOS ETHERNET DRIVER docs: netdev: update the URL of the status page wifi: iwlwifi: remove 'use_tfh' config to fix crash xdp: use trusted arguments in XDP hints kfuncs bpf: cpumap: Fix memory leak in cpu_map_update_elem wifi: airo: avoid uninitialized warning in airo_get_rate() octeontx2-pf: Add additional check for MCAM rules net: dsa: Removed unneeded of_node_put in felix_parse_ports_node net: fec: use netdev_err_once() instead of netdev_err() ...
2 parents ebc27aa + 9d23aac commit b1983d4

Some content is hidden

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

91 files changed

+1011
-521
lines changed

Documentation/process/maintainer-netdev.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ If you aren't subscribed to netdev and/or are simply unsure if
9898
repository link above for any new networking-related commits. You may
9999
also check the following website for the current status:
100100

101-
http://vger.kernel.org/~davem/net-next.html
101+
https://patchwork.hopto.org/net-next.html
102102

103103
The ``net`` tree continues to collect fixes for the vX.Y content, and is
104104
fed back to Linus at regular (~weekly) intervals. Meaning that the

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17543,6 +17543,7 @@ QUALCOMM ETHQOS ETHERNET DRIVER
1754317543
M: Vinod Koul <[email protected]>
1754417544
R: Bhupesh Sharma <[email protected]>
1754517545
17546+
1754617547
S: Maintained
1754717548
F: Documentation/devicetree/bindings/net/qcom,ethqos.yaml
1754817549
F: drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c

arch/riscv/net/bpf_jit.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct rv_jit_context {
6969
struct bpf_prog *prog;
7070
u16 *insns; /* RV insns */
7171
int ninsns;
72-
int body_len;
72+
int prologue_len;
7373
int epilogue_offset;
7474
int *offset; /* BPF to RV */
7575
int nexentries;
@@ -216,8 +216,8 @@ static inline int rv_offset(int insn, int off, struct rv_jit_context *ctx)
216216
int from, to;
217217

218218
off++; /* BPF branch is from PC+1, RV is from PC */
219-
from = (insn > 0) ? ctx->offset[insn - 1] : 0;
220-
to = (insn + off > 0) ? ctx->offset[insn + off - 1] : 0;
219+
from = (insn > 0) ? ctx->offset[insn - 1] : ctx->prologue_len;
220+
to = (insn + off > 0) ? ctx->offset[insn + off - 1] : ctx->prologue_len;
221221
return ninsns_rvoff(to - from);
222222
}
223223

arch/riscv/net/bpf_jit_core.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
4444
unsigned int prog_size = 0, extable_size = 0;
4545
bool tmp_blinded = false, extra_pass = false;
4646
struct bpf_prog *tmp, *orig_prog = prog;
47-
int pass = 0, prev_ninsns = 0, prologue_len, i;
47+
int pass = 0, prev_ninsns = 0, i;
4848
struct rv_jit_data *jit_data;
4949
struct rv_jit_context *ctx;
5050

@@ -83,6 +83,12 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
8383
prog = orig_prog;
8484
goto out_offset;
8585
}
86+
87+
if (build_body(ctx, extra_pass, NULL)) {
88+
prog = orig_prog;
89+
goto out_offset;
90+
}
91+
8692
for (i = 0; i < prog->len; i++) {
8793
prev_ninsns += 32;
8894
ctx->offset[i] = prev_ninsns;
@@ -91,12 +97,15 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
9197
for (i = 0; i < NR_JIT_ITERATIONS; i++) {
9298
pass++;
9399
ctx->ninsns = 0;
100+
101+
bpf_jit_build_prologue(ctx);
102+
ctx->prologue_len = ctx->ninsns;
103+
94104
if (build_body(ctx, extra_pass, ctx->offset)) {
95105
prog = orig_prog;
96106
goto out_offset;
97107
}
98-
ctx->body_len = ctx->ninsns;
99-
bpf_jit_build_prologue(ctx);
108+
100109
ctx->epilogue_offset = ctx->ninsns;
101110
bpf_jit_build_epilogue(ctx);
102111

@@ -162,10 +171,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
162171

163172
if (!prog->is_func || extra_pass) {
164173
bpf_jit_binary_lock_ro(jit_data->header);
165-
prologue_len = ctx->epilogue_offset - ctx->body_len;
166174
for (i = 0; i < prog->len; i++)
167-
ctx->offset[i] = ninsns_rvoff(prologue_len +
168-
ctx->offset[i]);
175+
ctx->offset[i] = ninsns_rvoff(ctx->offset[i]);
169176
bpf_prog_fill_jited_linfo(prog, ctx->offset);
170177
out_offset:
171178
kfree(ctx->offset);

drivers/net/dsa/ocelot/felix.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,6 @@ static int felix_parse_ports_node(struct felix *felix,
12861286
if (err < 0) {
12871287
dev_info(dev, "Unsupported PHY mode %s on port %d\n",
12881288
phy_modes(phy_mode), port);
1289-
of_node_put(child);
12901289

12911290
/* Leave port_phy_modes[port] = 0, which is also
12921291
* PHY_INTERFACE_MODE_NA. This will perform a
@@ -1786,16 +1785,15 @@ static int felix_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
17861785
{
17871786
struct ocelot *ocelot = ds->priv;
17881787
struct ocelot_port *ocelot_port = ocelot->ports[port];
1789-
struct felix *felix = ocelot_to_felix(ocelot);
17901788

17911789
ocelot_port_set_maxlen(ocelot, port, new_mtu);
17921790

1793-
mutex_lock(&ocelot->tas_lock);
1791+
mutex_lock(&ocelot->fwd_domain_lock);
17941792

1795-
if (ocelot_port->taprio && felix->info->tas_guard_bands_update)
1796-
felix->info->tas_guard_bands_update(ocelot, port);
1793+
if (ocelot_port->taprio && ocelot->ops->tas_guard_bands_update)
1794+
ocelot->ops->tas_guard_bands_update(ocelot, port);
17971795

1798-
mutex_unlock(&ocelot->tas_lock);
1796+
mutex_unlock(&ocelot->fwd_domain_lock);
17991797

18001798
return 0;
18011799
}

drivers/net/dsa/ocelot/felix.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ struct felix_info {
5757
void (*mdio_bus_free)(struct ocelot *ocelot);
5858
int (*port_setup_tc)(struct dsa_switch *ds, int port,
5959
enum tc_setup_type type, void *type_data);
60-
void (*tas_guard_bands_update)(struct ocelot *ocelot, int port);
6160
void (*port_sched_speed_set)(struct ocelot *ocelot, int port,
6261
u32 speed);
6362
void (*phylink_mac_config)(struct ocelot *ocelot, int port,

drivers/net/dsa/ocelot/felix_vsc9959.c

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,15 +1209,17 @@ static u32 vsc9959_tas_tc_max_sdu(struct tc_taprio_qopt_offload *taprio, int tc)
12091209
static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)
12101210
{
12111211
struct ocelot_port *ocelot_port = ocelot->ports[port];
1212+
struct ocelot_mm_state *mm = &ocelot->mm[port];
12121213
struct tc_taprio_qopt_offload *taprio;
12131214
u64 min_gate_len[OCELOT_NUM_TC];
1215+
u32 val, maxlen, add_frag_size;
1216+
u64 needed_min_frag_time_ps;
12141217
int speed, picos_per_byte;
12151218
u64 needed_bit_time_ps;
1216-
u32 val, maxlen;
12171219
u8 tas_speed;
12181220
int tc;
12191221

1220-
lockdep_assert_held(&ocelot->tas_lock);
1222+
lockdep_assert_held(&ocelot->fwd_domain_lock);
12211223

12221224
taprio = ocelot_port->taprio;
12231225

@@ -1253,14 +1255,21 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)
12531255
*/
12541256
needed_bit_time_ps = (u64)(maxlen + 24) * picos_per_byte;
12551257

1258+
/* Preemptible TCs don't need to pass a full MTU, the port will
1259+
* automatically emit a HOLD request when a preemptible TC gate closes
1260+
*/
1261+
val = ocelot_read_rix(ocelot, QSYS_PREEMPTION_CFG, port);
1262+
add_frag_size = QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE_X(val);
1263+
needed_min_frag_time_ps = picos_per_byte *
1264+
(u64)(24 + 2 * ethtool_mm_frag_size_add_to_min(add_frag_size));
1265+
12561266
dev_dbg(ocelot->dev,
1257-
"port %d: max frame size %d needs %llu ps at speed %d\n",
1258-
port, maxlen, needed_bit_time_ps, speed);
1267+
"port %d: max frame size %d needs %llu ps, %llu ps for mPackets at speed %d\n",
1268+
port, maxlen, needed_bit_time_ps, needed_min_frag_time_ps,
1269+
speed);
12591270

12601271
vsc9959_tas_min_gate_lengths(taprio, min_gate_len);
12611272

1262-
mutex_lock(&ocelot->fwd_domain_lock);
1263-
12641273
for (tc = 0; tc < OCELOT_NUM_TC; tc++) {
12651274
u32 requested_max_sdu = vsc9959_tas_tc_max_sdu(taprio, tc);
12661275
u64 remaining_gate_len_ps;
@@ -1269,7 +1278,9 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)
12691278
remaining_gate_len_ps =
12701279
vsc9959_tas_remaining_gate_len_ps(min_gate_len[tc]);
12711280

1272-
if (remaining_gate_len_ps > needed_bit_time_ps) {
1281+
if ((mm->active_preemptible_tcs & BIT(tc)) ?
1282+
remaining_gate_len_ps > needed_min_frag_time_ps :
1283+
remaining_gate_len_ps > needed_bit_time_ps) {
12731284
/* Setting QMAXSDU_CFG to 0 disables oversized frame
12741285
* dropping.
12751286
*/
@@ -1323,8 +1334,6 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)
13231334
ocelot_write_rix(ocelot, maxlen, QSYS_PORT_MAX_SDU, port);
13241335

13251336
ocelot->ops->cut_through_fwd(ocelot);
1326-
1327-
mutex_unlock(&ocelot->fwd_domain_lock);
13281337
}
13291338

13301339
static void vsc9959_sched_speed_set(struct ocelot *ocelot, int port,
@@ -1351,7 +1360,7 @@ static void vsc9959_sched_speed_set(struct ocelot *ocelot, int port,
13511360
break;
13521361
}
13531362

1354-
mutex_lock(&ocelot->tas_lock);
1363+
mutex_lock(&ocelot->fwd_domain_lock);
13551364

13561365
ocelot_rmw_rix(ocelot,
13571366
QSYS_TAG_CONFIG_LINK_SPEED(tas_speed),
@@ -1361,7 +1370,7 @@ static void vsc9959_sched_speed_set(struct ocelot *ocelot, int port,
13611370
if (ocelot_port->taprio)
13621371
vsc9959_tas_guard_bands_update(ocelot, port);
13631372

1364-
mutex_unlock(&ocelot->tas_lock);
1373+
mutex_unlock(&ocelot->fwd_domain_lock);
13651374
}
13661375

13671376
static void vsc9959_new_base_time(struct ocelot *ocelot, ktime_t base_time,
@@ -1409,7 +1418,7 @@ static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port,
14091418
int ret, i;
14101419
u32 val;
14111420

1412-
mutex_lock(&ocelot->tas_lock);
1421+
mutex_lock(&ocelot->fwd_domain_lock);
14131422

14141423
if (taprio->cmd == TAPRIO_CMD_DESTROY) {
14151424
ocelot_port_mqprio(ocelot, port, &taprio->mqprio);
@@ -1421,7 +1430,7 @@ static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port,
14211430

14221431
vsc9959_tas_guard_bands_update(ocelot, port);
14231432

1424-
mutex_unlock(&ocelot->tas_lock);
1433+
mutex_unlock(&ocelot->fwd_domain_lock);
14251434
return 0;
14261435
} else if (taprio->cmd != TAPRIO_CMD_REPLACE) {
14271436
ret = -EOPNOTSUPP;
@@ -1504,15 +1513,15 @@ static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port,
15041513
ocelot_port->taprio = taprio_offload_get(taprio);
15051514
vsc9959_tas_guard_bands_update(ocelot, port);
15061515

1507-
mutex_unlock(&ocelot->tas_lock);
1516+
mutex_unlock(&ocelot->fwd_domain_lock);
15081517

15091518
return 0;
15101519

15111520
err_reset_tc:
15121521
taprio->mqprio.qopt.num_tc = 0;
15131522
ocelot_port_mqprio(ocelot, port, &taprio->mqprio);
15141523
err_unlock:
1515-
mutex_unlock(&ocelot->tas_lock);
1524+
mutex_unlock(&ocelot->fwd_domain_lock);
15161525

15171526
return ret;
15181527
}
@@ -1525,7 +1534,7 @@ static void vsc9959_tas_clock_adjust(struct ocelot *ocelot)
15251534
int port;
15261535
u32 val;
15271536

1528-
mutex_lock(&ocelot->tas_lock);
1537+
mutex_lock(&ocelot->fwd_domain_lock);
15291538

15301539
for (port = 0; port < ocelot->num_phys_ports; port++) {
15311540
ocelot_port = ocelot->ports[port];
@@ -1563,7 +1572,7 @@ static void vsc9959_tas_clock_adjust(struct ocelot *ocelot)
15631572
QSYS_TAG_CONFIG_ENABLE,
15641573
QSYS_TAG_CONFIG, port);
15651574
}
1566-
mutex_unlock(&ocelot->tas_lock);
1575+
mutex_unlock(&ocelot->fwd_domain_lock);
15671576
}
15681577

15691578
static int vsc9959_qos_port_cbs_set(struct dsa_switch *ds, int port,
@@ -1634,6 +1643,18 @@ static int vsc9959_qos_query_caps(struct tc_query_caps_base *base)
16341643
}
16351644
}
16361645

1646+
static int vsc9959_qos_port_mqprio(struct ocelot *ocelot, int port,
1647+
struct tc_mqprio_qopt_offload *mqprio)
1648+
{
1649+
int ret;
1650+
1651+
mutex_lock(&ocelot->fwd_domain_lock);
1652+
ret = ocelot_port_mqprio(ocelot, port, mqprio);
1653+
mutex_unlock(&ocelot->fwd_domain_lock);
1654+
1655+
return ret;
1656+
}
1657+
16371658
static int vsc9959_port_setup_tc(struct dsa_switch *ds, int port,
16381659
enum tc_setup_type type,
16391660
void *type_data)
@@ -1646,7 +1667,7 @@ static int vsc9959_port_setup_tc(struct dsa_switch *ds, int port,
16461667
case TC_SETUP_QDISC_TAPRIO:
16471668
return vsc9959_qos_port_tas_set(ocelot, port, type_data);
16481669
case TC_SETUP_QDISC_MQPRIO:
1649-
return ocelot_port_mqprio(ocelot, port, type_data);
1670+
return vsc9959_qos_port_mqprio(ocelot, port, type_data);
16501671
case TC_SETUP_QDISC_CBS:
16511672
return vsc9959_qos_port_cbs_set(ds, port, type_data);
16521673
default:
@@ -2591,6 +2612,7 @@ static const struct ocelot_ops vsc9959_ops = {
25912612
.cut_through_fwd = vsc9959_cut_through_fwd,
25922613
.tas_clock_adjust = vsc9959_tas_clock_adjust,
25932614
.update_stats = vsc9959_update_stats,
2615+
.tas_guard_bands_update = vsc9959_tas_guard_bands_update,
25942616
};
25952617

25962618
static const struct felix_info felix_info_vsc9959 = {
@@ -2616,7 +2638,6 @@ static const struct felix_info felix_info_vsc9959 = {
26162638
.port_modes = vsc9959_port_modes,
26172639
.port_setup_tc = vsc9959_port_setup_tc,
26182640
.port_sched_speed_set = vsc9959_sched_speed_set,
2619-
.tas_guard_bands_update = vsc9959_tas_guard_bands_update,
26202641
};
26212642

26222643
/* The INTB interrupt is shared between for PTP TX timestamp availability

drivers/net/dsa/qca/qca8k-8xxx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ qca8k_phy_eth_busy_wait(struct qca8k_mgmt_eth_data *mgmt_eth_data,
588588
bool ack;
589589
int ret;
590590

591+
if (!skb)
592+
return -ENOMEM;
593+
591594
reinit_completion(&mgmt_eth_data->rw_done);
592595

593596
/* Increment seq_num and set it in the copy pkt */

drivers/net/ethernet/amazon/ena/ena_com.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
#define ENA_REGS_ADMIN_INTR_MASK 1
3737

38+
#define ENA_MAX_BACKOFF_DELAY_EXP 16U
39+
3840
#define ENA_MIN_ADMIN_POLL_US 100
3941

4042
#define ENA_MAX_ADMIN_POLL_US 5000
@@ -536,6 +538,7 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue,
536538

537539
static void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us)
538540
{
541+
exp = min_t(u32, exp, ENA_MAX_BACKOFF_DELAY_EXP);
539542
delay_us = max_t(u32, ENA_MIN_ADMIN_POLL_US, delay_us);
540543
delay_us = min_t(u32, delay_us * (1U << exp), ENA_MAX_ADMIN_POLL_US);
541544
usleep_range(delay_us, 2 * delay_us);

drivers/net/ethernet/broadcom/bgmac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,6 @@ int bgmac_enet_probe(struct bgmac *bgmac)
14921492

14931493
bgmac->in_init = true;
14941494

1495-
bgmac_chip_intrs_off(bgmac);
1496-
14971495
net_dev->irq = bgmac->irq;
14981496
SET_NETDEV_DEV(net_dev, bgmac->dev);
14991497
dev_set_drvdata(bgmac->dev, bgmac);
@@ -1511,6 +1509,8 @@ int bgmac_enet_probe(struct bgmac *bgmac)
15111509
*/
15121510
bgmac_clk_enable(bgmac, 0);
15131511

1512+
bgmac_chip_intrs_off(bgmac);
1513+
15141514
/* This seems to be fixing IRQ by assigning OOB #6 to the core */
15151515
if (!(bgmac->feature_flags & BGMAC_FEAT_IDM_MASK)) {
15161516
if (bgmac->feature_flags & BGMAC_FEAT_IRQ_ID_OOB_6)

0 commit comments

Comments
 (0)