Commit ce30df20 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 39620a35 23ec6972
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ int mlx5_crdump_collect(struct mlx5_core_dev *dev, u32 *cr_data)
	ret = mlx5_vsc_sem_set_space(dev, MLX5_SEMAPHORE_SW_RESET,
				     MLX5_VSC_LOCK);
	if (ret) {
		if (ret == -EBUSY)
			mlx5_core_info(dev, "SW reset semaphore is already in use\n");
		else
			mlx5_core_warn(dev, "Failed to lock SW reset semaphore\n");
		goto unlock_gw;
	}
+14 −0
Original line number Diff line number Diff line
@@ -147,6 +147,20 @@ mlx5e_rep_setup_tc_cls_flower(struct mlx5e_priv *priv,
	}
}

static void mlx5e_tc_stats_matchall(struct mlx5e_priv *priv,
				    struct tc_cls_matchall_offload *ma)
{
	struct mlx5e_rep_priv *rpriv = priv->ppriv;
	u64 dbytes;
	u64 dpkts;

	dpkts = priv->stats.rep_stats.vport_rx_packets - rpriv->prev_vf_vport_stats.rx_packets;
	dbytes = priv->stats.rep_stats.vport_rx_bytes - rpriv->prev_vf_vport_stats.rx_bytes;
	mlx5e_stats_copy_rep_stats(&rpriv->prev_vf_vport_stats, &priv->stats.rep_stats);
	flow_stats_update(&ma->stats, dbytes, dpkts, 0, jiffies,
			  FLOW_ACTION_HW_STATS_DELAYED);
}

static
int mlx5e_rep_setup_tc_cls_matchall(struct mlx5e_priv *priv,
				    struct tc_cls_matchall_offload *ma)
+2 −1
Original line number Diff line number Diff line
@@ -48,7 +48,8 @@ mlx5e_tc_act_pedit_parse_action(struct mlx5e_priv *priv,
				struct pedit_headers_action *hdrs,
				struct netlink_ext_ack *extack)
{
	u8 cmd = (act->id == FLOW_ACTION_MANGLE) ? 0 : 1;
	u8 cmd = (act->id == FLOW_ACTION_MANGLE) ? TCA_PEDIT_KEY_EX_CMD_SET :
						   TCA_PEDIT_KEY_EX_CMD_ADD;
	u8 htype = act->mangle.htype;
	int err = -EOPNOTSUPP;
	u32 mask, val, offset;
+0 −1
Original line number Diff line number Diff line
@@ -5244,7 +5244,6 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)

	netdev->gso_partial_features             |= NETIF_F_GSO_UDP_L4;
	netdev->hw_features                      |= NETIF_F_GSO_UDP_L4;
	netdev->features                         |= NETIF_F_GSO_UDP_L4;

	mlx5_query_port_fcs(mdev, &fcs_supported, &fcs_enabled);

+25 −1
Original line number Diff line number Diff line
@@ -112,8 +112,18 @@ static const struct counter_desc vport_rep_stats_desc[] = {
			     tx_vport_rdma_multicast_bytes) },
};

static const struct counter_desc vport_rep_loopback_stats_desc[] = {
	{ MLX5E_DECLARE_STAT(struct mlx5e_rep_stats,
			     vport_loopback_packets) },
	{ MLX5E_DECLARE_STAT(struct mlx5e_rep_stats,
			     vport_loopback_bytes) },
};

#define NUM_VPORT_REP_SW_COUNTERS ARRAY_SIZE(sw_rep_stats_desc)
#define NUM_VPORT_REP_HW_COUNTERS ARRAY_SIZE(vport_rep_stats_desc)
#define NUM_VPORT_REP_LOOPBACK_COUNTERS(dev) \
	(MLX5_CAP_GEN(dev, vport_counter_local_loopback) ? \
	 ARRAY_SIZE(vport_rep_loopback_stats_desc) : 0)

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

static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(vport_rep)
{
	return NUM_VPORT_REP_HW_COUNTERS;
	return NUM_VPORT_REP_HW_COUNTERS +
	       NUM_VPORT_REP_LOOPBACK_COUNTERS(priv->mdev);
}

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

	for (i = 0; i < NUM_VPORT_REP_HW_COUNTERS; i++)
		strcpy(data + (idx++) * ETH_GSTRING_LEN, vport_rep_stats_desc[i].format);
	for (i = 0; i < NUM_VPORT_REP_LOOPBACK_COUNTERS(priv->mdev); i++)
		strcpy(data + (idx++) * ETH_GSTRING_LEN,
		       vport_rep_loopback_stats_desc[i].format);
	return idx;
}

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

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

	if (MLX5_CAP_GEN(priv->mdev, vport_counter_local_loopback)) {
		rep_stats->vport_loopback_packets =
			MLX5_GET_CTR(out, local_loopback.packets);
		rep_stats->vport_loopback_bytes =
			MLX5_GET_CTR(out, local_loopback.octets);
	}

out:
	kvfree(out);
}
Loading