Skip to content

Commit ce30df2

Browse files
committed
Merge tag 'mlx5-updates-2023-11-13' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
mlx5-updates-2023-11-13 1) Cleanup patches, leftovers from previous cycle 2) Allow sync reset flow when BF MGT interface device is present 3) Trivial ptp refactorings and improvements 4) Add local loopback counter to vport rep stats Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 39620a3 + 23ec697 commit ce30df2

File tree

14 files changed

+139
-77
lines changed

14 files changed

+139
-77
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ int mlx5_crdump_collect(struct mlx5_core_dev *dev, u32 *cr_data)
5555
ret = mlx5_vsc_sem_set_space(dev, MLX5_SEMAPHORE_SW_RESET,
5656
MLX5_VSC_LOCK);
5757
if (ret) {
58-
mlx5_core_warn(dev, "Failed to lock SW reset semaphore\n");
58+
if (ret == -EBUSY)
59+
mlx5_core_info(dev, "SW reset semaphore is already in use\n");
60+
else
61+
mlx5_core_warn(dev, "Failed to lock SW reset semaphore\n");
5962
goto unlock_gw;
6063
}
6164

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ mlx5e_rep_setup_tc_cls_flower(struct mlx5e_priv *priv,
147147
}
148148
}
149149

150+
static void mlx5e_tc_stats_matchall(struct mlx5e_priv *priv,
151+
struct tc_cls_matchall_offload *ma)
152+
{
153+
struct mlx5e_rep_priv *rpriv = priv->ppriv;
154+
u64 dbytes;
155+
u64 dpkts;
156+
157+
dpkts = priv->stats.rep_stats.vport_rx_packets - rpriv->prev_vf_vport_stats.rx_packets;
158+
dbytes = priv->stats.rep_stats.vport_rx_bytes - rpriv->prev_vf_vport_stats.rx_bytes;
159+
mlx5e_stats_copy_rep_stats(&rpriv->prev_vf_vport_stats, &priv->stats.rep_stats);
160+
flow_stats_update(&ma->stats, dbytes, dpkts, 0, jiffies,
161+
FLOW_ACTION_HW_STATS_DELAYED);
162+
}
163+
150164
static
151165
int mlx5e_rep_setup_tc_cls_matchall(struct mlx5e_priv *priv,
152166
struct tc_cls_matchall_offload *ma)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ mlx5e_tc_act_pedit_parse_action(struct mlx5e_priv *priv,
4848
struct pedit_headers_action *hdrs,
4949
struct netlink_ext_ack *extack)
5050
{
51-
u8 cmd = (act->id == FLOW_ACTION_MANGLE) ? 0 : 1;
51+
u8 cmd = (act->id == FLOW_ACTION_MANGLE) ? TCA_PEDIT_KEY_EX_CMD_SET :
52+
TCA_PEDIT_KEY_EX_CMD_ADD;
5253
u8 htype = act->mangle.htype;
5354
int err = -EOPNOTSUPP;
5455
u32 mask, val, offset;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5244,7 +5244,6 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
52445244

52455245
netdev->gso_partial_features |= NETIF_F_GSO_UDP_L4;
52465246
netdev->hw_features |= NETIF_F_GSO_UDP_L4;
5247-
netdev->features |= NETIF_F_GSO_UDP_L4;
52485247

52495248
mlx5_query_port_fcs(mdev, &fcs_supported, &fcs_enabled);
52505249

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,18 @@ static const struct counter_desc vport_rep_stats_desc[] = {
112112
tx_vport_rdma_multicast_bytes) },
113113
};
114114

115+
static const struct counter_desc vport_rep_loopback_stats_desc[] = {
116+
{ MLX5E_DECLARE_STAT(struct mlx5e_rep_stats,
117+
vport_loopback_packets) },
118+
{ MLX5E_DECLARE_STAT(struct mlx5e_rep_stats,
119+
vport_loopback_bytes) },
120+
};
121+
115122
#define NUM_VPORT_REP_SW_COUNTERS ARRAY_SIZE(sw_rep_stats_desc)
116123
#define NUM_VPORT_REP_HW_COUNTERS ARRAY_SIZE(vport_rep_stats_desc)
124+
#define NUM_VPORT_REP_LOOPBACK_COUNTERS(dev) \
125+
(MLX5_CAP_GEN(dev, vport_counter_local_loopback) ? \
126+
ARRAY_SIZE(vport_rep_loopback_stats_desc) : 0)
117127

118128
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(sw_rep)
119129
{
@@ -157,7 +167,8 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(sw_rep)
157167

158168
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(vport_rep)
159169
{
160-
return NUM_VPORT_REP_HW_COUNTERS;
170+
return NUM_VPORT_REP_HW_COUNTERS +
171+
NUM_VPORT_REP_LOOPBACK_COUNTERS(priv->mdev);
161172
}
162173

163174
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(vport_rep)
@@ -166,6 +177,9 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(vport_rep)
166177

167178
for (i = 0; i < NUM_VPORT_REP_HW_COUNTERS; i++)
168179
strcpy(data + (idx++) * ETH_GSTRING_LEN, vport_rep_stats_desc[i].format);
180+
for (i = 0; i < NUM_VPORT_REP_LOOPBACK_COUNTERS(priv->mdev); i++)
181+
strcpy(data + (idx++) * ETH_GSTRING_LEN,
182+
vport_rep_loopback_stats_desc[i].format);
169183
return idx;
170184
}
171185

