Skip to content

Commit cfceccc

Browse files
committed
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>
2 parents 043d5f6 + f520489 commit cfceccc

File tree

6 files changed

+17
-26
lines changed

6 files changed

+17
-26
lines changed

drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ static const struct mlxsw_afk_element_info mlxsw_afk_element_infos[] = {
3232
MLXSW_AFK_ELEMENT_INFO_U32(IP_TTL_, 0x18, 0, 8),
3333
MLXSW_AFK_ELEMENT_INFO_U32(IP_ECN, 0x18, 9, 2),
3434
MLXSW_AFK_ELEMENT_INFO_U32(IP_DSCP, 0x18, 11, 6),
35-
MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_MSB, 0x18, 17, 3),
36-
MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_LSB, 0x18, 20, 8),
35+
MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_MSB, 0x18, 17, 4),
36+
MLXSW_AFK_ELEMENT_INFO_U32(VIRT_ROUTER_LSB, 0x18, 21, 8),
3737
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_96_127, 0x20, 4),
3838
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_64_95, 0x24, 4),
3939
MLXSW_AFK_ELEMENT_INFO_BUF(SRC_IP_32_63, 0x28, 4),

drivers/net/ethernet/mellanox/mlxsw/pci.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,15 @@ static void mlxsw_pci_skb_cb_ts_set(struct mlxsw_pci *mlxsw_pci,
517517
struct sk_buff *skb,
518518
enum mlxsw_pci_cqe_v cqe_v, char *cqe)
519519
{
520+
u8 ts_type;
521+
520522
if (cqe_v != MLXSW_PCI_CQE_V2)
521523
return;
522524

523-
if (mlxsw_pci_cqe2_time_stamp_type_get(cqe) !=
524-
MLXSW_PCI_CQE_TIME_STAMP_TYPE_UTC)
525+
ts_type = mlxsw_pci_cqe2_time_stamp_type_get(cqe);
526+
527+
if (ts_type != MLXSW_PCI_CQE_TIME_STAMP_TYPE_UTC &&
528+
ts_type != MLXSW_PCI_CQE_TIME_STAMP_TYPE_MIRROR_UTC)
525529
return;
526530

527531
mlxsw_skb_cb(skb)->cqe_ts.sec = mlxsw_pci_cqe2_time_stamp_sec_get(cqe);

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,6 @@ MLXSW_ITEM32(reg, sspr, m, 0x00, 31, 1);
9797
*/
9898
MLXSW_ITEM32_LP(reg, sspr, 0x00, 16, 0x00, 12);
9999

100-
/* reg_sspr_sub_port
101-
* Virtual port within the physical port.
102-
* Should be set to 0 when virtual ports are not enabled on the port.
103-
*
104-
* Access: RW
105-
*/
106-
MLXSW_ITEM32(reg, sspr, sub_port, 0x00, 8, 8);
107-
108100
/* reg_sspr_system_port
109101
* Unique identifier within the stacking domain that represents all the ports
110102
* that are available in the system (external ports).
@@ -120,7 +112,6 @@ static inline void mlxsw_reg_sspr_pack(char *payload, u16 local_port)
120112
MLXSW_REG_ZERO(sspr, payload);
121113
mlxsw_reg_sspr_m_set(payload, 1);
122114
mlxsw_reg_sspr_local_port_set(payload, local_port);
123-
mlxsw_reg_sspr_sub_port_set(payload, 0);
124115
mlxsw_reg_sspr_system_port_set(payload, local_port);
125116
}
126117

drivers/net/ethernet/mellanox/mlxsw/spectrum2_mr_tcam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ mlxsw_sp2_mr_tcam_rule_parse(struct mlxsw_sp_acl_rule *rule,
193193
key->vrid, GENMASK(7, 0));
194194
mlxsw_sp_acl_rulei_keymask_u32(rulei,
195195
MLXSW_AFK_ELEMENT_VIRT_ROUTER_MSB,
196-
key->vrid >> 8, GENMASK(2, 0));
196+
key->vrid >> 8, GENMASK(3, 0));
197197
switch (key->proto) {
198198
case MLXSW_SP_L3_PROTO_IPV4:
199199
return mlxsw_sp2_mr_tcam_rule_parse4(rulei, key);

drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_2[] = {
171171

172172
static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_4[] = {
173173
MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_LSB, 0x04, 24, 8),
174-
MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_MSB, 0x00, 0, 3),
174+
MLXSW_AFK_ELEMENT_INST_EXT_U32(VIRT_ROUTER_MSB, 0x00, 0, 3, 0, true),
175175
};
176176

177177
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[] = {
321321

322322
static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv4_4b[] = {
323323
MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_LSB, 0x04, 13, 8),
324-
MLXSW_AFK_ELEMENT_INST_EXT_U32(VIRT_ROUTER_MSB, 0x04, 21, 4, 0, true),
324+
MLXSW_AFK_ELEMENT_INST_U32(VIRT_ROUTER_MSB, 0x04, 21, 4),
325325
};
326326

327327
static struct mlxsw_afk_element_inst mlxsw_sp_afk_element_info_ipv6_2b[] = {

tools/testing/selftests/drivers/net/mlxsw/sharedbuffer.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ sb_occ_etc_check()
9898

9999
port_pool_test()
100100
{
101-
local exp_max_occ=288
101+
local exp_max_occ=$(devlink_cell_size_get)
102102
local max_occ
103103

104104
devlink sb occupancy clearmax $DEVLINK_DEV
105105

106-
$MZ $h1 -c 1 -p 160 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
106+
$MZ $h1 -c 1 -p 10 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
107107
-t ip -q
108108

109109
devlink sb occupancy snapshot $DEVLINK_DEV
@@ -126,12 +126,12 @@ port_pool_test()
126126

127127
port_tc_ip_test()
128128
{
129-
local exp_max_occ=288
129+
local exp_max_occ=$(devlink_cell_size_get)
130130
local max_occ
131131

132132
devlink sb occupancy clearmax $DEVLINK_DEV
133133

134-
$MZ $h1 -c 1 -p 160 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
134+
$MZ $h1 -c 1 -p 10 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
135135
-t ip -q
136136

137137
devlink sb occupancy snapshot $DEVLINK_DEV
@@ -154,16 +154,12 @@ port_tc_ip_test()
154154

155155
port_tc_arp_test()
156156
{
157-
local exp_max_occ=96
157+
local exp_max_occ=$(devlink_cell_size_get)
158158
local max_occ
159159

160-
if [[ $MLXSW_CHIP != "mlxsw_spectrum" ]]; then
161-
exp_max_occ=144
162-
fi
163-
164160
devlink sb occupancy clearmax $DEVLINK_DEV
165161

166-
$MZ $h1 -c 1 -p 160 -a $h1mac -A 192.0.1.1 -t arp -q
162+
$MZ $h1 -c 1 -p 10 -a $h1mac -A 192.0.1.1 -t arp -q
167163

168164
devlink sb occupancy snapshot $DEVLINK_DEV
169165

0 commit comments

Comments
 (0)