Skip to content

Commit c8fda7d

Browse files
committed
Merge tag 'mlx5-updates-2022-07-13' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== mlx5-updates-2022-07-13 1) Support 802.1ad for bridge offloads Vlad Buslov Says: ================= Current mlx5 bridge VLAN offload implementation only supports 802.1Q VLAN Ethernet protocol. That protocol type is assumed by default and SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL notification is ignored. In order to support dynamically setting VLAN protocol handle SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL notification by flushing FDB and re-creating VLAN modify header actions with a new protocol. Implement support for 802.1ad protocol by saving the current VLAN protocol to per-bridge variable and re-create the necessary flow groups according to its current value (either use cvlan or svlan flow fields). ================== 2) debugfs to count ongoing FW commands 3) debugfs to query eswitch vport firmware diagnostic counters 4) Add missing meter configuration in flow action 5) Some misc cleanup * tag 'mlx5-updates-2022-07-13' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Remove the duplicating check for striding RQ when enabling LRO net/mlx5e: Move the LRO-XSK check to mlx5e_fix_features net/mlx5e: Extend flower police validation net/mlx5e: configure meter in flow action net/mlx5e: Removed useless code in function net/mlx5: Bridge, implement QinQ support net/mlx5: Bridge, implement infrastructure for VLAN protocol change net/mlx5: Bridge, extract VLAN push/pop actions creation net/mlx5: Bridge, rename filter fg to vlan_filter net/mlx5: Bridge, refactor groups sizes and indices net/mlx5: debugfs, Add num of in-use FW command interface slots net/mlx5: Expose vnic diagnostic counters for eswitch managed vports net/mlx5: Use software VHCA id when it's supported net/mlx5: Introduce ifc bits for using software vhca id net/mlx5: Use the bitmap API to allocate bitmaps ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 6e6fbb7 + 1a55048 commit c8fda7d

File tree

18 files changed

+684
-117
lines changed

18 files changed

+684
-117
lines changed

drivers/net/ethernet/mellanox/mlx5/core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ mlx5_core-$(CONFIG_MLX5_TC_SAMPLE) += en/tc/sample.o
6868
#
6969
mlx5_core-$(CONFIG_MLX5_ESWITCH) += eswitch.o eswitch_offloads.o eswitch_offloads_termtbl.o \
7070
ecpf.o rdma.o esw/legacy.o \
71-
esw/devlink_port.o esw/vporttbl.o esw/qos.o
71+
esw/debugfs.o esw/devlink_port.o esw/vporttbl.o esw/qos.o
7272

7373
mlx5_core-$(CONFIG_MLX5_ESWITCH) += esw/acl/helper.o \
7474
esw/acl/egress_lgcy.o esw/acl/egress_ofld.o \

drivers/net/ethernet/mellanox/mlx5/core/debugfs.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,28 @@ static const struct file_operations stats_fops = {
166166
.write = average_write,
167167
};
168168

169+
static ssize_t slots_read(struct file *filp, char __user *buf, size_t count,
170+
loff_t *pos)
171+
{
172+
struct mlx5_cmd *cmd;
173+
char tbuf[6];
174+
int weight;
175+
int field;
176+
int ret;
177+
178+
cmd = filp->private_data;
179+
weight = bitmap_weight(&cmd->bitmask, cmd->max_reg_cmds);
180+
field = cmd->max_reg_cmds - weight;
181+
ret = snprintf(tbuf, sizeof(tbuf), "%d\n", field);
182+
return simple_read_from_buffer(buf, count, pos, tbuf, ret);
183+
}
184+
185+
static const struct file_operations slots_fops = {
186+
.owner = THIS_MODULE,
187+
.open = simple_open,
188+
.read = slots_read,
189+
};
190+
169191
void mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev)
170192
{
171193
struct mlx5_cmd_stats *stats;
@@ -176,6 +198,8 @@ void mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev)
176198
cmd = &dev->priv.dbg.cmdif_debugfs;
177199
*cmd = debugfs_create_dir("commands", dev->priv.dbg.dbg_root);
178200

201+
debugfs_create_file("slots_inuse", 0400, *cmd, &dev->cmd, &slots_fops);
202+
179203
for (i = 0; i < MLX5_CMD_OP_MAX; i++) {
180204
stats = &dev->cmd.stats[i];
181205
namep = mlx5_command_str(i);

drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ mlx5_esw_bridge_port_obj_attr_set(struct net_device *dev,
269269
err = mlx5_esw_bridge_vlan_filtering_set(vport_num, esw_owner_vhca_id,
270270
attr->u.vlan_filtering, br_offloads);
271271
break;
272+
case SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL:
273+
err = mlx5_esw_bridge_vlan_proto_set(vport_num,
274+
esw_owner_vhca_id,
275+
attr->u.vlan_protocol,
276+
br_offloads);
277+
break;
272278
default:
273279
err = -EOPNOTSUPP;
274280
}

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ tc_act_can_offload_police(struct mlx5e_tc_act_parse_state *parse_state,
1010
int act_index,
1111
struct mlx5_flow_attr *attr)
1212
{
13+
if (act->police.notexceed.act_id != FLOW_ACTION_PIPE &&
14+
act->police.notexceed.act_id != FLOW_ACTION_ACCEPT) {
15+
NL_SET_ERR_MSG_MOD(parse_state->extack,
16+
"Offload not supported when conform action is not pipe or ok");
17+
return false;
18+
}
1319
if (mlx5e_policer_validate(parse_state->flow_action, act,
1420
parse_state->extack))
1521
return false;

drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,7 @@ mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv,
742742

743743
eth_rule->flow_spec = *fs;
744744
eth_rule->eth_ft = eth_ft;
745-
if (!eth_ft->ft) {
746-
err = -EINVAL;
747-
goto del_ethtool_rule;
748-
}
745+
749746
rule = add_ethtool_flow_rule(priv, eth_rule, eth_ft->ft, fs, rss_context);
750747
if (IS_ERR(rule)) {
751748
err = PTR_ERR(rule);

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3594,20 +3594,7 @@ static int set_feature_lro(struct net_device *netdev, bool enable)
35943594

35953595
mutex_lock(&priv->state_lock);
35963596

3597-
if (enable && priv->xsk.refcnt) {
3598-
netdev_warn(netdev, "LRO is incompatible with AF_XDP (%u XSKs are active)\n",
3599-
priv->xsk.refcnt);
3600-
err = -EINVAL;
3601-
goto out;
3602-
}
3603-
36043597
cur_params = &priv->channels.params;
3605-
if (enable && !MLX5E_GET_PFLAG(cur_params, MLX5E_PFLAG_RX_STRIDING_RQ)) {
3606-
netdev_warn(netdev, "can't set LRO with legacy RQ\n");
3607-
err = -EINVAL;
3608-
goto out;
3609-
}
3610-
36113598
new_params = *cur_params;
36123599

36133600
if (enable)
@@ -3916,6 +3903,11 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
39163903
}
39173904

39183905
if (priv->xsk.refcnt) {
3906+
if (features & NETIF_F_LRO) {
3907+
netdev_warn(netdev, "LRO is incompatible with AF_XDP (%u XSKs are active)\n",
3908+
priv->xsk.refcnt);
3909+
features &= ~NETIF_F_LRO;
3910+
}
39193911
if (features & NETIF_F_GRO_HW) {
39203912
netdev_warn(netdev, "HW GRO is incompatible with AF_XDP (%u XSKs are active)\n",
39213913
priv->xsk.refcnt);

0 commit comments

Comments
 (0)