From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B987F43CE2 for ; Mon, 18 Mar 2024 11:26:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54C4A4064C; Mon, 18 Mar 2024 11:26:24 +0100 (CET) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mails.dpdk.org (Postfix) with ESMTP id B89AE4026E for ; Mon, 18 Mar 2024 11:26:22 +0100 (CET) Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2d4515ec3aaso34164361fa.1 for ; Mon, 18 Mar 2024 03:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710757582; x=1711362382; darn=dpdk.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=vjkxxxI9V+ETivcsIlX4ORxUlzwhUaTKk3ow+ctl7Qs=; b=hiyYhkeMZAz6cwZslaRBG2kEqZzR85zKlt2ojOnAwLt/mKNTIqI+3Tzs2RzNENEHgJ 9lyjmZgOnPTfq1VOWV7HeXxPLy0wkeNe1s0Ddh5guVMsXcSoUxyKJcel64mfMwlcAMJP RaOmNY0W0Bg7K+YOfF3VrRW8r3h2uoFa6K8VFChbUoRcIx2G9s7ZwmpJlQDzUATymU1h h/d7ogmdgw7Wn4hZeBzpYFWQA6yG/IK3JjtqCZmAWI3mzM0OdvUyBFwiSFMVBawQ+jIJ opGzxN46cmnWAq24SvrScWA/Z4iu1m0Ay6D3M8cilIZUZXRrJWulEQpKRo7VHDAHAYNl 0hLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710757582; x=1711362382; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vjkxxxI9V+ETivcsIlX4ORxUlzwhUaTKk3ow+ctl7Qs=; b=X3KhmFk3eLbKoBxveeG7WsADB5Nt54Os5gIQ7/5OJKbDZ9gZ20Lg6L66rTksd5mV4k jmAMcWYE7Wiw7hcsvVr4485+305CN3SgZuxWFjJdANxPWl4eRmh7QY5Q00Sk1JvlPqtm lhEYPxwV8kPgITdpD4EWm/CLkAdGpRTSIDNZyEPkWYAh4XJSLiCCBoeFntGlAZoIOmq7 97VvIaYmg8kM/mJpzZ9JnXnnNt9eYdBugHQy9sqA9AWnSbbKRNBW01cZsDDAHYtSdJHx BQYri/XWWhmXdpmducynA8FsmkMS23f1I9itSyl5d2RIGUSEB7B0OCbxtykkcgcDLa3B CJVw== X-Gm-Message-State: AOJu0YyNWPf33xSuZeMJ2v9J/kWQjFykGtgsZtgY4aDrAISI8ADR/oZm LRCurRTrm0gI7qWPF4M3hJ7vN3X63AxTV6509XhDcoZ+Z3WVGmUJw/XvBVOz0y5jSbf7JQH73Q8 qr5/h9uD4GBE4aEOHIgAc7YlZc67B6C8u3VzNFA== X-Google-Smtp-Source: AGHT+IH33yjlL8WUdf12g0onbnyS/72Y0yTQGRIOL0n/xqatJDhxn7HwTdDPqY3kEcIuZyggGXyA6IIWD2rLMKqzjdo= X-Received: by 2002:a05:651c:2045:b0:2d2:b99a:4f6b with SMTP id t5-20020a05651c204500b002d2b99a4f6bmr3937015ljo.8.1710757581481; Mon, 18 Mar 2024 03:26:21 -0700 (PDT) MIME-Version: 1.0 From: Guvenc Gulce Date: Mon, 18 Mar 2024 11:26:09 +0100 Message-ID: Subject: mlx5: rte_flow template/async API raw_encap validation bug ? To: users@dpdk.org Cc: suanmingm@nvidia.com, orika@nvidia.com Content-Type: multipart/alternative; boundary="000000000000f0ee990613ecc91b" X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --000000000000f0ee990613ecc91b Content-Type: text/plain; charset="UTF-8" Hi all, It is great that we have rte_flow async/template api integrated to mlx5 driver code and it is being established as the new standard rte_flow API. I have the following raw_encap problem when using the rte_flow async/template API with mlx5 driver: - raw_encap rte_flow action template fails during validation when the action mask conf is NULL but this clearly contradicts the explanation from Suanming Mou's commit 7f6daa490d9 which clearly states that the raw encap action mask is allowed to be NULL. 2. RAW encap (encap_data: raw) action conf (raw_data) a. action mask conf (not NULL) - encap_data constant. b. action mask conf (NULL) - encap_data will change. Commenting out the raw_encap validation would make it possible to create rte_flow template with null mask conf which can be concretized later on. Things seem to work after relaxing the rte_flow raw_encap validation. The change would look like: diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 35f1ed7a03..3f57fd9286 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -6020,10 +6020,10 @@ flow_hw_validate_action_raw_encap(const struct rte_flow_action *action, const struct rte_flow_action_raw_encap *mask_conf = mask->conf; const struct rte_flow_action_raw_encap *action_conf = action->conf; - if (!mask_conf || !mask_conf->size) +/* if (!mask_conf || !mask_conf->size) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, mask, - "raw_encap: size must be masked"); + "raw_encap: size must be masked"); */ if (!action_conf || !action_conf->size) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, But this can not be the proper solution. Please advise a solution how to make the raw_encap work with rte_flow template/async API. If relaxing the validation is ok, I can also prepare and send a patch. Thanks in advance, Guvenc Gulce --000000000000f0ee990613ecc91b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,
It is great that we have rte_flow async/template api integrate= d to mlx5=C2=A0
driver code and it is being established as the ne= w standard rte_flow API.

