Skip to content

Commit 714069d

Browse files
committed
Merge tag 'net-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Happy Wear a Dress Day. Fairly standard-sized batch of fixes, accounting for the lack of sub-tree submissions this week. The mlx5 IRQ fixes are notable, people were complaining about that. No fires burning. Current release - regressions: - eth: mlx5e: - multiple fixes for dynamic IRQ allocation - prevent encap offload when neigh update is running - eth: mana: fix perf regression: remove rx_cqes, tx_cqes counters Current release - new code bugs: - eth: mlx5e: DR, add missing mutex init/destroy in pattern manager Previous releases - always broken: - tcp: deny tcp_disconnect() when threads are waiting - sched: prevent ingress Qdiscs from getting installed in random locations in the hierarchy and moving around - sched: flower: fix possible OOB write in fl_set_geneve_opt() - netlink: fix NETLINK_LIST_MEMBERSHIPS length report - udp6: fix race condition in udp6_sendmsg & connect - tcp: fix mishandling when the sack compression is deferred - rtnetlink: validate link attributes set at creation time - mptcp: fix connect timeout handling - eth: stmmac: fix call trace when stmmac_xdp_xmit() is invoked - eth: amd-xgbe: fix the false linkup in xgbe_phy_status - eth: mlx5e: - fix corner cases in internal buffer configuration - drain health before unregistering devlink - usb: qmi_wwan: set DTR quirk for BroadMobi BM818 Misc: - tcp: return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if user_mss set" * tag 'net-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (71 commits) mptcp: fix active subflow finalization mptcp: add annotations around sk->sk_shutdown accesses mptcp: fix data race around msk->first access mptcp: consolidate passive msk socket initialization mptcp: add annotations around msk->subflow accesses mptcp: fix connect timeout handling rtnetlink: add the missing IFLA_GRO_ tb check in validate_linkmsg rtnetlink: move IFLA_GSO_ tb check to validate_linkmsg rtnetlink: call validate_linkmsg in rtnl_create_link ice: recycle/free all of the fragments from multi-buffer frame net: phy: mxl-gpy: extend interrupt fix to all impacted variants net: renesas: rswitch: Fix return value in error path of xmit net: dsa: mv88e6xxx: Increase wait after reset deactivation net: ipa: Use correct value for IPA_STATUS_SIZE tcp: fix mishandling when the sack compression is deferred. net/sched: flower: fix possible OOB write in fl_set_geneve_opt() sfc: fix error unwinds in TC offload net/mlx5: Read embedded cpu after init bit cleared net/mlx5e: Fix error handling in mlx5e_refresh_tirs net/mlx5: Ensure af_desc.mask is properly initialized ...
2 parents f9010db + a451b8e commit 714069d

Some content is hidden

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

72 files changed

+649
-429
lines changed

Documentation/netlink/specs/ethtool.yaml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,6 @@ attribute-sets:
6060
type: nest
6161
nested-attributes: bitset-bits
6262

63-
-
64-
name: u64-array
65-
attributes:
66-
-
67-
name: u64
68-
type: nest
69-
multi-attr: true
70-
nested-attributes: u64
71-
-
72-
name: s32-array
73-
attributes:
74-
-
75-
name: s32
76-
type: nest
77-
multi-attr: true
78-
nested-attributes: s32
7963
-
8064
name: string
8165
attributes:
@@ -705,16 +689,16 @@ attribute-sets:
705689
type: u8
706690
-
707691
name: corrected
708-
type: nest
709-
nested-attributes: u64-array
692+
type: binary
693+
sub-type: u64
710694
-
711695
name: uncorr
712-
type: nest
713-
nested-attributes: u64-array
696+
type: binary
697+
sub-type: u64
714698
-
715699
name: corr-bits
716-
type: nest
717-
nested-attributes: u64-array
700+
type: binary
701+
sub-type: u64
718702
-
719703
name: fec
720704
attributes:
@@ -827,8 +811,8 @@ attribute-sets:
827811
type: u32
828812
-
829813
name: index
830-
type: nest
831-
nested-attributes: s32-array
814+
type: binary
815+
sub-type: s32
832816
-
833817
name: module
834818
attributes:

Documentation/networking/device_drivers/ethernet/mellanox/mlx5/devlink.rst

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ flow_steering_mode: Device flow steering mode
4040
---------------------------------------------
4141
The flow steering mode parameter controls the flow steering mode of the driver.
4242
Two modes are supported:
43+
4344
1. 'dmfs' - Device managed flow steering.
4445
2. 'smfs' - Software/Driver managed flow steering.
4546

@@ -99,6 +100,7 @@ between representors and stacked devices.
99100
By default metadata is enabled on the supported devices in E-switch.
100101
Metadata is applicable only for E-switch in switchdev mode and
101102
users may disable it when NONE of the below use cases will be in use:
103+
102104
1. HCA is in Dual/multi-port RoCE mode.
103105
2. VF/SF representor bonding (Usually used for Live migration)
104106
3. Stacked devices
@@ -180,7 +182,8 @@ User commands examples:
180182

181183
$ devlink health diagnose pci/0000:82:00.0 reporter tx
182184

183-
NOTE: This command has valid output only when interface is up, otherwise the command has empty output.
185+
.. note::
186+
This command has valid output only when interface is up, otherwise the command has empty output.
184187

185188
- Show number of tx errors indicated, number of recover flows ended successfully,
186189
is autorecover enabled and graceful period from last recover::
@@ -232,8 +235,9 @@ User commands examples:
232235

233236
$ devlink health dump show pci/0000:82:00.0 reporter fw
234237

235-
NOTE: This command can run only on the PF which has fw tracer ownership,
236-
running it on other PF or any VF will return "Operation not permitted".
238+
.. note::
239+
This command can run only on the PF which has fw tracer ownership,
240+
running it on other PF or any VF will return "Operation not permitted".
237241

238242
fw fatal reporter
239243
-----------------
@@ -256,7 +260,8 @@ User commands examples:
256260

257261
$ devlink health dump show pci/0000:82:00.1 reporter fw_fatal
258262

259-
NOTE: This command can run only on PF.
263+
.. note::
264+
This command can run only on PF.
260265

261266
vnic reporter
262267
-------------
@@ -265,28 +270,37 @@ It is responsible for querying the vnic diagnostic counters from fw and displayi
265270
them in realtime.
266271

267272
Description of the vnic counters:
268-
total_q_under_processor_handle: number of queues in an error state due to
269-
an async error or errored command.
270-
send_queue_priority_update_flow: number of QP/SQ priority/SL update
271-
events.
272-
cq_overrun: number of times CQ entered an error state due to an
273-
overflow.
274-
async_eq_overrun: number of times an EQ mapped to async events was
275-
overrun.
276-
comp_eq_overrun: number of times an EQ mapped to completion events was
277-
overrun.
278-
quota_exceeded_command: number of commands issued and failed due to quota
279-
exceeded.
280-
invalid_command: number of commands issued and failed dues to any reason
281-
other than quota exceeded.
282-
nic_receive_steering_discard: number of packets that completed RX flow
283-
steering but were discarded due to a mismatch in flow table.
273+
274+
- total_q_under_processor_handle
275+
number of queues in an error state due to
276+
an async error or errored command.
277+
- send_queue_priority_update_flow
278+
number of QP/SQ priority/SL update events.
279+
- cq_overrun
280+
number of times CQ entered an error state due to an overflow.
281+
- async_eq_overrun
282+
number of times an EQ mapped to async events was overrun.
283+
comp_eq_overrun number of times an EQ mapped to completion events was
284+
overrun.
285+
- quota_exceeded_command
286+
number of commands issued and failed due to quota exceeded.
287+
- invalid_command
288+
number of commands issued and failed dues to any reason other than quota
289+
exceeded.
290+
- nic_receive_steering_discard
291+
number of packets that completed RX flow
292+
steering but were discarded due to a mismatch in flow table.
284293

285294
User commands examples:
286-
- Diagnose PF/VF vnic counters
295+
296+
- Diagnose PF/VF vnic counters::
297+
287298
$ devlink health diagnose pci/0000:82:00.1 reporter vnic
299+
288300
- Diagnose representor vnic counters (performed by supplying devlink port of the
289-
representor, which can be obtained via devlink port command)
301+
representor, which can be obtained via devlink port command)::
302+
290303
$ devlink health diagnose pci/0000:82:00.1/65537 reporter vnic
291304

292-
NOTE: This command can run over all interfaces such as PF/VF and representor ports.
305+
.. note::
306+
This command can run over all interfaces such as PF/VF and representor ports.

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7170,7 +7170,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
71707170
goto out;
71717171
}
71727172
if (chip->reset)
7173-
usleep_range(1000, 2000);
7173+
usleep_range(10000, 20000);
71747174

71757175
/* Detect if the device is configured in single chip addressing mode,
71767176
* otherwise continue with address specific smi init/detection.

drivers/net/ethernet/amd/xgbe/xgbe-mdio.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ static enum xgbe_mode xgbe_phy_status_aneg(struct xgbe_prv_data *pdata)
13291329
return pdata->phy_if.phy_impl.an_outcome(pdata);
13301330
}
13311331

1332-
static void xgbe_phy_status_result(struct xgbe_prv_data *pdata)
1332+
static bool xgbe_phy_status_result(struct xgbe_prv_data *pdata)
13331333
{
13341334
struct ethtool_link_ksettings *lks = &pdata->phy.lks;
13351335
enum xgbe_mode mode;
@@ -1367,8 +1367,13 @@ static void xgbe_phy_status_result(struct xgbe_prv_data *pdata)
13671367

13681368
pdata->phy.duplex = DUPLEX_FULL;
13691369

1370-
if (xgbe_set_mode(pdata, mode) && pdata->an_again)
1370+
if (!xgbe_set_mode(pdata, mode))
1371+
return false;
1372+
1373+
if (pdata->an_again)
13711374
xgbe_phy_reconfig_aneg(pdata);
1375+
1376+
return true;
13721377
}
13731378

13741379
static void xgbe_phy_status(struct xgbe_prv_data *pdata)
@@ -1398,7 +1403,8 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
13981403
return;
13991404
}
14001405

1401-
xgbe_phy_status_result(pdata);
1406+
if (xgbe_phy_status_result(pdata))
1407+
return;
14021408

14031409
if (test_bit(XGBE_LINK_INIT, &pdata->dev_state))
14041410
clear_bit(XGBE_LINK_INIT, &pdata->dev_state);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,11 +1152,11 @@ int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)
11521152
unsigned int total_rx_bytes = 0, total_rx_pkts = 0;
11531153
unsigned int offset = rx_ring->rx_offset;
11541154
struct xdp_buff *xdp = &rx_ring->xdp;
1155+
u32 cached_ntc = rx_ring->first_desc;
11551156
struct ice_tx_ring *xdp_ring = NULL;
11561157
struct bpf_prog *xdp_prog = NULL;
11571158
u32 ntc = rx_ring->next_to_clean;
11581159
u32 cnt = rx_ring->count;
1159-
u32 cached_ntc = ntc;
11601160
u32 xdp_xmit = 0;
11611161
u32 cached_ntu;
11621162
bool failure;

drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ static void poll_trace(struct mlx5_fw_tracer *tracer,
490490
(u64)timestamp_low;
491491
break;
492492
default:
493-
if (tracer_event->event_id >= tracer->str_db.first_string_trace ||
493+
if (tracer_event->event_id >= tracer->str_db.first_string_trace &&
494494
tracer_event->event_id <= tracer->str_db.first_string_trace +
495495
tracer->str_db.num_string_trace) {
496496
tracer_event->type = TRACER_EVENT_TYPE_STRING;

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ struct mlx5e_params {
327327
unsigned int sw_mtu;
328328
int hard_mtu;
329329
bool ptp_rx;
330+
__be32 terminate_lkey_be;
330331
};
331332

332333
static inline u8 mlx5e_get_dcb_num_tc(struct mlx5e_params *params)

drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int mlx5e_port_query_buffer(struct mlx5e_priv *priv,
5151
if (err)
5252
goto out;
5353

54-
for (i = 0; i < MLX5E_MAX_BUFFER; i++) {
54+
for (i = 0; i < MLX5E_MAX_NETWORK_BUFFER; i++) {
5555
buffer = MLX5_ADDR_OF(pbmc_reg, out, buffer[i]);
5656
port_buffer->buffer[i].lossy =
5757
MLX5_GET(bufferx_reg, buffer, lossy);
@@ -73,14 +73,24 @@ int mlx5e_port_query_buffer(struct mlx5e_priv *priv,
7373
port_buffer->buffer[i].lossy);
7474
}
7575

76-
port_buffer->headroom_size = total_used;
76+
port_buffer->internal_buffers_size = 0;
77+
for (i = MLX5E_MAX_NETWORK_BUFFER; i < MLX5E_TOTAL_BUFFERS; i++) {
78+
buffer = MLX5_ADDR_OF(pbmc_reg, out, buffer[i]);
79+
port_buffer->internal_buffers_size +=
80+
MLX5_GET(bufferx_reg, buffer, size) * port_buff_cell_sz;
81+
}
82+
7783
port_buffer->port_buffer_size =
7884
MLX5_GET(pbmc_reg, out, port_buffer_size) * port_buff_cell_sz;
79-
port_buffer->spare_buffer_size =
80-
port_buffer->port_buffer_size - total_used;
81-
82-
mlx5e_dbg(HW, priv, "total buffer size=%d, spare buffer size=%d\n",
83-
port_buffer->port_buffer_size,
85+
port_buffer->headroom_size = total_used;
86+
port_buffer->spare_buffer_size = port_buffer->port_buffer_size -
87+
port_buffer->internal_buffers_size -
88+
port_buffer->headroom_size;
89+
90+
mlx5e_dbg(HW, priv,
91+
"total buffer size=%u, headroom buffer size=%u, internal buffers size=%u, spare buffer size=%u\n",
92+
port_buffer->port_buffer_size, port_buffer->headroom_size,
93+
port_buffer->internal_buffers_size,
8494
port_buffer->spare_buffer_size);
8595
out:
8696
kfree(out);
@@ -206,11 +216,11 @@ static int port_update_pool_cfg(struct mlx5_core_dev *mdev,
206216
if (!MLX5_CAP_GEN(mdev, sbcam_reg))
207217
return 0;
208218

209-
for (i = 0; i < MLX5E_MAX_BUFFER; i++)
219+
for (i = 0; i < MLX5E_MAX_NETWORK_BUFFER; i++)
210220
lossless_buff_count += ((port_buffer->buffer[i].size) &&
211221
(!(port_buffer->buffer[i].lossy)));
212222

213-
for (i = 0; i < MLX5E_MAX_BUFFER; i++) {
223+
for (i = 0; i < MLX5E_MAX_NETWORK_BUFFER; i++) {
214224
p = select_sbcm_params(&port_buffer->buffer[i], lossless_buff_count);
215225
err = mlx5e_port_set_sbcm(mdev, 0, i,
216226
MLX5_INGRESS_DIR,
@@ -293,7 +303,7 @@ static int port_set_buffer(struct mlx5e_priv *priv,
293303
if (err)
294304
goto out;
295305

296-
for (i = 0; i < MLX5E_MAX_BUFFER; i++) {
306+
for (i = 0; i < MLX5E_MAX_NETWORK_BUFFER; i++) {
297307
void *buffer = MLX5_ADDR_OF(pbmc_reg, in, buffer[i]);
298308
u64 size = port_buffer->buffer[i].size;
299309
u64 xoff = port_buffer->buffer[i].xoff;
@@ -351,7 +361,7 @@ static int update_xoff_threshold(struct mlx5e_port_buffer *port_buffer,
351361
{
352362
int i;
353363

354-
for (i = 0; i < MLX5E_MAX_BUFFER; i++) {
364+
for (i = 0; i < MLX5E_MAX_NETWORK_BUFFER; i++) {
355365
if (port_buffer->buffer[i].lossy) {
356366
port_buffer->buffer[i].xoff = 0;
357367
port_buffer->buffer[i].xon = 0;
@@ -408,7 +418,7 @@ static int update_buffer_lossy(struct mlx5_core_dev *mdev,
408418
int err;
409419
int i;
410420

411-
for (i = 0; i < MLX5E_MAX_BUFFER; i++) {
421+
for (i = 0; i < MLX5E_MAX_NETWORK_BUFFER; i++) {
412422
prio_count = 0;
413423
lossy_count = 0;
414424

@@ -432,11 +442,11 @@ static int update_buffer_lossy(struct mlx5_core_dev *mdev,
432442
}
433443

434444
if (changed) {
435-
err = port_update_pool_cfg(mdev, port_buffer);
445+
err = update_xoff_threshold(port_buffer, xoff, max_mtu, port_buff_cell_sz);
436446
if (err)
437447
return err;
438448

439-
err = update_xoff_threshold(port_buffer, xoff, max_mtu, port_buff_cell_sz);
449+
err = port_update_pool_cfg(mdev, port_buffer);
440450
if (err)
441451
return err;
442452

@@ -515,7 +525,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
515525

516526
if (change & MLX5E_PORT_BUFFER_PRIO2BUFFER) {
517527
update_prio2buffer = true;
518-
for (i = 0; i < MLX5E_MAX_BUFFER; i++)
528+
for (i = 0; i < MLX5E_MAX_NETWORK_BUFFER; i++)
519529
mlx5e_dbg(HW, priv, "%s: requested to map prio[%d] to buffer %d\n",
520530
__func__, i, prio2buffer[i]);
521531

@@ -530,7 +540,7 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
530540
}
531541

532542
if (change & MLX5E_PORT_BUFFER_SIZE) {
533-
for (i = 0; i < MLX5E_MAX_BUFFER; i++) {
543+
for (i = 0; i < MLX5E_MAX_NETWORK_BUFFER; i++) {
534544
mlx5e_dbg(HW, priv, "%s: buffer[%d]=%d\n", __func__, i, buffer_size[i]);
535545
if (!port_buffer.buffer[i].lossy && !buffer_size[i]) {
536546
mlx5e_dbg(HW, priv, "%s: lossless buffer[%d] size cannot be zero\n",
@@ -544,7 +554,9 @@ int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
544554

545555
mlx5e_dbg(HW, priv, "%s: total buffer requested=%d\n", __func__, total_used);
546556

547-
if (total_used > port_buffer.port_buffer_size)
557+
if (total_used > port_buffer.headroom_size &&
558+
(total_used - port_buffer.headroom_size) >
559+
port_buffer.spare_buffer_size)
548560
return -EINVAL;
549561

550562
update_buffer = true;

drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
#include "en.h"
3636
#include "port.h"
3737

38-
#define MLX5E_MAX_BUFFER 8
38+
#define MLX5E_MAX_NETWORK_BUFFER 8
39+
#define MLX5E_TOTAL_BUFFERS 10
3940
#define MLX5E_DEFAULT_CABLE_LEN 7 /* 7 meters */
4041

4142
#define MLX5_BUFFER_SUPPORTED(mdev) (MLX5_CAP_GEN(mdev, pcam_reg) && \
@@ -60,8 +61,9 @@ struct mlx5e_bufferx_reg {
6061
struct mlx5e_port_buffer {
6162
u32 port_buffer_size;
6263
u32 spare_buffer_size;
63-
u32 headroom_size;
64-
struct mlx5e_bufferx_reg buffer[MLX5E_MAX_BUFFER];
64+
u32 headroom_size; /* Buffers 0-7 */
65+
u32 internal_buffers_size; /* Buffers 8-9 */
66+
struct mlx5e_bufferx_reg buffer[MLX5E_MAX_NETWORK_BUFFER];
6567
};
6668

6769
int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,

0 commit comments

Comments
 (0)