Commit f4f1fd76 authored by Paolo Abeni's avatar Paolo Abeni

Merge branch 'mlxsw-remove-size-limitations-on-egress-descriptor-buffer'

Ido Schimmel says:

====================
mlxsw: Remove size limitations on egress descriptor buffer

Petr says:

Spectrum machines have two resources related to keeping packets in an
internal buffer: bytes (allocated in cell-sized units) for packet payload,
and descriptors, for keeping headers. Currently, mlxsw only configures the
bytes part of the resource management.

Spectrum switches permit a full parallel configuration for the descriptor
resources, including port-pool and port-TC-pool quotas. By default, these
are all configured to use pool 14, with an infinite quota. The ingress pool
14 is then infinite in size.

However, egress pool 14 has finite size by default. The size is chip
dependent, but always much lower than what the chip actually permits. As a
result, we can easily construct workloads that exhaust the configured
descriptor limit.

Going forward, mlxsw will have to fix this issue properly by maintaining
descriptor buffer sizes, TC bindings, and quotas that match the
architecture recommendation. Short term, fix the issue by configuring the
egress descriptor pool to be infinite in size as well. This will maintain
the same configuration philosophy, but will unlock all chip resources to be
usable.

In this patchset, patch #1 first adds the "desc" field into the pool
configuration register. Then in patch #2, the new field is used to
configure both ingress and egress pool 14 as infinite.

In patches #3 and #4, add a selftest that verifies that a large burst
can be absorbed by the shared buffer. This test specifically exercises a
scenario where descriptor buffer is the limiting factor and the test
fails without the above patches.
====================

Link: https://lore.kernel.org/r/20220502084926.365268-1-idosch@nvidia.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents cb636b3e 1d267aa8
......@@ -12641,6 +12641,12 @@ static inline void mlxsw_reg_tidem_pack(char *payload, u8 underlay_ecn,
MLXSW_REG_DEFINE(sbpr, MLXSW_REG_SBPR_ID, MLXSW_REG_SBPR_LEN);
/* reg_sbpr_desc
* When set, configures descriptor buffer.
* Access: Index
*/
MLXSW_ITEM32(reg, sbpr, desc, 0x00, 31, 1);
/* shared direstion enum for SBPR, SBCM, SBPM */
enum mlxsw_reg_sbxx_dir {
MLXSW_REG_SBXX_DIR_INGRESS,
......
......@@ -202,6 +202,21 @@ static int mlxsw_sp_sb_pr_write(struct mlxsw_sp *mlxsw_sp, u16 pool_index,
return 0;
}
static int mlxsw_sp_sb_pr_desc_write(struct mlxsw_sp *mlxsw_sp,
enum mlxsw_reg_sbxx_dir dir,
enum mlxsw_reg_sbpr_mode mode,
u32 size, bool infi_size)
{
char sbpr_pl[MLXSW_REG_SBPR_LEN];
/* The FW default descriptor buffer configuration uses only pool 14 for
* descriptors.
*/
mlxsw_reg_sbpr_pack(sbpr_pl, 14, dir, mode, size, infi_size);
mlxsw_reg_sbpr_desc_set(sbpr_pl, true);
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sbpr), sbpr_pl);
}
static int mlxsw_sp_sb_cm_write(struct mlxsw_sp *mlxsw_sp, u16 local_port,
u8 pg_buff, u32 min_buff, u32 max_buff,
bool infi_max, u16 pool_index)
......@@ -775,6 +790,17 @@ static int mlxsw_sp_sb_prs_init(struct mlxsw_sp *mlxsw_sp,
if (err)
return err;
}
err = mlxsw_sp_sb_pr_desc_write(mlxsw_sp, MLXSW_REG_SBXX_DIR_INGRESS,
MLXSW_REG_SBPR_MODE_DYNAMIC, 0, true);
if (err)
return err;
err = mlxsw_sp_sb_pr_desc_write(mlxsw_sp, MLXSW_REG_SBXX_DIR_EGRESS,
MLXSW_REG_SBPR_MODE_DYNAMIC, 0, true);
if (err)
return err;
return 0;
}
......
This diff is collapsed.
......@@ -1375,25 +1375,40 @@ flood_test()
__start_traffic()
{
local pktsize=$1; shift
local proto=$1; shift
local h_in=$1; shift # Where the traffic egresses the host
local sip=$1; shift
local dip=$1; shift
local dmac=$1; shift
$MZ $h_in -p 8000 -A $sip -B $dip -c 0 \
$MZ $h_in -p $pktsize -A $sip -B $dip -c 0 \
-a own -b $dmac -t "$proto" -q "$@" &
sleep 1
}
start_traffic_pktsize()
{
local pktsize=$1; shift
__start_traffic $pktsize udp "$@"
}
start_tcp_traffic_pktsize()
{
local pktsize=$1; shift
__start_traffic $pktsize tcp "$@"
}
start_traffic()
{
__start_traffic udp "$@"
start_traffic_pktsize 8000 "$@"
}
start_tcp_traffic()
{
__start_traffic tcp "$@"
start_tcp_traffic_pktsize 8000 "$@"
}
stop_traffic()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment