From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A1A7A04DD; Tue, 20 Oct 2020 11:02:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1555EC842; Tue, 20 Oct 2020 10:49:56 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id BED10BBA0 for ; Tue, 20 Oct 2020 10:49:04 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.60]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 8F2336008B for ; Tue, 20 Oct 2020 08:49:04 +0000 (UTC) Received: from us4-mdac16-14.ut7.mdlocal (unknown [10.7.65.238]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 8F767200A0 for ; Tue, 20 Oct 2020 08:49:04 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.200]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 100A61C0051 for ; Tue, 20 Oct 2020 08:49:04 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id BA11580005E for ; Tue, 20 Oct 2020 08:49:03 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 20 Oct 2020 09:48:50 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 20 Oct 2020 09:48:50 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 09K8mnWJ030802; Tue, 20 Oct 2020 09:48:50 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 506891626DD; Tue, 20 Oct 2020 09:48:49 +0100 (BST) From: Andrew Rybchenko To: CC: , Ivan Malov Date: Tue, 20 Oct 2020 09:47:57 +0100 Message-ID: <1603183709-23420-31-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603183709-23420-1-git-send-email-arybchenko@solarflare.com> References: <1603183709-23420-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25736.003 X-TM-AS-Result: No-1.005700-8.000000-10 X-TMASE-MatchedRID: 1k6om1Yy2loZ7Z5t6RByKcbr3d9/yP1kaeMaKzvXUpljLp8Cm8vwF12O RX0B8+qTT1fsjZmF+qzm9S/0eIQUb+ox2xGkyLxhPwKTD1v8YV5SDnPEI8clbYo2zZttmKgwBdk tVeUMQ91Ke+b9hRgNQa1TSd3U5mjSWELDcKwGO24Pe5gzF3TVtw4fD/I06RGB/J7h1gsh1oSYpu G7kpoKRwiWi74Qn7wWwltAkl1nSvhthJ7IXRIqNhjDRPpHuqhaxmJ6Bfwk3mWbKItl61J/yZ+in TK0bC9eKrauXd3MZDXpkjKz69JdHWOmaRfQqSGTtlf5XJ97FgX5Bn0ItTXDzy2mZLZr+cEmglCg HUFGvGFYufgks1xj64xPQ4PjKOx8zpMkEh8K4C4iLV7d9yx+FzigZBQJvBjlD6DuZ3COjrnoW0N kKZgEnVjylogJTbSOQwymtxuJ6y0= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-1.005700-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25736.003 X-MDID: 1603183744-Lvn_k2EG677s X-PPE-DISP: 1603183744;Lvn_k2EG677s Subject: [dpdk-dev] [PATCH 30/62] common/sfc_efx/base: support adding FLAG action to a set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Ivan Malov This action can be added at any point before DELIVER. Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/efx.h | 5 ++ drivers/common/sfc_efx/base/efx_impl.h | 8 +++ drivers/common/sfc_efx/base/efx_mae.c | 62 ++++++++++++++++++- .../sfc_efx/rte_common_sfc_efx_version.map | 1 + 4 files changed, 74 insertions(+), 2 deletions(-) diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index 193ffff14c..e03da22c3b 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4178,6 +4178,11 @@ efx_mae_action_set_populate_vlan_push( __in uint16_t tpid_be, __in uint16_t tci_be); +LIBEFX_API +extern __checkReturn efx_rc_t +efx_mae_action_set_populate_flag( + __in efx_mae_actions_t *spec); + LIBEFX_API extern __checkReturn efx_rc_t efx_mae_action_set_populate_deliver( diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index cefbcac93e..bffd4c6ce8 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1704,6 +1704,14 @@ typedef enum efx_mae_action_e { EFX_MAE_ACTION_VLAN_POP, EFX_MAE_ACTION_VLAN_PUSH, + /* + * These actions are not strictly ordered and can + * be passed by a client in any order (before DELIVER). + * However, these enumerants must be kept compactly + * in the end of the enumeration (before DELIVER). + */ + EFX_MAE_ACTION_FLAG, + /* DELIVER is always the last action. */ EFX_MAE_ACTION_DELIVER, diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index b631487645..93fd02f6d2 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -715,6 +715,37 @@ efx_mae_action_set_add_vlan_push( 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_deliver( __in efx_mae_actions_t *spec, @@ -757,6 +788,9 @@ static const efx_mae_action_desc_t efx_mae_actions[EFX_MAE_NACTIONS] = { [EFX_MAE_ACTION_VLAN_PUSH] = { .emad_add = efx_mae_action_set_add_vlan_push }, + [EFX_MAE_ACTION_FLAG] = { + .emad_add = efx_mae_action_set_add_flag + }, [EFX_MAE_ACTION_DELIVER] = { .emad_add = efx_mae_action_set_add_deliver } @@ -765,8 +799,17 @@ static const efx_mae_action_desc_t efx_mae_actions[EFX_MAE_NACTIONS] = { static const uint32_t efx_mae_action_ordered_map = (1U << EFX_MAE_ACTION_VLAN_POP) | (1U << EFX_MAE_ACTION_VLAN_PUSH) | + (1U << EFX_MAE_ACTION_FLAG) | (1U << EFX_MAE_ACTION_DELIVER); +/* + * These actions must not be added after DELIVER, but + * they can have any place among the rest of + * strictly ordered actions. + */ +static const uint32_t efx_mae_action_nonstrict_map = + (1U << EFX_MAE_ACTION_FLAG); + static const uint32_t efx_mae_action_repeat_map = (1U << EFX_MAE_ACTION_VLAN_POP) | (1U << EFX_MAE_ACTION_VLAN_PUSH); @@ -793,6 +836,7 @@ efx_mae_action_set_spec_populate( (sizeof (efx_mae_action_repeat_map) * 8)); EFX_STATIC_ASSERT(EFX_MAE_ACTION_DELIVER + 1 == EFX_MAE_NACTIONS); + EFX_STATIC_ASSERT(EFX_MAE_ACTION_FLAG + 1 == EFX_MAE_ACTION_DELIVER); if (type >= EFX_ARRAY_SIZE(efx_mae_actions)) { rc = EINVAL; @@ -811,9 +855,10 @@ efx_mae_action_set_spec_populate( } if ((efx_mae_action_ordered_map & action_mask) != 0) { + uint32_t strict_ordered_map = + efx_mae_action_ordered_map & ~efx_mae_action_nonstrict_map; uint32_t later_actions_mask = - efx_mae_action_ordered_map & - ~(action_mask | (action_mask - 1)); + strict_ordered_map & ~(action_mask | (action_mask - 1)); if ((spec->emass_actions & later_actions_mask) != 0) { /* Cannot add an action after later ordered actions. */ @@ -867,6 +912,14 @@ efx_mae_action_set_populate_vlan_push( EFX_MAE_ACTION_VLAN_PUSH, sizeof (action), arg)); } + __checkReturn efx_rc_t +efx_mae_action_set_populate_flag( + __in efx_mae_actions_t *spec) +{ + return (efx_mae_action_set_spec_populate(spec, + EFX_MAE_ACTION_FLAG, 0, NULL)); +} + __checkReturn efx_rc_t efx_mae_action_set_populate_deliver( __in efx_mae_actions_t *spec, @@ -1059,6 +1112,11 @@ efx_mae_action_set_alloc( spec->emass_vlan_push_descs[outer_tag_idx].emavp_tci_be); } + if ((spec->emass_actions & (1U << EFX_MAE_ACTION_FLAG)) != 0) { + MCDI_IN_SET_DWORD_FIELD(req, MAE_ACTION_SET_ALLOC_IN_FLAGS, + MAE_ACTION_SET_ALLOC_IN_FLAG, 1); + } + MCDI_IN_SET_DWORD(req, MAE_ACTION_SET_ALLOC_IN_DELIVER, spec->emass_deliver_mport.sel); diff --git a/drivers/common/sfc_efx/rte_common_sfc_efx_version.map b/drivers/common/sfc_efx/rte_common_sfc_efx_version.map index be11b6ad3c..f57f4a3a8f 100644 --- a/drivers/common/sfc_efx/rte_common_sfc_efx_version.map +++ b/drivers/common/sfc_efx/rte_common_sfc_efx_version.map @@ -90,6 +90,7 @@ INTERNAL { efx_mae_action_set_alloc; efx_mae_action_set_free; efx_mae_action_set_populate_deliver; + efx_mae_action_set_populate_flag; efx_mae_action_set_populate_vlan_pop; efx_mae_action_set_populate_vlan_push; efx_mae_action_set_spec_fini; -- 2.17.1