Merge branch 'mlxsw-fixes-for-spectrum-4'

Petr Machata says:

====================
mlxsw: Fixes for Spectrum-4

This patchset contains an assortment of fixes for mlxsw Spectrum-4 support.
====================

Link: https://lore.kernel.org/r/cover.1692268427.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2023-08-18 19:41:10 -07:00
commit cfceccca01
6 changed files with 17 additions and 26 deletions

View File

@ -32,8 +32,8 @@ static const struct mlxsw_afk_element_info mlxsw_afk_element_infos[] = {
MLXSW_AFK_ELEMENT_INFO_U32(IP_TTL_, 0x18, 0, 8), MLXSW_AFK_ELEMENT_INFO_U32(IP_TTL_, 0x18, 0, 8),
MLXSW_AFK_ELEMENT_INFO_U32(IP_ECN, 0x18, 9, 2), MLXSW_AFK_ELEMENT_INFO_U32(IP_ECN, 0x18, 9, 2),
MLXSW_AFK_ELEMENT_INFO_U32(IP_DSCP, 0x18, 11, 6), MLXSW_AFK_ELEMENT_INFO_U32(IP_DSCP, 0x18, 11, 6),
MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_MSB, 0x18, 17, 3), MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_MSB, 0x18, 17, 4),
MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_LSB, 0x18, 20, 8), MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_LSB, 0x18, 21, 8),
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_96_127, 0x20, 4), MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_96_127, 0x20, 4),
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_64_95, 0x24, 4), MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_64_95, 0x24, 4),
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_32_63, 0x28, 4), MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_32_63, 0x28, 4),

View File

