DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ivan Malov <ivan.malov@oktetlabs.ru>
To: dev@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Andy Moreton <amoreton@xilinx.com>
Subject: [dpdk-dev] [PATCH 5/5] net/sfc: support decrement IP TTL actions in transfer flows
Date: Sat,  6 Nov 2021 00:54:09 +0300	[thread overview]
Message-ID: <20211105215409.5706-6-ivan.malov@oktetlabs.ru> (raw)
In-Reply-To: <20211105215409.5706-1-ivan.malov@oktetlabs.ru>

These actions map to MAE action DECR_IP_TTL. It affects
the outermost header in the current processing state of
the packet, which might have been decapsulated by prior
action DECAP. It also updates IPv4 checksum accordingly.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 doc/guides/nics/features/sfc.ini | 2 ++
 doc/guides/nics/sfc_efx.rst      | 4 ++++
 drivers/net/sfc/sfc_mae.c        | 8 ++++++++
 3 files changed, 14 insertions(+)

diff --git a/doc/guides/nics/features/sfc.ini b/doc/guides/nics/features/sfc.ini
index 0d785f4765..1ce2dc46ba 100644
--- a/doc/guides/nics/features/sfc.ini
+++ b/doc/guides/nics/features/sfc.ini
@@ -62,10 +62,12 @@ vxlan                = Y
 
 [rte_flow actions]
 count                = Y
+dec_ttl              = Y
 drop                 = Y
 flag                 = Y
 jump                 = P
 mark                 = Y
+of_dec_nw_ttl        = Y
 of_pop_vlan          = Y
 of_push_vlan         = Y
 of_set_vlan_pcp      = Y
diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst
index 960e25bf98..00b95a4f58 100644
--- a/doc/guides/nics/sfc_efx.rst
+++ b/doc/guides/nics/sfc_efx.rst
@@ -234,6 +234,10 @@ Supported actions (***transfer*** rules):
 
 - OF_VLAN_SET_PCP
 
+- OF_DEC_NW_TTL
+
+- DEC_TTL
+
 - VXLAN_DECAP
 
 - VXLAN_ENCAP
diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 411f2ac27e..93cce60a3e 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -3587,6 +3587,14 @@ sfc_mae_rule_parse_action(struct sfc_adapter *sa,
 				       bundle->actions_mask);
 		rc = efx_mae_action_set_populate_vlan_pop(spec);
 		break;
+	case RTE_FLOW_ACTION_TYPE_OF_DEC_NW_TTL:
+	case RTE_FLOW_ACTION_TYPE_DEC_TTL:
+		SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_OF_DEC_NW_TTL,
+				       bundle->actions_mask);
+		SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_DEC_TTL,
+				       bundle->actions_mask);
+		rc = efx_mae_action_set_populate_decr_ip_ttl(spec);
+		break;
 	case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
 		SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN,
 				       bundle->actions_mask);
-- 
2.30.2


  parent reply	other threads:[~2021-11-05 21:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 21:54 [dpdk-dev] [PATCH 0/5] net/sfc: support IP TTL decrement " Ivan Malov
2021-11-05 21:54 ` [dpdk-dev] [PATCH 1/5] common/sfc_efx/base: refine adding encap action to a set Ivan Malov
2021-11-05 21:54 ` [dpdk-dev] [PATCH 2/5] common/sfc_efx/base: refine adding count " Ivan Malov
2021-11-05 21:54 ` [dpdk-dev] [PATCH 3/5] common/sfc_efx/base: factor out no-op helper functions Ivan Malov
2021-11-05 21:54 ` [dpdk-dev] [PATCH 4/5] common/sfc_efx/base: support adding dec. TTL action to a set Ivan Malov
2021-11-05 21:54 ` Ivan Malov [this message]
2021-11-08 15:32 ` [dpdk-dev] [PATCH 0/5] net/sfc: support IP TTL decrement actions in transfer flows Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211105215409.5706-6-ivan.malov@oktetlabs.ru \
    --to=ivan.malov@oktetlabs.ru \
    --cc=amoreton@xilinx.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).