Commit 92d2c594 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge tag 'mlx5-updates-2023-04-05' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2023-04-05

From Paul:
 - TC action parsing cleanups
 - Correctly report stats for missed packets
 - Many CT actions limitations removed due to hw misses will now
   continue from the relevant tc ct action in software.

From Adham:
 - RQ/SQ devlink health diagnostics layout fixes

From Gal And Rahul:
 - PTP code cleanup and cyclecounter shift value improvement

* tag 'mlx5-updates-2023-04-05' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
  net/mlx5e: Fix SQ SW state layout in SQ devlink health diagnostics
  net/mlx5e: Fix RQ SW state layout in RQ devlink health diagnostics
  net/mlx5e: Rename misleading skb_pc/cc references in ptp code
  net/mlx5: Update cyclecounter shift value to improve ptp free running mode precision
  net/mlx5e: Remove redundant macsec code
  net/mlx5e: TC, Remove sample and ct limitation
  net/mlx5e: TC, Remove mirror and ct limitation
  net/mlx5e: TC, Remove tuple rewrite and ct limitation
  net/mlx5e: TC, Remove multiple ct actions limitation
  net/mlx5e: TC, Remove special handling of CT action
  net/mlx5e: TC, Remove CT action reordering
  net/mlx5e: CT: Use per action stats
  net/mlx5e: TC, Move main flow attribute cleanup to helper func
  net/mlx5e: TC, Remove unused vf_tun variable
  net/mlx5e: Set default can_offload action
====================

Link: https://lore.kernel.org/r/20230406020232.83844-1-saeed@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents a9fda7a0 b0d87ed2
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -81,23 +81,23 @@ void mlx5e_skb_cb_hwtstamp_handler(struct sk_buff *skb, int hwtstamp_type,

#define PTP_WQE_CTR2IDX(val) ((val) & ptpsq->ts_cqe_ctr_mask)

static bool mlx5e_ptp_ts_cqe_drop(struct mlx5e_ptpsq *ptpsq, u16 skb_cc, u16 skb_id)
static bool mlx5e_ptp_ts_cqe_drop(struct mlx5e_ptpsq *ptpsq, u16 skb_ci, u16 skb_id)
{
	return (ptpsq->ts_cqe_ctr_mask && (skb_cc != skb_id));
	return (ptpsq->ts_cqe_ctr_mask && (skb_ci != skb_id));
}

static bool mlx5e_ptp_ts_cqe_ooo(struct mlx5e_ptpsq *ptpsq, u16 skb_id)
{
	u16 skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
	u16 skb_pc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_pc);
	u16 skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
	u16 skb_pi = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_pc);

	if (PTP_WQE_CTR2IDX(skb_id - skb_cc) >= PTP_WQE_CTR2IDX(skb_pc - skb_cc))
	if (PTP_WQE_CTR2IDX(skb_id - skb_ci) >= PTP_WQE_CTR2IDX(skb_pi - skb_ci))
		return true;

	return false;
}

static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_cc,
static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_ci,
					     u16 skb_id, int budget)
{
	struct skb_shared_hwtstamps hwts = {};
@@ -105,13 +105,13 @@ static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_

	ptpsq->cq_stats->resync_event++;

	while (skb_cc != skb_id) {
	while (skb_ci != skb_id) {
		skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo);
		hwts.hwtstamp = mlx5e_skb_cb_get_hwts(skb)->cqe_hwtstamp;
		skb_tstamp_tx(skb, &hwts);
		ptpsq->cq_stats->resync_cqe++;
		napi_consume_skb(skb, budget);
		skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
		skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
	}
}

@@ -120,7 +120,7 @@ static void mlx5e_ptp_handle_ts_cqe(struct mlx5e_ptpsq *ptpsq,
				    int budget)
{
	u16 skb_id = PTP_WQE_CTR2IDX(be16_to_cpu(cqe->wqe_counter));
	u16 skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
	u16 skb_ci = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
	struct mlx5e_txqsq *sq = &ptpsq->txqsq;
	struct sk_buff *skb;
	ktime_t hwtstamp;
@@ -131,13 +131,13 @@ static void mlx5e_ptp_handle_ts_cqe(struct mlx5e_ptpsq *ptpsq,
		goto out;
	}

	if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_cc, skb_id)) {
	if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_ci, skb_id)) {
		if (mlx5e_ptp_ts_cqe_ooo(ptpsq, skb_id)) {
			/* already handled by a previous resync */
			ptpsq->cq_stats->ooo_cqe_drop++;
			return;
		}
		mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_cc, skb_id, budget);
		mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_ci, skb_id, budget);
	}

	skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo);
