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 EE3FBA0C41; Tue, 19 Oct 2021 17:50:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D047411E0; Tue, 19 Oct 2021 17:50:01 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id B3EC1411C1 for ; Tue, 19 Oct 2021 17:49:59 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10142"; a="208654793" X-IronPort-AV: E=Sophos;i="5.87,164,1631602800"; d="scan'208";a="208654793" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2021 08:42:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,164,1631602800"; d="scan'208";a="550865172" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga004.fm.intel.com with ESMTP; 19 Oct 2021 08:42:51 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 19 Oct 2021 08:42:51 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 19 Oct 2021 08:42:51 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) 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.2242.12; Tue, 19 Oct 2021 08:42:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BW9C9zL6U3TwdAthk1bQLl38C4/4fy52SNpU51cidlalj1s0ZkQm8e2Zb7WNIT0GfwMGbyA26EIvdvLWkMJkntNqkxPDX6fkfgIOMQ7y/AEfcphGuS4JbatApGfxHfRWK5wkzBO6lOjw5oldEPBLrZovi4Sz8h5ru+6dlB6HD4LEsK3hLo+Ky15zLRRJR18zdM+zPkeL8wYBoqRv7LvtHncmsvgGGU6x9ARtT65CPJagLQAg85RQPWZM6zq4qBOrswGJQVtCP4OKXAm8DJcKSfcad9wo5V17Jj5cm+ScImn0JM3gZfqsBs2DgLhPnoQ7sLAhMhouIiaWxCNeqAcTbg== 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=l6m050Phxtm+pqylHfL6OIR8ckLej4rctNvgXhhvirk=; b=EFXyV4UdxNT6UcgO7TkdLKRq73694NfDJiLtYVosX3VWFtec5w2m9ObTvrWvnVnTtYyAVKQDkhypqCTpUkJfhP5ZRjg1vx599PV5TEbCj0FDHtwrOSG1F2KNOnuSILe1UACE4YkXhve9i0Q2zzFEu6Kthg3yDFDPFnU2dmoo6fVlB80/vI5MJ/DiATRcUdhT2/AZ0kFhR1tJZqYhVIQtsMGhWxi2V10TPzzgdrDblE5dY13YW2KKMS2hyJBsZTw7LB9SOMBfvObU20WmUbepvfKkqj4oOkj5sGbRlnpJ1gE7jpSV3RByZtpL69f+cIGs3WpOY+zOT73TMSYk5aaqBg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l6m050Phxtm+pqylHfL6OIR8ckLej4rctNvgXhhvirk=; b=WiMPBaUjWF1kso1hX+2+yyu4tCzoAbsKXSwGJ5PiNc4Li6aGSCqWE3gq7XikwjFxKgG4BdHWxoqNukkRoMDgcXgBnv57HUKnNUyPkDs932ZzLMERJHwAyjrYlyW1OHlHd64gK9ustIInzyesODE0bDbv8OhBK0uEYEEhXh8+FU0= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB5012.namprd11.prod.outlook.com (2603:10b6:303:90::18) by MWHPR1101MB2335.namprd11.prod.outlook.com (2603:10b6:300:73::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Tue, 19 Oct 2021 15:42:48 +0000 Received: from CO1PR11MB5012.namprd11.prod.outlook.com ([fe80::442b:2192:c62b:c6c3]) by CO1PR11MB5012.namprd11.prod.outlook.com ([fe80::442b:2192:c62b:c6c3%7]) with mapi id 15.20.4608.018; Tue, 19 Oct 2021 15:42:48 +0000 To: Stephen Hemminger , "Ananyev, Konstantin" CC: "dev@dpdk.org" , "Wang, Yipeng1" , "Gobriel, Sameh" , "Richardson, Bruce" References: <1634290206-251913-1-git-send-email-vladimir.medvedkin@intel.com> <1634290206-251913-2-git-send-email-vladimir.medvedkin@intel.com> <20211015095834.469a4efd@hermes.local> <20211018181523.24f9657d@hermes.local> From: "Medvedkin, Vladimir" Message-ID: Date: Tue, 19 Oct 2021 17:42:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: <20211018181523.24f9657d@hermes.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P123CA0019.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::31) To CO1PR11MB5012.namprd11.prod.outlook.com (2603:10b6:303:90::18) MIME-Version: 1.0 Received: from [192.198.151.52] (192.198.151.52) by LO2P123CA0019.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18 via Frontend Transport; Tue, 19 Oct 2021 15:42:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ded83460-8b67-416d-ff58-08d993171a37 X-MS-TrafficTypeDiagnostic: MWHPR1101MB2335: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hvp5WULXqKxq9zYjYKQwq4p2y56X9BJ2AFWNv0Nil2Hcx89KEeI97/rblI220HTzE6fjuWXrQAgh9wgzb+fE6Zs0gGLo+GMc+xzQdb2qr/GHmpHzx88euH96yFQdwgzUd7XkLFR7nRQ2airRuCIE0Bo8w2wq6L97Q+Y3k37P+lnVAqrnY9IAkIdOLiVYAreS9OSduZ3XZeotCzkXgzR1xe+CBCUdoC+NcAbqCJTpnCCHpyT5vTglJXeBViLyOz9Pl98Fhbo7ZabXYkNusQg7ESDIcoBkqPzdOIY2LjoXBGpw2sG4H3rV58/DywOF1+aUCA5pbI3Unl5erMJsc+gfRtmy+HR0PZ5CnKue7QE21b1I8S4mb1YHWn8Shzm4ORQKRh/h1lNeE7+9Qn1txcWGl87pjob6dYgMcGyvglrF7FZp56AABNa0EYfPg+zuM6RLNFq0ZB7nSUw04ZPPTfACc9HI3+nYqMfONSbBQauGm7NWHX4swW8VMcqi1wxwdac/LaejAHo0OKcYNBEBpCGWLqdOQydlNrSleSGLbiA3kZSRJeWGy/0puczqcewUraRMFGcYn3glXs5PCvnk2sgx1OQWDxPfRTpkQ7Uq2MZdSJraHhmiRDpV+7uel6yxmiVG5EDpk8bRle0xBlaye/xFA4ldQ+2wIf9Q2tLACTTfTu4zAolPZzBUsSFzTmTZBa2hS2n057C0zzO7xb5puhSGCCrFQUR9ULFxfRkP62c5WWPzTC0HIhRfJRdZcxVBbzaesqeoo+EYw6KfxKdtEmLOiQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB5012.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(54906003)(956004)(83380400001)(66946007)(316002)(86362001)(31696002)(8936002)(4326008)(16576012)(66476007)(31686004)(508600001)(6706004)(107886003)(82960400001)(6636002)(6666004)(53546011)(2906002)(5660300002)(186003)(66556008)(8676002)(2616005)(110136005)(38100700002)(26005)(6486002)(36756003)(3940600001)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NXQ3YzZjcUpFT0ZjaDFVSnU1WHZ0VFZ0R0tncnpZMlNYMmJJWXphZ2Nwd0JS?= =?utf-8?B?bWp4cGp1VDgrQk9uL29GRFJhRHFicTNPQTFGeDAxWE5BcnpZVlFNSnVFK0t3?= =?utf-8?B?UStlNkNOa2k1UUNJWmRRQjRPSkNYU1htbHM5Y0sya2ljeTVSdVJtUEh4NDNF?= =?utf-8?B?Qzgyb2ljeE5rREZxb0xNM1dIb2w1dXdGTWFzSlEzYm5zNUtMN1BXbDdlTlBC?= =?utf-8?B?WTVqRWEvYkIybkk3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3RGtYMVYwdXBXaFdQMjVrZkhSNHRtbEVoT21PdWZIelpqaEhSOVZ5emJ4?= =?utf-8?B?ZVBIZ2tGYlVIY3ZDME5Pd1NFY2FubC93RG42dXdLcE9ud0lPWjl0RnZKVkxz?= =?utf-8?B?anltM0EvSHV0aHJnZ1h2QTdEYWd2Vkl6RVZBQjNxSmJDUHZ0VGtrQ0ZXeVVa?= =?utf-8?B?Y2RUaFpTdUNDdWJBUmFEazBJTWYyYzdiV0pBRFFpVXpReTdzKzZGV0xERUJX?= =?utf-8?B?Zy9ySE92dGVLVjhvS3hOOUY4Wmg0WW5kbXEzV01ZblR2cVZqZzJSNnNHRVl1?= =?utf-8?B?S0lVQXR0SVcyMVFjTUhtUE02UWo1eHZ6S2lpdEJoM3VURVFUOGlMcnUwSXVk?= =?utf-8?B?a3p6cktnck5zWVlqTTJuOExSZDl6cGZvVXlpMXJGUkNyVDc3WmRzQ2NWK2VX?= =?utf-8?B?eDJzYUg1NVRKWHk2WGptYUpxK3BiL0pRSDdUSmlKUUZJeVQ2U25GSXlYaXVo?= =?utf-8?B?akYra3lSWVpUYXV0TktiNkg3b09TZFg0WTUxZVZ0OUJSZWNnQTRrd00vQjk0?= =?utf-8?B?YXcrbytkdlpBdExlOXNlUmxDeUR4aGxoRGYySFJaTE5wS21vQ253ZW9XYzZL?= =?utf-8?Q?XtVk/cGLcMsPrifvzkOdeG7dmI8wbcN/b1VB7Rr?= X-MS-Exchange-CrossTenant-Network-Message-Id: ded83460-8b67-416d-ff58-08d993171a37 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5012.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2021 15:42:48.4826 (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: aZgjhRj8BUfhrUjZy4rPRdo+P/bqWC4FvuIDwKv0GrDI1Mo11kyY8/Cp+5hY2Rk6lHJqieXIQ0jAu/5J6Ea3IRlozIDDMUdSBqZ9Tf+bRHA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2335 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 1/5] hash: add new toeplitz hash implementation 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 Sender: "dev" Hi Stephen, On 19/10/2021 03:15, Stephen Hemminger wrote: > On Mon, 18 Oct 2021 10:40:00 +0000 > "Ananyev, Konstantin" wrote: > >>> On Fri, 15 Oct 2021 10:30:02 +0100 >>> Vladimir Medvedkin wrote: >>> >>>> + m[i * 8 + j] = (rss_key[i] << j)| >>>> + (uint8_t)((uint16_t)(rss_key[i + 1]) >> >>>> + (8 - j)); >>>> + } >>> >>> This ends up being harder than necessary to read. Maybe split into >>> multiple statements and/or use temporary variable. >>> >>>> +RTE_INIT(rte_thash_gfni_init) >>>> +{ >>>> + rte_thash_gfni_supported = 0; >>> >>> Not necessary in C globals are initialized to zero by default. >>> >>> By removing that the constructor can be totally behind #ifdef >>> >>>> +__rte_internal >>>> +static inline __m512i >>>> +__rte_thash_gfni(const uint64_t *mtrx, const uint8_t *tuple, >>>> + const uint8_t *secondary_tuple, int len) >>>> +{ >>>> + __m512i permute_idx = _mm512_set_epi8(7, 6, 5, 4, 7, 6, 5, 4, >>>> + 6, 5, 4, 3, 6, 5, 4, 3, >>>> + 5, 4, 3, 2, 5, 4, 3, 2, >>>> + 4, 3, 2, 1, 4, 3, 2, 1, >>>> + 3, 2, 1, 0, 3, 2, 1, 0, >>>> + 2, 1, 0, -1, 2, 1, 0, -1, >>>> + 1, 0, -1, -2, 1, 0, -1, -2, >>>> + 0, -1, -2, -3, 0, -1, -2, -3); >>> >>> NAK >>> >>> Please don't put the implementation in an inline. This makes it harder >>> to support (API/ABI) and blocks other architectures from implementing >>> same thing with different instructions. >> >> I don't really understand your reasoning here. >> rte_thash_gfni.h is an arch-specific header, which provides >> arch-specific optimizations for RSS hash calculation >> (Vladimir pls correct me if I am wrong here). > > Ok, but rte_thash_gfni.h is included on all architectures. > Ok, I'll rework the patch to move x86 + avx512 related things into x86 arch specific header. Would that suit? >> We do have dozens of inline functions that do use arch-specific instructions (both x86 and arm) >> for different purposes: >> sync primitives, memory-ordering, cache manipulations, LPM lookup, TSX, power-saving, etc. >> That's a usual trade-off taken for performance reasons, when extra function call >> costs too much comparing to the operation itself. >> Why it suddenly became a problem for that particular case and how exactly it blocks other architectures? >> Also I don't understand how it makes things harder in terms of API/ABI stability. >> As I can see this patch doesn't introduce any public structs/unions. >> All functions take as arguments just raw data buffers and length. >> To summarize - in general, I don't see any good reason why this patch shouldn't be allowed. >> Konstantin > > The comments about rte_thash_gfni_supported initialization still apply. > Why not: > > #ifdef __GFNI__ > RTE_INIT(rte_thash_gfni_init) > { > if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_GFNI)) > rte_thash_gfni_supported = 1; > } > #endif > Agree, I'll reflect this changes in v3. -- Regards, Vladimir