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 0ECE1A04E1; Tue, 22 Sep 2020 10:59:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AF9401DBDE; Tue, 22 Sep 2020 10:51:31 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 62BCD1D736 for ; Tue, 22 Sep 2020 10:50:24 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.150]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 3F1F620055 for ; Tue, 22 Sep 2020 08:50:24 +0000 (UTC) Received: from us4-mdac16-60.at1.mdlocal (unknown [10.110.50.153]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 3E77B800A3 for ; Tue, 22 Sep 2020 08:50:24 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.7]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id DDCE3100052 for ; Tue, 22 Sep 2020 08:50:23 +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 A721B4C005B for ; Tue, 22 Sep 2020 08:50:23 +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, 22 Sep 2020 09:50:11 +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, 22 Sep 2020 09:50:11 +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 08M8oBhk004808; Tue, 22 Sep 2020 09:50:11 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id AA5E41613AB; Tue, 22 Sep 2020 09:50:11 +0100 (BST) From: Andrew Rybchenko To: CC: Igor Romanov Date: Tue, 22 Sep 2020 09:49:42 +0100 Message-ID: <1600764594-14752-49-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600764594-14752-1-git-send-email-arybchenko@solarflare.com> References: <1600764594-14752-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-25674.003 X-TM-AS-Result: No-3.537200-8.000000-10 X-TMASE-MatchedRID: 4vsFl2z3FkpGpTGDN8pp+TXgRPG8Apuyjs/yyyVHGh5JfyfUaPjAASHV xv5WrG66lrzk0LlP1ZnQhrnrADRtjdIoDgSfXQ2wLbjXqdzdtCV6i696PjRPiI5JUK9UdYkniE3 dRTeE2jN8bO6hWfRWzo9CL1e45ag4LgycURHhkaL/V0SDC1Do0O6jyigxCo6yVWQnHKxp38gVAs f1+cZFJzAD8UvGR6e8/xrkZhZF1M978ZKYQ4N2cjCMW7zNwFaIMI2NtA9qrmL5LkL/TyFZzVmwP Iu07EES4vM1YF6AJbbCCfuIMF6xLSdET58jp62SOeZ+57R+u9N0kgBr/ykW+ycICVBm2M0Ot/IO lWttHI8yxGY1FZcCJrU09TZYJSPaJrk7eB63FHRxojUlmYtAdn+hn1G/MV0hvU24pLfQFmdAgUh ku2yAbQNQf6dUs3KIKyog/1PG+0kxvqnnvSKWdw== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--3.537200-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25674.003 X-MDID: 1600764624-c6oCjpPDDBHl Subject: [dpdk-dev] [PATCH 48/60] common/sfc_efx/base: introduce UDP tunnel destruct operation 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: Igor Romanov The procedures for destroying UDP tunnels are NIC family specific, so they should be implemented separately for each of them. Check for supported UDP encapsulation is removed from generic operations since it is no longer used by the generic libefx API. Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/efx_impl.h | 2 +- drivers/common/sfc_efx/base/efx_tunnel.c | 39 +++++++++++++++--------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index dfe5f1fecf..64156de884 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -303,8 +303,8 @@ efx_filter_reconfigure( #if EFSYS_OPT_TUNNEL typedef struct efx_tunnel_ops_s { - boolean_t (*eto_udp_encap_supported)(efx_nic_t *); efx_rc_t (*eto_reconfigure)(efx_nic_t *); + void (*eto_fini)(efx_nic_t *); } efx_tunnel_ops_t; #endif /* EFSYS_OPT_TUNNEL */ diff --git a/drivers/common/sfc_efx/base/efx_tunnel.c b/drivers/common/sfc_efx/base/efx_tunnel.c index b1d1407bd2..5f2186c4c8 100644 --- a/drivers/common/sfc_efx/base/efx_tunnel.c +++ b/drivers/common/sfc_efx/base/efx_tunnel.c @@ -12,8 +12,8 @@ #if EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_RIVERHEAD static const efx_tunnel_ops_t __efx_tunnel_dummy_ops = { - NULL, /* eto_udp_encap_supported */ NULL, /* eto_reconfigure */ + NULL, /* eto_fini */ }; #endif /* EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_RIVERHEAD */ @@ -26,9 +26,13 @@ static __checkReturn efx_rc_t ef10_tunnel_reconfigure( __in efx_nic_t *enp); +static void +ef10_tunnel_fini( + __in efx_nic_t *enp); + static const efx_tunnel_ops_t __efx_tunnel_ef10_ops = { - ef10_udp_encap_supported, /* eto_udp_encap_supported */ ef10_tunnel_reconfigure, /* eto_reconfigure */ + ef10_tunnel_fini, /* eto_fini */ }; #endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ @@ -204,22 +208,12 @@ efx_tunnel_init( efx_tunnel_fini( __in efx_nic_t *enp) { - boolean_t resetting; - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TUNNEL); - if ((enp->en_etop->eto_udp_encap_supported != NULL) && - enp->en_etop->eto_udp_encap_supported(enp)) { - /* - * The UNLOADING flag allows the MC to suppress the datapath - * reset if it was set on the last call to - * MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS by all functions - */ - (void) efx_mcdi_set_tunnel_encap_udp_ports(enp, NULL, B_TRUE, - &resetting); - } + if (enp->en_etop->eto_fini != NULL) + enp->en_etop->eto_fini(enp); enp->en_etop = NULL; enp->en_mod_flags &= ~EFX_MOD_TUNNEL; @@ -476,6 +470,23 @@ ef10_tunnel_reconfigure( return (rc); } + +static void +ef10_tunnel_fini( + __in efx_nic_t *enp) +{ + boolean_t resetting; + + if (ef10_udp_encap_supported(enp) != B_FALSE) { + /* + * The UNLOADING flag allows the MC to suppress the datapath + * reset if it was set on the last call to + * MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS by all functions + */ + (void) efx_mcdi_set_tunnel_encap_udp_ports(enp, NULL, B_TRUE, + &resetting); + } +} #endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */ #endif /* EFSYS_OPT_TUNNEL */ -- 2.17.1