I have the following raw_= encap problem when using the rte_flow async/template API=C2=A0
wi= th mlx5 driver:
- raw_encap rte_flow action template fails during= validation when the action mask
conf is NULL but this clearly co= ntradicts the explanation from Suanming Mou's=C2=A0
commit=C2= =A07f6daa490d9 which clearly states that the raw encap action mask is allow= ed=C2=A0
to be NULL.
<Excerpt from commit 7f6daa490d= 9>
=C2=A0 =C2=A0 2. RAW encap (encap_data: raw)=C2=A0 =C2= =A0 =C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 action conf = (raw_data)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 a. action mask conf (not NUL= L)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - encap_data constant.=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 b. action mask conf (NULL)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - encap_data will change.=
</Excerpt from commit 7f6daa490d9>
Commenting out the raw_encap validation would make it possible = to create
rte_flow template with null mask conf which can be conc= retized later on.=C2=A0
Things seem to work after relaxing the rt= e_flow raw_encap validation.
The change would look like:

<Excerpt>
diff --git a/drivers/net/ml= x5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 35f1ed7= a03..3f57fd9286 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -6020,10 +6020,10 = @@ flow_hw_validate_action_raw_encap(const struct rte_flow_action *action,<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 const struct rte_flow_action_raw_enca= p *mask_conf =3D mask->conf;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 const= struct rte_flow_action_raw_encap *action_conf =3D action->conf;
=C2=A0
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!mask_conf || !mask_con= f->size)
+/*=C2=A0 =C2=A0 =C2=A0if (!mask_conf || !mask_conf-&= gt;size)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = return rte_flow_error_set(error, EINVAL,
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RTE_FLOW_ERROR_TYPE_ACTION= , mask,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0"raw_encap: size must be masked");
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&q= uot;raw_encap: size must be masked"); */
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 if (!action_conf || !action_conf->size)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return rte_flow_error_set(err= or, EINVAL,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 RTE_FLOW_ERROR_TYPE_ACTION, action,
&l= t;/Excerpt>

But this can not be the proper = solution. Please advise a solution how to make the=C2=A0
raw_enca= p work with rte_flow template/async API. If relaxing the validation is ok, = I can=C2=A0
also prepare and send a patch.

Thanks in advance,

Guvenc Gulce
=C2= =A0=C2=A0
--000000000000f0ee990613ecc91b--