+1 −9
Original line number Diff line number Diff line
@@ -259,10 +259,6 @@ static int mlx5e_health_rq_put_sw_state(struct devlink_fmsg *fmsg, struct mlx5e_

	BUILD_BUG_ON_MSG(ARRAY_SIZE(rq_sw_state_type_name) != MLX5E_NUM_RQ_STATES,
			 "rq_sw_state_type_name string array must be consistent with MLX5E_RQ_STATE_* enum in en.h");
	err = devlink_fmsg_obj_nest_start(fmsg);
	if (err)
		return err;

	err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, "SW State");
	if (err)
		return err;
@@ -274,11 +270,7 @@ static int mlx5e_health_rq_put_sw_state(struct devlink_fmsg *fmsg, struct mlx5e_
			return err;
	}

	err = mlx5e_health_fmsg_named_obj_nest_end(fmsg);
	if (err)
		return err;

	return devlink_fmsg_obj_nest_end(fmsg);
	return mlx5e_health_fmsg_named_obj_nest_end(fmsg);
}

static int
+1 −9
Original line number Diff line number Diff line
@@ -57,10 +57,6 @@ static int mlx5e_health_sq_put_sw_state(struct devlink_fmsg *fmsg, struct mlx5e_

	BUILD_BUG_ON_MSG(ARRAY_SIZE(sq_sw_state_type_name) != MLX5E_NUM_SQ_STATES,
			 "sq_sw_state_type_name string array must be consistent with MLX5E_SQ_STATE_* enum in en.h");
	err = devlink_fmsg_obj_nest_start(fmsg);
	if (err)
		return err;

	err = mlx5e_health_fmsg_named_obj_nest_start(fmsg, "SW State");
	if (err)
		return err;
@@ -72,11 +68,7 @@ static int mlx5e_health_sq_put_sw_state(struct devlink_fmsg *fmsg, struct mlx5e_
			return err;
	}

	err = mlx5e_health_fmsg_named_obj_nest_end(fmsg);
	if (err)
		return err;

	return devlink_fmsg_obj_nest_end(fmsg);
	return mlx5e_health_fmsg_named_obj_nest_end(fmsg);
}

static int mlx5e_tx_reporter_err_cqe_recover(void *ctx)
+0 −10
Original line number Diff line number Diff line
@@ -4,15 +4,6 @@
#include "act.h"
#include "en/tc_priv.h"

static bool
tc_act_can_offload_accept(struct mlx5e_tc_act_parse_state *parse_state,
			  const struct flow_action_entry *act,
			  int act_index,
			  struct mlx5_flow_attr *attr)
{
	return true;
}

static int
tc_act_parse_accept(struct mlx5e_tc_act_parse_state *parse_state,
		    const struct flow_action_entry *act,
@@ -26,7 +17,6 @@ tc_act_parse_accept(struct mlx5e_tc_act_parse_state *parse_state,
}

struct mlx5e_tc_act mlx5e_tc_act_accept = {
	.can_offload = tc_act_can_offload_accept,
	.parse_action = tc_act_parse_accept,
	.is_terminating_action = true,
};
+0 −20
Original line number Diff line number Diff line
@@ -82,26 +82,6 @@ mlx5e_tc_act_init_parse_state(struct mlx5e_tc_act_parse_state *parse_state,
	parse_state->flow_action = flow_action;
}

void
mlx5e_tc_act_reorder_flow_actions(struct flow_action *flow_action,
				  struct mlx5e_tc_flow_action *flow_action_reorder)
{
	struct flow_action_entry *act;
	int i, j = 0;

	flow_action_for_each(i, act, flow_action) {
		/* Add CT action to be first. */
		if (act->id == FLOW_ACTION_CT)
			flow_action_reorder->entries[j++] = act;
	}

	flow_action_for_each(i, act, flow_action) {
		if (act->id == FLOW_ACTION_CT)
			continue;
		flow_action_reorder->entries[j++] = act;
	}
}

int
mlx5e_tc_act_post_parse(struct mlx5e_tc_act_parse_state *parse_state,
			struct flow_action *flow_action,
Loading