From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AB08541CA9; Wed, 15 Feb 2023 20:15:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F09B410DD; Wed, 15 Feb 2023 20:15:26 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id E260F40A7D for ; Wed, 15 Feb 2023 20:15:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676488524; x=1708024524; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=y251qLjZDgM31oNSAJisi78NZYz3UOj671hesYY6v7c=; b=Db5v1iqMmAQ0S8iEoCEd/ODSHzdVmebSH/VgEcVNPyCETv76PdckV0N7 cTS4do3VxRLIT7PwaQ9SHAFBC5dESkDcSW2PgoFG/I29PD7v4cs3omJfj uIlbckkmjS520vkTkFBm1H/tmsLqCj7u/REqkuJlM6wXYCJzI2qnG56/a pWTvPd5VrM/Fd8/K7Qr5zNsbeOXkHHOT8+l4HkER3Vjc/kl86q753szxt mzUIfd6SK2EbPj9YkQveL4aAS3ZjDsa+n2mEgTTOSUr34RiQIQPBpdvRx 7LEQZCQnPnb5RoZLXlRA+mJmrWmgshnrtih8NkZgktjezl+kzTJDU7bFR A==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="333670315" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="333670315" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 11:14:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="843811224" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="843811224" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 15 Feb 2023 11:14:32 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 15 Feb 2023 11:14:31 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 15 Feb 2023 11:14:31 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 15 Feb 2023 11:14:30 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAPNuYKmngAhT9SlGh3Nue/IUwKcbK9WPBaTONEDG/GeoVOXpStQRc4V+i7nmgp1WsEJjDARi8LChB0MS4FuSJRvyl1h+EYEilJF4KNDPfOE/P/zKxoqcmkRNtmIEUUOksaJ5RFOTT4+7D9QbRGx+rJjViZWoh4ioONeNan5rf54dSFMzdeOcUqLNtk2Lnn4NmHnbnt+2iTz+GNo4p/OttOnRJ13aIvK7F9TJy9XaOYIoSK2/D4445fcGAmrIhIFjF+nXc1lkww78wcN3TvfKfu9ko6T7hsmY9yt12v9ITVtvUqGJNGid4+tON8+sfC0601DquxcOaWEOf3XrkO7GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kLzg6PwRToaCg+xWCDdSQMb6KVEkHIT9Eq0k2l73mXw=; b=h8j/GXoelL0xfUxvs2Bf+ASUsnex7V92SBjO4CKP6Nk0rAQA1M8IzHw0C7qF92JIS0+JvqHYM3Xxh1dZk49g08idNxsqK9C3ppjrokXM8vTK9BsZYoRjq+5ZTsQBDOF2fL0Xh0GpmslW0hOMQ2sg6bmbVOtFWlgkf7kAp8rUqdygXhCZFQqam0gY0IcafZCLO+MTveFIB2rNhW+VX1a8FvCSsD7JaShUrXWIfGB2E769dqFes7LjK5P99N5/Iw+npNE5MJdJ2aZ0QS4fc0/WO2nMwhg6NAbDEmwh60qnENNBMHAwbQI4c874LiwuTDP6jfLEq6NGa+rCvZ6ePCbhAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) by CH3PR11MB7762.namprd11.prod.outlook.com (2603:10b6:610:151::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Wed, 15 Feb 2023 19:14:23 +0000 Received: from SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::d8e2:d192:9b46:bc2c]) by SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::d8e2:d192:9b46:bc2c%6]) with mapi id 15.20.6086.024; Wed, 15 Feb 2023 19:14:23 +0000 Message-ID: Date: Wed, 15 Feb 2023 19:14:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v7 20/22] hash: move rte_thash_gfni stubs out of header file To: Stephen Hemminger , CC: Yipeng Wang , Sameh Gobriel , Bruce Richardson References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230215172341.1525320-1-stephen@networkplumber.org> <20230215172341.1525320-21-stephen@networkplumber.org> Content-Language: en-US From: "Medvedkin, Vladimir" In-Reply-To: <20230215172341.1525320-21-stephen@networkplumber.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P123CA0026.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600::14) To SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR11MB5772:EE_|CH3PR11MB7762:EE_ X-MS-Office365-Filtering-Correlation-Id: 29a36281-f77d-4b33-2473-08db0f88d8a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BGT+rtRnA8yN8yJCJlHNbB4ZK0GsNHzaTVsMwKflwsPpiT7so+laPQ/8mgSM5e48gkq7Oxc/Q4wMUM6r/FlGGqa4OiTb2J7Mb5AT+xEJ79S4HBvz0zETe+SCJS2hE2z1jaJiHcLPHEtIaISy1k1stWhLRYFTHN1hTa6qnpqJiAmAWh5K8AKNtNiOtSIMPGsLByDAxAQquk1U0o83NYuNrEQAdStfO7oYAZEEVPnaSAMpGKoVdI768sCXWmeRSFIXO7D8p0E00jPVoKjb9/N1B5crS5D6Yx68Y/qYyb+biuD8kpkHJRYjkFykQSucHpBecDmSl/UYS7R+RcJg1E8NJqRZeWJPrd1AWbhdpKmkzZSA83JyL+ywdAvBVFk4psll/PZVnGi2+e72jWOxbWOAUczBxWy7yOBNT5sdruM5CTmU+2l8RcSf3j3CBb9GaLJ2zd2yy3WVL1yHcDVsSGn1CJ/wPUDjMIX4+Bys0WLbSl25xxT7ddshZm6eEwPdDVs7yB0RQvllt0AyVNH2kw5RFf1HS66K34aaHH2KroKJZVGvHr+ojESPMdXZYoWVWZ6TlXIGbMD2yRzO+cibYvBC7XnAWZJGIDQKmJtir8j2G7sTes1AVOxxPOc/FT9o6/7a8Us3khRgqs0cYmukq88HtJfebF6tskixCKLKp2BLA5covWYZ9+IEX0qQc6tZPbQt1hNmLcj4pSweUk2nUBXySFrBEptX9vsXrKSkCpOkaFE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5772.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(396003)(39860400002)(136003)(376002)(346002)(366004)(451199018)(31686004)(36756003)(38100700002)(82960400001)(86362001)(6486002)(83380400001)(2616005)(53546011)(6512007)(31696002)(6506007)(107886003)(6666004)(186003)(478600001)(26005)(66476007)(66556008)(66946007)(8676002)(4326008)(316002)(54906003)(5660300002)(2906002)(41300700001)(8936002)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TTdqWWZlM0tuOWcrUmlTZDVJMnUreStIY2dCOGxvb3lUQU1zTytxc0NLdWQz?= =?utf-8?B?OVFLcU44M1Qwb1NObklHcmRtZUtwSDJOWVBDQzlsanNJSEM2UEtDdG0wR0Vr?= =?utf-8?B?TUduRGFRTGFvLy9NZUFDMnZsTHJ2ZVNVaUVXT1ZVTXE3RDdXamxENnp3ZS9T?= =?utf-8?B?ZW51NVJBaktUUS9mWmM4M2hXZnNCbCsvWExVZEZieWN1SEJHcW1VM3l2VE5Q?= =?utf-8?B?b21uQ3VsTVdDS3dhYlV0ajRsTTJQVFI5SCtQUHFvR0J1NXNWai9OZXBkRlNC?= =?utf-8?B?d3p6WW92b24rek5zckVwZC9jMnEvQVBuVXlCbVhyY1ptajRWRlZIc0RBZkFJ?= =?utf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idEI0d2cvRTVSTlJUVGdyWmkz?= =?utf-8?B?clE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 29a36281-f77d-4b33-2473-08db0f88d8a0 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5772.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2023 19:14:23.0680 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g7ySQpADNQevSZzSfUXX7AOaWEO+qJZvGMrJII92KJVO9geGqLUlFOFjqigGs1QvmGeNpy8YqrNifpXp23Fp/apC0uy5PXTi5OthS1dIgO4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7762 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Stepthen, There is a problem with the build on a machine that supports GFNI: ../lib/hash/rte_thash_gfni.c:15:1: error: redefinition of ‘rte_thash_gfni’    15 | rte_thash_gfni(const uint64_t *mtrx __rte_unused,       | ^~~~~~~~~~~~~~ In file included from ../lib/hash/rte_thash_gfni.h:13,                  from ../lib/hash/rte_thash_gfni.c:9: ../lib/hash/rte_thash_x86_gfni.h:180:1: note: previous definition of ‘rte_thash_gfni’ was here   180 | rte_thash_gfni(const uint64_t *m, const uint8_t *tuple, int len)       | ^~~~~~~~~~~~~~ I believe you forgot to frame dummy functions with #ifndef RTE_THASH_GFNI_DEFINED On 15/02/2023 17:23, Stephen Hemminger wrote: > Having stubs in header file makes it harder to update > RTE_LOG(). Also modify to only print warning once. > > Signed-off-by: Stephen Hemminger > --- > lib/hash/meson.build | 8 +++++++- > lib/hash/rte_thash_gfni.c | 43 +++++++++++++++++++++++++++++++++++++++ > lib/hash/rte_thash_gfni.h | 28 +++++-------------------- > lib/hash/version.map | 4 ++++ > 4 files changed, 59 insertions(+), 24 deletions(-) > create mode 100644 lib/hash/rte_thash_gfni.c > > diff --git a/lib/hash/meson.build b/lib/hash/meson.build > index 2f757d45f9bc..e56ee8572564 100644 > --- a/lib/hash/meson.build > +++ b/lib/hash/meson.build > @@ -17,7 +17,13 @@ indirect_headers += files( > 'rte_thash_x86_gfni.h', > ) > > -sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c') > +sources = files( > + 'rte_cuckoo_hash.c', > + 'rte_fbk_hash.c', > + 'rte_thash.c', > + 'rte_thash_gfni.c' > +) > + > deps += ['net'] > deps += ['ring'] > deps += ['rcu'] > diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c > new file mode 100644 > index 000000000000..7617b9d4f630 > --- /dev/null > +++ b/lib/hash/rte_thash_gfni.c > @@ -0,0 +1,43 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2021 Intel Corporation > + */ > + > +#include > + > +#include > +#include > +#include > + > +uint32_t > +rte_thash_gfni(const uint64_t *mtrx __rte_unused, > + const uint8_t *key __rte_unused, int len __rte_unused) > +{ > + static bool warned; > + > + if (!warned) { > + warned = true; > + RTE_LOG(ERR, HASH, > + "%s is undefined under given arch\n", __func__); > + } > + > + return 0; > +} > + > +void > +rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, > + int len __rte_unused, uint8_t *tuple[] __rte_unused, > + uint32_t val[], uint32_t num) > +{ > + unsigned int i; > + > + static bool warned; > + > + if (!warned) { > + warned = true; > + RTE_LOG(ERR, HASH, > + "%s is undefined under given arch\n", __func__); > + } > + > + for (i = 0; i < num; i++) > + val[i] = 0; > +} > diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h > index ef90faa302d1..86208eb45ebb 100644 > --- a/lib/hash/rte_thash_gfni.h > +++ b/lib/hash/rte_thash_gfni.h > @@ -9,13 +9,8 @@ > extern "C" { > #endif > > -#include > -#include > - > #ifdef RTE_ARCH_X86 > - > #include > - > #endif > > #ifndef RTE_THASH_GFNI_DEFINED > @@ -38,13 +33,8 @@ extern "C" { > * Calculated Toeplitz hash value. > */ > __rte_experimental > -static inline uint32_t > -rte_thash_gfni(const uint64_t *mtrx __rte_unused, > - const uint8_t *key __rte_unused, int len __rte_unused) > -{ > - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); > - return 0; > -} > +uint32_t > +rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len); > > /** > * Bulk implementation for Toeplitz hash. > @@ -67,17 +57,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused, > * Number of tuples to hash. > */ > __rte_experimental > -static inline void > -rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, > - int len __rte_unused, uint8_t *tuple[] __rte_unused, > - uint32_t val[], uint32_t num) > -{ > - unsigned int i; > - > - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); > - for (i = 0; i < num; i++) > - val[i] = 0; > -} > +void > +rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[], > + uint32_t val[], uint32_t num); > > #endif /* RTE_THASH_GFNI_DEFINED */ > > diff --git a/lib/hash/version.map b/lib/hash/version.map > index bdcebd19c29b..f03b047b2eec 100644 > --- a/lib/hash/version.map > +++ b/lib/hash/version.map > @@ -51,4 +51,8 @@ EXPERIMENTAL { > rte_thash_complete_matrix; > rte_thash_get_gfni_matrices; > rte_thash_gfni_supported; > + > + # added in 22.07 > + rte_thash_gfni; > + rte_thash_gfni_bulk; > }; -- Regards, Vladimir