@ -517,11 +517,15 @@ static void mlxsw_pci_skb_cb_ts_set(struct mlxsw_pci *mlxsw_pci,
struct sk_buff *skb, struct sk_buff *skb,
enum mlxsw_pci_cqe_v cqe_v, char *cqe) enum mlxsw_pci_cqe_v cqe_v, char *cqe)
{ {
u8 ts_type;
if (cqe_v != MLXSW_PCI_CQE_V2) if (cqe_v != MLXSW_PCI_CQE_V2)
return; return;
if (mlxsw_pci_cqe2_time_stamp_type_get(cqe) != ts_type = mlxsw_pci_cqe2_time_stamp_type_get(cqe);
MLXSW_PCI_CQE_TIME_STAMP_TYPE_UTC)
if (ts_type != MLXSW_PCI_CQE_TIME_STAMP_TYPE_UTC &&
ts_type != MLXSW_PCI_CQE_TIME_STAMP_TYPE_MIRROR_UTC)
return; return;
mlxsw_skb_cb(skb)->cqe_ts.sec = mlxsw_pci_cqe2_time_stamp_sec_get(cqe); mlxsw_skb_cb(skb)->cqe_ts.sec = mlxsw_pci_cqe2_time_stamp_sec_get(cqe);

View File

@ -97,14 +97,6 @@ MLXSW_ITEM32(reg, sspr, m, 0x00, 31, 1);
*/ */
MLXSW_ITEM32_LP(reg, sspr, 0x00, 16, 0x00, 12); MLXSW_ITEM32_LP(reg, sspr, 0x00, 16, 0x00, 12);
/* reg_sspr_sub_port
* Virtual port within the physical port.
* Should be set to 0 when virtual ports are not enabled on the port.
*
* Access: RW
*/
MLXSW_ITEM32(reg, sspr, sub_port, 0x00, 8, 8);
/* reg_sspr_system_port /* reg_sspr_system_port
* Unique identifier within the stacking domain that represents all the ports * Unique identifier within the stacking domain that represents all the ports
* that are available in the system (external ports). * that are available in the system (external ports).
@ -120,7 +112,6 @@ static inline void mlxsw_reg_sspr_pack(char *payload, u16 local_port)
MLXSW_REG_ZERO(sspr, payload); MLXSW_REG_ZERO(sspr, payload);
mlxsw_reg_sspr_m_set(payload, 1); mlxsw_reg_sspr_m_set(payload, 1);
mlxsw_reg_sspr_local_port_set(payload, local_port); mlxsw_reg_sspr_local_port_set(payload, local_port);
mlxsw_reg_sspr_sub_port_set(payload, 0);
mlxsw_reg_sspr_system_port_set(payload, local_port); mlxsw_reg_sspr_system_port_set(payload, local_port);
} }

View File

@ -193,7 +193,7 @@ mlxsw_sp2_mr_tcam_rule_parse(struct mlxsw_sp_acl_rule *rule,
key->vrid, GENMASK(7, 0)); key->vrid, GENMASK(7, 0));
mlxsw_sp_acl_rulei_keymask_u32(rulei, mlxsw_sp_acl_rulei_keymask_u32(rulei,
MLXSW_AFK_ELEMENT_VIRT_ROUTER_MSB, MLXSW_AFK_ELEMENT_VIRT_ROUTER_MSB,
key->vrid >> 8, GENMASK(2, 0)); key->vrid >> 8, GENMASK(3, 0));
switch (key->proto) { switch (key->proto) {
case MLXSW_SP_L3_PROTO_IPV4: case MLXSW_SP_L3_PROTO_IPV4:
return mlxsw_sp2_mr_tcam_rule_parse4(rulei, key); return mlxsw_sp2_mr_tcam_rule_parse4(rulei, key);

View File

@ -171,7 +171,7 @@ static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_2[] = {
static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_4[] = { static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_4[] = {
MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_LSB, 0x04, 24, 8), MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_LSB, 0x04, 24, 8),
MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_MSB, 0x00, 0, 3), MLXSW_AFK_ELEMENT_INST_EXT_U32(VIRT_ROUTER_MSB, 0x00, 0, 3, 0, true),
}; };
static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv6_0[] = { static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv6_0[] = {
@ -321,7 +321,7 @@ static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_mac_5b[] = {
static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_4b[] = { static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_4b[] = {
MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_LSB, 0x04, 13, 8), MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_LSB, 0x04, 13, 8),
MLXSW_AFK_ELEMENT_INST_EXT_U32(VIRT_ROUTER_MSB, 0x04, 21, 4, 0, true), MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_MSB, 0x04, 21, 4),
}; };
static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv6_2b[] = { static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv6_2b[] = {

View File

@ -98,12 +98,12 @@ sb_occ_etc_check()
port_pool_test() port_pool_test()
{ {
local exp_max_occ=288 local exp_max_occ=$(devlink_cell_size_get)
local max_occ local max_occ
devlink sb occupancy clearmax $DEVLINK_DEV devlink sb occupancy clearmax $DEVLINK_DEV
$MZ $h1 -c 1 -p 160 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \ $MZ $h1 -c 1 -p 10 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
-t ip -q -t ip -q
devlink sb occupancy snapshot $DEVLINK_DEV devlink sb occupancy snapshot $DEVLINK_DEV
@ -126,12 +126,12 @@ port_pool_test()
port_tc_ip_test() port_tc_ip_test()
{ {
local exp_max_occ=288 local exp_max_occ=$(devlink_cell_size_get)
local max_occ local max_occ
devlink sb occupancy clearmax $DEVLINK_DEV devlink sb occupancy clearmax $DEVLINK_DEV
$MZ $h1 -c 1 -p 160 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \ $MZ $h1 -c 1 -p 10 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
-t ip -q -t ip -q
devlink sb occupancy snapshot $DEVLINK_DEV devlink sb occupancy snapshot $DEVLINK_DEV
@ -154,16 +154,12 @@ port_tc_ip_test()
port_tc_arp_test() port_tc_arp_test()
{ {
local exp_max_occ=96 local exp_max_occ=$(devlink_cell_size_get)
local max_occ local max_occ
if [[ $MLXSW_CHIP != "mlxsw_spectrum" ]]; then
exp_max_occ=144
fi
devlink sb occupancy clearmax $DEVLINK_DEV devlink sb occupancy clearmax $DEVLINK_DEV
$MZ $h1 -c 1 -p 160 -a $h1mac -A 192.0.1.1 -t arp -q $MZ $h1 -c 1 -p 10 -a $h1mac -A 192.0.1.1 -t arp -q
devlink sb occupancy snapshot $DEVLINK_DEV devlink sb occupancy snapshot $DEVLINK_DEV