net/mlx5e: Mutually exclude setting of TX-port-TS and MQPRIO in channel mode
TX-port-TS hijacks the PTP traffic to a specific HW TX-queue. This
conflicts with MQPRIO in channel mode, which specifies explicitly which
TC accepts the packet. This patch mutually excludes the above
configuration.
Fixes: ec60c4581b
("net/mlx5e: Support MQPRIO channel mode")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
Родитель
dd1979cf3c
Коммит
3bf1742f3c
|
@ -2036,6 +2036,17 @@ static int set_pflag_tx_port_ts(struct net_device *netdev, bool enable)
|
||||||
}
|
}
|
||||||
|
|
||||||
new_params = priv->channels.params;
|
new_params = priv->channels.params;
|
||||||
|
/* Don't allow enabling TX-port-TS if MQPRIO mode channel offload is
|
||||||
|
* active, since it defines explicitly which TC accepts the packet.
|
||||||
|
* This conflicts with TX-port-TS hijacking the PTP traffic to a specific
|
||||||
|
* HW TX-queue.
|
||||||
|
*/
|
||||||
|
if (enable && new_params.mqprio.mode == TC_MQPRIO_MODE_CHANNEL) {
|
||||||
|
netdev_err(priv->netdev,
|
||||||
|
"%s: MQPRIO mode channel offload is active, cannot set the TX-port-TS\n",
|
||||||
|
__func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_TX_PORT_TS, enable);
|
MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_TX_PORT_TS, enable);
|
||||||
/* No need to verify SQ stop room as
|
/* No need to verify SQ stop room as
|
||||||
* ptpsq.txqsq.stop_room <= generic_sq->stop_room, and both
|
* ptpsq.txqsq.stop_room <= generic_sq->stop_room, and both
|
||||||
|
|
|
@ -2945,9 +2945,17 @@ static int mlx5e_mqprio_channel_validate(struct mlx5e_priv *priv,
|
||||||
struct tc_mqprio_qopt_offload *mqprio)
|
struct tc_mqprio_qopt_offload *mqprio)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = priv->netdev;
|
struct net_device *netdev = priv->netdev;
|
||||||
|
struct mlx5e_ptp *ptp_channel;
|
||||||
int agg_count = 0;
|
int agg_count = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
ptp_channel = priv->channels.ptp;
|
||||||
|
if (ptp_channel && test_bit(MLX5E_PTP_STATE_TX, ptp_channel->state)) {
|
||||||
|
netdev_err(netdev,
|
||||||
|
"Cannot activate MQPRIO mode channel since it conflicts with TX port TS\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (mqprio->qopt.offset[0] != 0 || mqprio->qopt.num_tc < 1 ||
|
if (mqprio->qopt.offset[0] != 0 || mqprio->qopt.num_tc < 1 ||
|
||||||
mqprio->qopt.num_tc > MLX5E_MAX_NUM_MQPRIO_CH_TC)
|
mqprio->qopt.num_tc > MLX5E_MAX_NUM_MQPRIO_CH_TC)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче