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 B829DA0C43; Mon, 18 Oct 2021 13:09:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49E2240141; Mon, 18 Oct 2021 13:09:09 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 618554003C for ; Mon, 18 Oct 2021 13:09:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="291694988" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="291694988" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 04:09:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="444014886" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 18 Oct 2021 04:09:07 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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.2242.12; Mon, 18 Oct 2021 04:09:06 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 18 Oct 2021 04:09:06 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 18 Oct 2021 04:09:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ni69FlnMYqhOyMqpJKIrN717BXBPHr9VpeCeeMQU67m7OAx9mVioxh8tHvraAik1tKF50z8L2+/02TNfwUPUQWZuMO5eZn7VYGe1ysHGokjdZCvrwjZM2eTl1LJUG8Z+xI6noT6Wqy+32eXuuPdC06gVSvRYxtCSMbKsqUVbkrYhzAz/+3x8VDT3zcWaU/sSakKaCXuaCr4M+BY6vDZJCTtYc3IJtfORUDMRqwUXvYVpv5jYboDUvb7Ngl9a+5Wz6C9DiATGD3YynyL/fT9JlZu4gLAxh9hvckNTVRaGRNxi34UqiuSGmSWqwtgJi8SYaFt6vWwemmqkD2FTSyGa3w== 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=yeNiUwk71/NcAu7zk+69O/iEGfQEuxYhE1cVhYbLHJg=; b=b1bHjf5Pxtf4dtchCW/E3DCqWkPl6uhU4dCruH7S6iav2TkuNZVNXfon+Y2/sXMsxZ3HU1HQJ0AjHzYQ1wALQiFsfEmUXQ1vxf+IaWhKxN9PSzL2AB33sqfi2unTs3CBv1xGAQPtGn08lDzoxuiwGIBj0I9BAoHVyrr8MSUaPZT9NWuJ9HG6/5V2WvS/IoJik4zmhd5kbiK0aboQrGLpJ0HBtwKDOZVB7NgGcg18sjzoazbUKTzX6XhnVgwp8RdeVEdNFVA8ypJpN3EfAt1oqqMlkVqfW+bZ30+Rt6XfsiLeYD/+2DDoHw/hiya/gE86jdpecBMnKDxrkIW5vl4ccw== 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=yeNiUwk71/NcAu7zk+69O/iEGfQEuxYhE1cVhYbLHJg=; b=axVwiTxj+B0rj2/UTavaPv4idjfPKpcchekOHTNEswqu57LaC4PCc9cABwIJb7cGw8XEb5wV4QBOW0InnGFldiZmQl4M/LBpVYT2SKzLO1utS7Rhw5kaZ5I244liIqwp9t/iEcDCZRiG3scxRMiXC8zvfs51lVEtjFJSyEqg72w= 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 MWHPR11MB1454.namprd11.prod.outlook.com (2603:10b6:301:d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Mon, 18 Oct 2021 11:09:04 +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; Mon, 18 Oct 2021 11:09:04 +0000 To: Stephen Hemminger CC: , , , , 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> From: "Medvedkin, Vladimir" Message-ID: Date: Mon, 18 Oct 2021 13:08:58 +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: <20211015095834.469a4efd@hermes.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB6PR07CA0085.eurprd07.prod.outlook.com (2603:10a6:6:2b::23) To CO1PR11MB5012.namprd11.prod.outlook.com (2603:10b6:303:90::18) MIME-Version: 1.0 Received: from [192.198.151.51] (192.198.151.51) by DB6PR07CA0085.eurprd07.prod.outlook.com (2603:10a6:6:2b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.9 via Frontend Transport; Mon, 18 Oct 2021 11:09:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf904c50-d177-47d0-fe18-08d99227b218 X-MS-TrafficTypeDiagnostic: MWHPR11MB1454: 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: aP4TYLF1XAxGHlZdQrPRXQjSGLomMSsMfYGfiVHTfpJ3cZFk0kG/Zb9zKi0HXcZCUB4bT0PiYmmApAaYwSNtokDokxlGrjKhPxUjv/pf+KC1J7oCOG2lN2fwjpOsAeDxFKpbFLeu717mAqoLMWnPjN8I77RhVV0I7IUce7jCJS17i7MoOZMYvjOJ3WuxLtSvTzbSKpYGxaiYfRAsIkr47lgJUi8nbqRjXr9VQtoDfsqIcScgl68Se6Yx7ThaTlgdAzWKu9tQ/AxrNqjojqGuCpL4kWWpMKKp14o8KzfbQWbO1m9KP0PTC0VtItUl8ceeragYWfm5w19tOmQHQRYLrO3k682J+P+lCfpoiAuQZZdMH8jb2Fhce6giOYTIiLa8W6GG7GbP3wZbpFirilCQPfQMtpk6Avah7nkMZoyf7ciTbpE8M4X7BQZQhJeYT2wvQJQU+SnFUASyhqsa10k4drfIorTf+/usKiHenXB+IOY3Gbefg3WDvzNtdXRI10oKeH8KJJaiDObjmaaDb0gMF+lPBCTXBmuUr6GPKHNHn3YWCveikYBnGih6opMVslHBCIm2ohG1EiB2c8MqPNacLrAesk+S0iDdKpGLbXsPVkPejjflgCBBZvJikAbdxN89lVNXVaOKUEOiTWql9mkW050zwaAJLvmsceNjqqbkKK+9B90PgytZMTCDnnsudMkkt0dg9HwT1dbfVRDf1Bs5dumnSMDsOVb/GavuVrLVEJXox5PV9ti/kvIf+3NPiN/LEoJlSWpRU/jovkbonp1wYA== 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)(6486002)(956004)(2616005)(31686004)(83380400001)(508600001)(2906002)(4326008)(38100700002)(5660300002)(6706004)(36756003)(316002)(6666004)(6916009)(66476007)(8936002)(16576012)(66946007)(26005)(31696002)(53546011)(86362001)(82960400001)(8676002)(107886003)(186003)(66556008)(3940600001)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S25mczNQVU9SaTdGeHBWejh1bzhLVTJLb3pJM01nUmQzNVYvVkdhYyt3aGtI?= =?utf-8?B?eDFjVlBiUXFQQXhqM0VVbmw0VHRkMHBoM2pDekdySU43bGo5VGt6RkpPeC9U?= =?utf-8?B?UmczNEN5SGYzdWRIdnlZUllpNVRBU0hXS0dmNHNSMGN0ZEY1ZndzQkpZdGox?= =?utf-8?B?VDkwamU1dEpkV3lISGV3QXlQUjBaOHFjVzcyaWt1aUxNcTBGYkpFQ1RRc1Nv?= =?utf-8?B?ck93RGFMNnNnNTE5NVloZFg0QzVUYTdlQXlidjZLL2dKN0hRbmlwVzNESGY1?= =?utf-8?B?Z3F1RnVCbHVPSHZZRzNibVRiSC8vMEdDajZJbFdyY2owOUtvQ0hZaWR6bjlo?= =?utf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hEQ3FPWFRF?= =?utf-8?B?bEdkS0tKbkh2V2l0Mm1TMmV6bTF6ZzJuY3VkQnByMlFIK093UytlQ0JaTVZi?= =?utf-8?B?bEZLcTZhUE5wRXh0MDhPcjJidnZHMitobHhMcE56MDJHai9tZjVmdVRDbENT?= =?utf-8?B?bERBdGtxSWlMd2E4bk43UWtCRzhnSnRkT1R0R29LSUZvSjZlaVA0MDVkZU9u?= =?utf-8?B?S2dWSW5CZVF3L3BFWXJWWDg0bVNueGV4UUhvQXdHejR0WEcrRlUvVFZQOG9M?= =?utf-8?B?ZG4vS2dOVDVXTmVXbVN1c3ZRSjVVcXhQTjdGSVd5TlNqaC81aXh4QTc0L0N1?= =?utf-8?B?WjhJQzhDYXdZcWlncUlUc24rYVZRaU5tdzZSRWFLYS8zYks2YjY3U2t0MVBh?= =?utf-8?B?QUlqVk5yL3U0cFlUS1A5YTJFY1lTclloNTY5eitJWWlFL0FINEFJWWd0bjly?= =?utf-8?B?WENkSTJKZUtEbDVLRWE3ZWZOcEd4b01Wa0E3dExrb2VnYnBYcmozTW5wQkZi?= =?utf-8?Q?i91pIjjN8qF4oyaKozA8pmaJTlD91qOn58HqtFK?= X-MS-Exchange-CrossTenant-Network-Message-Id: bf904c50-d177-47d0-fe18-08d99227b218 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5012.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2021 11:09:03.9963 (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: YfhUa0wC+VUML2c5hozSHf4Gs7TneNrHnH5or076FEYmr1jNGAsRUFlPf7loLaDpFWe4t1gZYFQeWano7bgtN9wzbimW0inZQ8NPpSnPvkw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1454 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, Thanks for reviewing On 15/10/2021 18:58, Stephen Hemminger 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. > By making this function not inline, its performance drops by about 2 times. Compiler optimization (at least with respect to the len argument) helps a lot in the implementation. -- Regards, Vladimir