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 9C04BA04DD; Tue, 20 Oct 2020 11:02:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E0486C862; Tue, 20 Oct 2020 10:49:58 +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 6713DAD31 for ; Tue, 20 Oct 2020 10:49:05 +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 3741A6005C for ; Tue, 20 Oct 2020 08:49:05 +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 37FBB2009A for ; Tue, 20 Oct 2020 08:49:05 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.199]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id B90481C0051 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 6899018005B for ; Tue, 20 Oct 2020 08:49:04 +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 09K8mnFx030820; 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 6EB6916198B; Tue, 20 Oct 2020 09:48:48 +0100 (BST) From: Andrew Rybchenko To: CC: , Ivan Malov Date: Tue, 20 Oct 2020 09:47:41 +0100 Message-ID: <1603183709-23420-15-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-2.513500-8.000000-10 X-TMASE-MatchedRID: YKoie7Yrv/Ej6Wp8EiYV2G/BUkaRdR0JhO/3bCc4wl9GMe+tDjQ3FroT xgoDFSNYoqweJNiofMgKumdKE9waERlsiwH2NvdjeWgJLNowHdU1X1Ls767cpnCR0itW3xfVUNM prKLZkXqlUbQd5K36vJYZEKz74UzS3VGQScEUC76cVWc2a+/ju+vcTjVWUqx9e7ijHq7g9oYeYu RqwkgIgiUU0Q3EwNK5a4c+GRhi2wc1JHytUxkfUw97mDMXdNW3uoYFb0nRiqPsvb7MYS5s3oIoV xJqL3uZ58EykvLuSMDrixWWWJYrHx8TzIzimOwPC24oEZ6SpSmb4wHqRpnaDhJLGQ3jMMYnYjUf bDlB7MU9M52HKrihrG56GvAUtpSK3NUIBav+YjOqUqZvHKQLlylZuFbY33xRf/jOfhELVRxktgO mJgale+QDw6tgd3AMZ9iVj/KhX/RSnoQc5vb5zuQdkM7ndBLC4+XAJZXbs2s= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-2.513500-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25736.003 X-MDID: 1603183745-UOljG-aIzDZT X-PPE-DISP: 1603183745;UOljG-aIzDZT Subject: [dpdk-dev] [PATCH 14/62] common/sfc_efx/base: add action set spec init/fini APIs 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 The engine is only able to carry out chosen actions on matching packets in a strict order. No MCDI exists to identify supported actions and the order. Still, the definition of the latter is available from the FW documentation. The general idea is to define an action specification structure and supply a client driver with APIs for adding actions individually, order-dependent. A client driver is supposed to invoke an API on every action passed by the application, and if an out-of-order action follows, the API will reject it. Add an action set specification stub and supply initialise / finalise APIs. Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/efx.h | 20 ++++++++++ drivers/common/sfc_efx/base/efx_impl.h | 3 ++ drivers/common/sfc_efx/base/efx_mae.c | 39 +++++++++++++++++++ .../sfc_efx/rte_common_sfc_efx_version.map | 3 ++ 4 files changed, 65 insertions(+) diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index c91f7948a0..cd0b22d43a 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4098,6 +4098,26 @@ efx_mae_match_spec_is_valid( __in efx_nic_t *enp, __in const efx_mae_match_spec_t *spec); +typedef struct efx_mae_actions_s efx_mae_actions_t; + +LIBEFX_API +extern __checkReturn efx_rc_t +efx_mae_action_set_spec_init( + __in efx_nic_t *enp, + __out efx_mae_actions_t **specp); + +LIBEFX_API +extern void +efx_mae_action_set_spec_fini( + __in efx_nic_t *enp, + __in efx_mae_actions_t *spec); + +LIBEFX_API +extern __checkReturn boolean_t +efx_mae_action_set_specs_equal( + __in const efx_mae_actions_t *left, + __in const efx_mae_actions_t *right); + /* * Conduct a comparison to check whether two match specifications * of equal rule type (action / outer) and priority would map to diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index 2b872bb62e..86ef8e1b92 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1699,6 +1699,9 @@ struct efx_mae_match_spec_s { } emms_mask_value_pairs; }; +typedef struct efx_mae_actions_s { +} efx_mae_actions_t; + #endif /* EFSYS_OPT_MAE */ #ifdef __cplusplus diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index a126cba37f..81c586dfe8 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -434,6 +434,45 @@ efx_mae_match_spec_is_valid( return (is_valid); } + __checkReturn efx_rc_t +efx_mae_action_set_spec_init( + __in efx_nic_t *enp, + __out efx_mae_actions_t **specp) +{ + efx_mae_actions_t *spec; + efx_rc_t rc; + + EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (*spec), spec); + if (spec == NULL) { + rc = ENOMEM; + goto fail1; + } + + *specp = spec; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} + + void +efx_mae_action_set_spec_fini( + __in efx_nic_t *enp, + __in efx_mae_actions_t *spec) +{ + EFSYS_KMEM_FREE(enp->en_esip, sizeof (*spec), spec); +} + + __checkReturn boolean_t +efx_mae_action_set_specs_equal( + __in const efx_mae_actions_t *left, + __in const efx_mae_actions_t *right) +{ + return ((memcmp(left, right, sizeof (*left)) == 0) ? B_TRUE : B_FALSE); +} + __checkReturn efx_rc_t efx_mae_match_specs_class_cmp( __in efx_nic_t *enp, 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 aeb6f4d134..8a4d2b2fff 100644 --- a/drivers/common/sfc_efx/rte_common_sfc_efx_version.map +++ b/drivers/common/sfc_efx/rte_common_sfc_efx_version.map @@ -85,6 +85,9 @@ INTERNAL { efx_mac_stats_upload; efx_mac_up; + efx_mae_action_set_spec_fini; + efx_mae_action_set_spec_init; + efx_mae_action_set_specs_equal; efx_mae_fini; efx_mae_get_limits; efx_mae_init; -- 2.17.1