@@ -176,6 +190,9 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(vport_rep)
176190
for (i = 0; i < NUM_VPORT_REP_HW_COUNTERS; i++)
177191
data[idx++] = MLX5E_READ_CTR64_CPU(&priv->stats.rep_stats,
178192
vport_rep_stats_desc, i);
193+
for (i = 0; i < NUM_VPORT_REP_LOOPBACK_COUNTERS(priv->mdev); i++)
194+
data[idx++] = MLX5E_READ_CTR64_CPU(&priv->stats.rep_stats,
195+
vport_rep_loopback_stats_desc, i);
179196
return idx;
180197
}
181198

@@ -247,6 +264,13 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
247264
rep_stats->tx_vport_rdma_multicast_bytes =
248265
MLX5_GET_CTR(out, received_ib_multicast.octets);
249266

267+
if (MLX5_CAP_GEN(priv->mdev, vport_counter_local_loopback)) {
268+
rep_stats->vport_loopback_packets =
269+
MLX5_GET_CTR(out, local_loopback.packets);
270+
rep_stats->vport_loopback_bytes =
271+
MLX5_GET_CTR(out, local_loopback.octets);
272+
}
273+
250274
out:
251275
kvfree(out);
252276
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ struct mlx5e_rep_stats {
476476
u64 tx_vport_rdma_multicast_packets;
477477
u64 rx_vport_rdma_multicast_bytes;
478478
u64 tx_vport_rdma_multicast_bytes;
479+
u64 vport_loopback_packets;
480+
u64 vport_loopback_bytes;
479481
};
480482

481483
struct mlx5e_stats {

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

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3206,10 +3206,10 @@ static int offload_pedit_fields(struct mlx5e_priv *priv,
32063206
headers_c = mlx5e_get_match_headers_criteria(*action_flags, &parse_attr->spec);
32073207
headers_v = mlx5e_get_match_headers_value(*action_flags, &parse_attr->spec);
32083208

3209-
set_masks = &hdrs[0].masks;
3210-
add_masks = &hdrs[1].masks;
3211-
set_vals = &hdrs[0].vals;
3212-
add_vals = &hdrs[1].vals;
3209+
set_masks = &hdrs[TCA_PEDIT_KEY_EX_CMD_SET].masks;
3210+
add_masks = &hdrs[TCA_PEDIT_KEY_EX_CMD_ADD].masks;
3211+
set_vals = &hdrs[TCA_PEDIT_KEY_EX_CMD_SET].vals;
3212+
add_vals = &hdrs[TCA_PEDIT_KEY_EX_CMD_ADD].vals;
32133213

32143214
for (i = 0; i < ARRAY_SIZE(fields); i++) {
32153215
bool skip;
@@ -5011,22 +5011,6 @@ int mlx5e_tc_delete_matchall(struct mlx5e_priv *priv,
50115011
return apply_police_params(priv, 0, extack);
50125012
}
50135013

5014-
void mlx5e_tc_stats_matchall(struct mlx5e_priv *priv,
5015-
struct tc_cls_matchall_offload *ma)
5016-
{
5017-
struct mlx5e_rep_priv *rpriv = priv->ppriv;
5018-
struct rtnl_link_stats64 cur_stats;
5019-
u64 dbytes;
5020-
u64 dpkts;
5021-
5022-
mlx5e_stats_copy_rep_stats(&cur_stats, &priv->stats.rep_stats);
5023-
dpkts = cur_stats.rx_packets - rpriv->prev_vf_vport_stats.rx_packets;
5024-
dbytes = cur_stats.rx_bytes - rpriv->prev_vf_vport_stats.rx_bytes;
5025-
rpriv->prev_vf_vport_stats = cur_stats;
5026-
flow_stats_update(&ma->stats, dbytes, dpkts, 0, jiffies,
5027-
FLOW_ACTION_HW_STATS_DELAYED);
5028-
}
5029-
50305014
static void mlx5e_tc_hairpin_update_dead_peer(struct mlx5e_priv *priv,
50315015
struct mlx5e_priv *peer_priv)
50325016
{

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ int mlx5e_tc_configure_matchall(struct mlx5e_priv *priv,
203203
struct tc_cls_matchall_offload *f);
204204
int mlx5e_tc_delete_matchall(struct mlx5e_priv *priv,
205205
struct tc_cls_matchall_offload *f);
206-
void mlx5e_tc_stats_matchall(struct mlx5e_priv *priv,
207-
struct tc_cls_matchall_offload *ma);
208206

209207
struct mlx5e_encap_entry;
210208
void mlx5e_tc_encap_flows_add(struct mlx5e_priv *priv,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ struct mlx5_flow_rule {
181181

182182
struct mlx5_flow_handle {
183183
int num_rules;
184-
struct mlx5_flow_rule *rule[];
184+
struct mlx5_flow_rule *rule[] __counted_by(num_rules);
185185
};
186186

187187
/* Type of children is mlx5_flow_group */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ struct mlx5_fc_bulk {
539539
u32 base_id;
540540
int bulk_len;
541541
unsigned long *bitmask;
542-
struct mlx5_fc fcs[];
542+
struct mlx5_fc fcs[] __counted_by(bulk_len);
543543
};
544544

545545
static void mlx5_fc_init(struct mlx5_fc *counter, struct mlx5_fc_bulk *bulk,

0 commit comments

Comments
 (0)