mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 11:48:58 -04:00
net/mlx5e: E-Switch, Add support for tx_port_ts in switchdev mode
When turning on tx_port_ts (private flag) a PTP-SQ is created. Consider this queue when adding rules matching SQs to VPORTs. Otherwise the traffic on this queue won't reach the wire. Signed-off-by: Aya Levin <ayal@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Maor Dickman <maord@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
committed by
Saeed Mahameed
parent
7c5f940d26
commit
bfbdd77ac5
@@ -55,6 +55,7 @@
|
||||
#include "diag/en_rep_tracepoint.h"
|
||||
#include "en_accel/ipsec.h"
|
||||
#include "en/tc/int_port.h"
|
||||
#include "en/ptp.h"
|
||||
|
||||
#define MLX5E_REP_PARAMS_DEF_LOG_SQ_SIZE \
|
||||
max(0x7, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
|
||||
@@ -401,13 +402,18 @@ int mlx5e_add_sqs_fwd_rules(struct mlx5e_priv *priv)
|
||||
struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
|
||||
struct mlx5e_rep_priv *rpriv = priv->ppriv;
|
||||
struct mlx5_eswitch_rep *rep = rpriv->rep;
|
||||
int n, tc, nch, num_sqs = 0;
|
||||
struct mlx5e_channel *c;
|
||||
int n, tc, num_sqs = 0;
|
||||
int err = -ENOMEM;
|
||||
bool ptp_sq;
|
||||
u32 *sqs;
|
||||
|
||||
sqs = kcalloc(priv->channels.num * mlx5e_get_dcb_num_tc(&priv->channels.params),
|
||||
sizeof(*sqs), GFP_KERNEL);
|
||||
ptp_sq = !!(priv->channels.ptp &&
|
||||
MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_TX_PORT_TS));
|
||||
nch = priv->channels.num + ptp_sq;
|
||||
|
||||
sqs = kcalloc(nch * mlx5e_get_dcb_num_tc(&priv->channels.params), sizeof(*sqs),
|
||||
GFP_KERNEL);
|
||||
if (!sqs)
|
||||
goto out;
|
||||
|
||||
@@ -416,6 +422,12 @@ int mlx5e_add_sqs_fwd_rules(struct mlx5e_priv *priv)
|
||||
for (tc = 0; tc < c->num_tc; tc++)
|
||||
sqs[num_sqs++] = c->sq[tc].sqn;
|
||||
}
|
||||
if (ptp_sq) {
|
||||
struct mlx5e_ptp *ptp_ch = priv->channels.ptp;
|
||||
|
||||
for (tc = 0; tc < ptp_ch->num_tc; tc++)
|
||||
sqs[num_sqs++] = ptp_ch->ptpsq[tc].txqsq.sqn;
|
||||
}
|
||||
|
||||
err = mlx5e_sqs2vport_start(esw, rep, sqs, num_sqs);
|
||||
kfree(sqs);
|
||||
|
||||
Reference in New Issue
Block a user