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 3/5] common/sfc_efx/base: factor out no-op helper functions
Date: Sat, 6 Nov 2021 00:54:07 +0300 [thread overview]
Message-ID: <20211105215409.5706-4-ivan.malov@oktetlabs.ru> (raw)
In-Reply-To: <20211105215409.5706-1-ivan.malov@oktetlabs.ru>
When an action gets added to an action set, a special helper is
used to handle its arguments. There are actions which have no
arguments, and the corresponding helpers are duplicates in
fact. Use a unified no-op helper instead of them.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
drivers/common/sfc_efx/base/efx_mae.c | 80 ++-------------------------
1 file changed, 4 insertions(+), 76 deletions(-)
diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c
index c93fe9bdfc..41444e1926 100644
--- a/drivers/common/sfc_efx/base/efx_mae.c
+++ b/drivers/common/sfc_efx/base/efx_mae.c
@@ -1406,7 +1406,7 @@ efx_mae_action_set_spec_fini(
}
static __checkReturn efx_rc_t
-efx_mae_action_set_add_decap(
+efx_mae_action_set_no_op(
__in efx_mae_actions_t *spec,
__in size_t arg_size,
__in_bcount(arg_size) const uint8_t *arg)
@@ -1510,47 +1510,6 @@ efx_mae_action_set_add_vlan_push(
return (rc);
}
-static __checkReturn efx_rc_t
-efx_mae_action_set_add_encap(
- __in efx_mae_actions_t *spec,
- __in size_t arg_size,
- __in_bcount(arg_size) const uint8_t *arg)
-{
- efx_rc_t rc;
-
- /*
- * Adding this specific action to an action set spec and setting encap.
- * header ID in the spec are two individual steps. This design allows
- * the client driver to avoid encap. header allocation when it simply
- * needs to check the order of actions submitted by user ("validate"),
- * without actually allocating an action set and inserting a rule.
- *
- * In order to fill in the encap. header ID, the caller is supposed to
- * invoke efx_mae_action_set_fill_in_eh_id(). If they do not do that,
- * efx_mae_action_set_alloc() invocation will throw an error.
- *
- * For now, no more work is supposed to be done.
- */
-
- if (arg_size != 0) {
- rc = EINVAL;
- goto fail1;
- }
-
- if (arg != NULL) {
- rc = EINVAL;
- goto fail2;
- }
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
- return (rc);
-}
-
static __checkReturn efx_rc_t
efx_mae_action_set_add_count(
__in efx_mae_actions_t *spec,
@@ -1596,37 +1555,6 @@ efx_mae_action_set_add_count(
return (rc);
}
-static __checkReturn efx_rc_t
-efx_mae_action_set_add_flag(
- __in efx_mae_actions_t *spec,
- __in size_t arg_size,
- __in_bcount(arg_size) const uint8_t *arg)
-{
- efx_rc_t rc;
-
- _NOTE(ARGUNUSED(spec))
-
- if (arg_size != 0) {
- rc = EINVAL;
- goto fail1;
- }
-
- if (arg != NULL) {
- rc = EINVAL;
- goto fail2;
- }
-
- /* This action does not have any arguments, so do nothing here. */
-
- return (0);
-
-fail2:
- EFSYS_PROBE(fail2);
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
- return (rc);
-}
-
static __checkReturn efx_rc_t
efx_mae_action_set_add_mark(
__in efx_mae_actions_t *spec,
@@ -1693,7 +1621,7 @@ typedef struct efx_mae_action_desc_s {
static const efx_mae_action_desc_t efx_mae_actions[EFX_MAE_NACTIONS] = {
[EFX_MAE_ACTION_DECAP] = {
- .emad_add = efx_mae_action_set_add_decap
+ .emad_add = efx_mae_action_set_no_op
},
[EFX_MAE_ACTION_VLAN_POP] = {
.emad_add = efx_mae_action_set_add_vlan_pop
@@ -1702,13 +1630,13 @@ static const efx_mae_action_desc_t efx_mae_actions[EFX_MAE_NACTIONS] = {
.emad_add = efx_mae_action_set_add_vlan_push
},
[EFX_MAE_ACTION_ENCAP] = {
- .emad_add = efx_mae_action_set_add_encap
+ .emad_add = efx_mae_action_set_no_op
},
[EFX_MAE_ACTION_COUNT] = {
.emad_add = efx_mae_action_set_add_count
},
[EFX_MAE_ACTION_FLAG] = {
- .emad_add = efx_mae_action_set_add_flag
+ .emad_add = efx_mae_action_set_no_op
},
[EFX_MAE_ACTION_MARK] = {
.emad_add = efx_mae_action_set_add_mark
--
2.30.2
next prev 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 actions in transfer flows 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 ` Ivan Malov [this message]
2021-11-05 21:54 ` [dpdk-dev] [PATCH 4/5] common/sfc_efx/base: support adding dec. TTL " Ivan Malov
2021-11-05 21:54 ` [dpdk-dev] [PATCH 5/5] net/sfc: support decrement IP TTL actions in transfer flows Ivan Malov
2021-11-08 15:32 ` [dpdk-dev] [PATCH 0/5] net/sfc: support IP TTL decrement " 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-4-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).