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 69743A0A0C; Fri, 14 May 2021 16:12:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E377340042; Fri, 14 May 2021 16:12:58 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60075.outbound.protection.outlook.com [40.107.6.75]) by mails.dpdk.org (Postfix) with ESMTP id AA5D740041 for ; Fri, 14 May 2021 16:12:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NUkxx6m+N3FvnkGLU56EFB4hxZsqbMnH3L8sDS2KKtw=; b=0XFQbMATpaoYATir1hjcemHWdD8wCL38N1EX0RA3N94J/rMIprU2SM4D+ozy0mEqFuIksG/PmU74vP9HF1lzF9V5/FfC+Ya6wnzs2B/kBXPK4q8Rx7AMFayPf4vTCq62afwpHk5FSWgDJFWxcMxXAX4alfH0F0XsqdYL7IgFgdU= Received: from AM6P193CA0108.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::49) by VI1PR0801MB2064.eurprd08.prod.outlook.com (2603:10a6:800:8b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Fri, 14 May 2021 14:12:53 +0000 Received: from AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::9b) by AM6P193CA0108.outlook.office365.com (2603:10a6:209:88::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Fri, 14 May 2021 14:12:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT010.mail.protection.outlook.com (10.152.16.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Fri, 14 May 2021 14:12:52 +0000 Received: ("Tessian outbound e566ed09e411:v91"); Fri, 14 May 2021 14:12:52 +0000 X-CR-MTA-TID: 64aa7808 Received: from 736032c54abc.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9DD15EB0-B6F0-40E1-873B-899DD39D240F.1; Fri, 14 May 2021 14:12:41 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 736032c54abc.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 14 May 2021 14:12:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P29KHyAx6L8+vi5f8yea8WXVk+SIj+23QzXn3YCTFXyKYbKk0H1WOXFpSLCHOWHDQK44SOky2tEGIpTSH0EYp6AAU/JVtTiYTSQymtDlByWVRt7MT2pCmVR1nfc4CTCQzC3L5E/jRrVOwexqUCqfK7ZrOmP4Zc+C5b3QGAN57/pXcnN6OJwx3dD/AhGHTKcfGhRswqfPcmpe8+gyEXkhU6ZiS4FPeFciLCvbhBoG6DPLLSuJXcaB6AP6Ky2vwanR9sKHfO06JefIBIBvyPT8L8AbutgQewFNkz7iG27zE4iSp6Tj12KXjG2fXSt7p1feQ7rx6vz4D9PKzWLNu6fbGA== 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-SenderADCheck; bh=NUkxx6m+N3FvnkGLU56EFB4hxZsqbMnH3L8sDS2KKtw=; b=mO9uRETur2yFAi932VNitotJqpAEaG2hZOJBbHYFZWXEDCCCJd4XgXvAcjtO2BCBjgtzRB6/OvJldALBLuD22yGsWVK/aboF3VgBQ2H8Jo1dd+ABffoUiaIv6NDFy8sACyhuVUx6Kks1ocD6Me/c2pEOckYf80oet8WpTXebn6BtFEbdAfOTgrIk+pZxXQ7j7uPTw/LXr926BmZOT2CXr0RM2tv5kqPz6PcoH6V9XTV8DoSlJt84vAGN78GKY4IhSfVnEMXPLqUrdi3rODLlXXT6cnZxwUyMG0PD3CNMKE+esiJGg6gw+BzTZe7aGqmi5LARAOsXEk/aodGB0VjGIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NUkxx6m+N3FvnkGLU56EFB4hxZsqbMnH3L8sDS2KKtw=; b=0XFQbMATpaoYATir1hjcemHWdD8wCL38N1EX0RA3N94J/rMIprU2SM4D+ozy0mEqFuIksG/PmU74vP9HF1lzF9V5/FfC+Ya6wnzs2B/kBXPK4q8Rx7AMFayPf4vTCq62afwpHk5FSWgDJFWxcMxXAX4alfH0F0XsqdYL7IgFgdU= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB6PR0802MB2374.eurprd08.prod.outlook.com (2603:10a6:4:8a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Fri, 14 May 2021 14:12:39 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::f15f:821c:74c5:2482]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::f15f:821c:74c5:2482%2]) with mapi id 15.20.4129.028; Fri, 14 May 2021 14:12:39 +0000 From: Honnappa Nagarahalli To: Chengwen Feng , "thomas@monjalon.net" , "ferruh.yigit@intel.com" CC: "dev@dpdk.org" , "jerinj@marvell.com" , Ruifeng Wang , "viktorin@rehivetech.com" , "bruce.richardson@intel.com" , "jerinjacobk@gmail.com" , "juraj.linkes@pantheon.tech" , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v5 2/2] net/hns3: refactor SVE code compile method Thread-Index: AQHXSKeIsvH+pBr4U0mfLkYTbHNSeKrjBNOg Date: Fri, 14 May 2021 14:12:38 +0000 Message-ID: References: <1620808126-18876-1-git-send-email-fengchengwen@huawei.com> <1620986039-29475-1-git-send-email-fengchengwen@huawei.com> <1620986039-29475-3-git-send-email-fengchengwen@huawei.com> In-Reply-To: <1620986039-29475-3-git-send-email-fengchengwen@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 40B0E8D2D782EA41954FE91E516194BB.0 x-checkrecipientchecked: true Authentication-Results-Original: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.113.13.105] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 5f744f03-5862-44ce-3592-08d916e25d16 x-ms-traffictypediagnostic: DB6PR0802MB2374:|VI1PR0801MB2064: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vc81JJAW6RoXVsn0Av+7koRFOCHXVt+Xi2BjAvF6aBV+7nDpmaciCQeSCu20xYDWSbHlCPfTecOSoaGQn+KoPt14qRg7WKtMH23sZyROnb+AnTO7FP03JivburSu8B8qNW5tNOdgjFJ7HWhbeoAVX9AqbkmlH7U+O3id3FNQK09y/7o1tbK3FQDss5K2neh5EkAtzuN34pj7Cm4tqmqTiEMT3PWP+pk0z+hYZG9XHp7QYAugVPaqXiHKU7V8Y+f2MRSDHFZJWw0UchlxZbdsOzsBbUBRyZjGoNt25M+Y8Z4b1AYOV4GgFNLF9iuq+RD6LtXK0FE3B0bQSmQuBobamqViyV9sqbdoWPtYjt4fpmedkiTSMQGBJ+N81NAG0MZDI8C404uGHVg2BzUhBImtiZLE+rwUNxzYanmTf8/NqA0zWy9spGIqojU7NpA15HgO2Bo3XsqEPM1YoQ/zV2ve2LAGrHHWPe9VsRoerok2Dm0rkR6VBPdkMjL1U550MCTdJ4u34Ys1zmVQei4JkVSAy9T8tfwcyCbHYlNbewQq8ZkpG/Cftb4EqK/FvRL7yVLMlCwvR/EQL2ha0YcSB5yEGQ8p5+1FL3SbXYzi1wNOrd/WKhEyC4w1oIRMCya5Dapsrk4MIw1o0idrQmyfNGIxfswUDE84fnTS9GnA2MB/zE9trLQLPLguCebhYplTyipS X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39830400003)(346002)(396003)(136003)(71200400001)(7696005)(8676002)(6506007)(26005)(86362001)(966005)(8936002)(33656002)(478600001)(83380400001)(54906003)(55016002)(66476007)(66946007)(4326008)(38100700002)(52536014)(316002)(110136005)(5660300002)(66446008)(64756008)(2906002)(66556008)(122000001)(76116006)(9686003)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?zShmWHxWiDfqtPjOc54n9bEH7AI4u7dIQKe9HQeqksbDY3PpSQUfsG0+GNPw?= =?us-ascii?Q?s7hNYxcW5tDj42k1MPcbK4cwMrL/OL9arW7d+KxTO/5MU2uqpNN/w43nxNmU?= =?us-ascii?Q?IXJWd2Pg2XdrUOkQG5a779b3gtYzipY+aTY8BeDfrJf2GuZ1YJEHOxTTj7mO?= =?us-ascii?Q?v8E/5mE3QtOb2fMkeR/ZhbFVAppyuN/h4xxSidyrzhDp/OWh0FEeWw/+B+1n?= =?us-ascii?Q?JKXOttriMGKvelBH5fn4CLdZ4uFdKe2ktEwEcVNB1Zs0tb6gAWHVe2PfS+mY?= =?us-ascii?Q?ysdD6UjfqwKno5KGdMLPwVpQT8/fsMI+GuMaiNflETMr8HeZhP+VoKj9nVa4?= =?us-ascii?Q?bhL3LgatahBHPlYMg6MKXdUoqoPKQjmqaGduepgUVPLg8VH4aO0GRXtuXqxd?= =?us-ascii?Q?Q9m1+RvkHGdwql1LtB85///u9oSicRVjWw9OahMk3IPBrhRuqcadINAGENEe?= =?us-ascii?Q?rJpK/g/8hABSqlqKx4rOawdIcGQNw+pQ7UhCDg3mH2oUTbfM+Ayv5ipB5b0Q?= =?us-ascii?Q?cvGGo/2DrW1LtmkyiH8IX1PnUrLBt8oqRgvrfnkji3igSGNPErwnmBdv6xMS?= =?us-ascii?Q?rY9qoJWRLJ+3/oHAGGnwl2SUcg6XQEPQE7IP3BDQfOawSvwUdW5lh3olM9md?= =?us-ascii?Q?FnOD4/E6h0SqJv0OTSkMPIzGhVRF7dJJLzS4m7MET4cgUML64flUefGP2XiJ?= =?us-ascii?Q?33n7OkQq3HdBa2CQX0fZL1zIyeip2JGdAyCM/KE+4A45Uyi44ZWNTfDOOT5r?= =?us-ascii?Q?5FR8GAZL3FffGNLumVumdB3dE1CuQgJxRPfKfZI9gda8S/Cd5W7xpYS76l4R?= =?us-ascii?Q?oHgvQHFelsM+1U/JAl6b+1ipNOO+6NSIG3Pp4LFaBBm3XgdfdYTpR7gDVRm7?= =?us-ascii?Q?4WGLhypF1EmfrLzs95uXFE+ou7TVs10tlFtc8QNSQ2HWpt5FnGqXgJxSqnQa?= =?us-ascii?Q?8VedQL1RLyFQMQw3JMaR9psRZj/Tso3O2ZM75TEicmFEeo+cN9aIBC8khTzR?= =?us-ascii?Q?x7Xk3UuGVZE3T31wB9rW5gRam/Zcz4hy6a1S/BQjQMfxNisysK061NTL3H05?= =?us-ascii?Q?BA0kw/p78Zz3AM7pwexD0MHOLUpj1vnPW2ZlDbhxDireUXh/Ix4e96AcPyf+?= =?us-ascii?Q?mjqW/t6xu9o93HVFCs51B9NBQTVM5HYJyiprwKUfqgmI6+nNCcOqPJ2n94Lr?= =?us-ascii?Q?qmo+vyW0/+uwA2+qKPVya7RI6HzBaCKrfk/hpcRXddyAH+xK2tCGnhk02iUx?= =?us-ascii?Q?xOrnlDj6JYazLvCeANYJmTgtp1E0Tj2GCcyvqQKKEaWUYQ/twDp9dq2HUqeK?= =?us-ascii?Q?AF3lM6TLucPfybA9OijDRZYp?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2374 Original-Authentication-Results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a6109d74-436f-42c5-1216-08d916e254d1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QwebOluCo2ciXajyJqMm56BtITI/JZnMWUeEQbJtXmJRz+Zjz7OgzmohcYBUP87jNxiUhp1AWiCrROQBFXYg4ddOeJaBIiPt7t+Sd/4GYD7xZL1eU/ZWywI7Szfh022bsJZEtOQFEc2bwCSmL2209JP0cVgoFW/Xmy7WnzVNUcxFRnI2hea+HQYB3ApeYNObLCvevDACdko5LpF5qtnfUfQ1buoPYGG+qjs9Fw6+FniA/Ci9Uut7Am94drVIDahtL1OknRc+QV5XDY2dpg1ej6Kr4eE2ZtPk8OAh1uIArKYaMZvLE1BHv9f2ZJi+M+rIf1GvOJ9j9/nGB6zMTlhNm5Dmc82pJ8uNvL6u1O5sj3rrIvOLRLAzUvysuYwi2I6nAA7zq2n1DZNriR/6uGeOC1xRH42ZezBtldL8eWAA4p166c+X1QvEuO7wfjRmfhNTUmGFVu2HeNhfJD/fjcur/iwmnjXhERk59Q0ix1jPFNRcyTI4w5q//aH4S202gUajGNobOEsU1oihkxz9aDWx7Oequ/AWzkoQ4pVMOMfgMDqJvDjcbdiUtxdlH/z0ClCWJyGA+9fFVPoKE01aAq2GaM8Wn0XFl9RDYrMemYk7a9aHSh0a3l22iO2df4UPHn0PVCOE7l3DKP00GW34fyHuyJs0wZWMIR6fLMlv/jrizH/1xAotsOrT4jOyOzwdIyI63dXepMe2kN+dGFHkpNWd371JZ0M9xxh+KsCLR+Owqeo= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(39840400004)(396003)(136003)(346002)(376002)(46966006)(36840700001)(7696005)(4326008)(26005)(478600001)(36860700001)(9686003)(47076005)(316002)(5660300002)(186003)(6506007)(8936002)(52536014)(110136005)(336012)(356005)(81166007)(54906003)(70586007)(2906002)(83380400001)(70206006)(82310400003)(8676002)(966005)(33656002)(55016002)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2021 14:12:52.9002 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f744f03-5862-44ce-3592-08d916e25d16 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2064 Subject: Re: [dpdk-dev] [PATCH v5 2/2] net/hns3: refactor SVE code compile method 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" >=20 > Currently, the SVE code is compiled only when -march supports SVE (e.g. '= - > march=3Darmv8.2a+sve'), there maybe some problem[1] with this approach. >=20 > The solution: > a. If the minimum instruction set support SVE then compiles it. > b. Else if the compiler support SVE then compiles it. > c. Otherwise don't compile it. >=20 > [1] https://mails.dpdk.org/archives/dev/2021-April/208189.html >=20 > Fixes: 8c25b02b082a ("net/hns3: fix enabling SVE Rx/Tx") > Fixes: 952ebacce4f2 ("net/hns3: support SVE Rx") > Cc: stable@dpdk.org >=20 > Signed-off-by: Chengwen Feng Looks good to me. Reviewed-by: Honnappa Nagarahalli > --- > drivers/net/hns3/hns3_rxtx.c | 2 +- > drivers/net/hns3/meson.build | 13 +++++++++++++ > 2 files changed, 14 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c > index 1d7a769..4ef20c6 100644 > --- a/drivers/net/hns3/hns3_rxtx.c > +++ b/drivers/net/hns3/hns3_rxtx.c > @@ -2808,7 +2808,7 @@ hns3_get_default_vec_support(void) > static bool > hns3_get_sve_support(void) > { > -#if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_SVE) > +#if defined(CC_SVE_SUPPORT) > if (rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_256) > return false; > if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SVE)) > diff --git a/drivers/net/hns3/meson.build b/drivers/net/hns3/meson.build > index 53c7df7..8563d70 100644 > --- a/drivers/net/hns3/meson.build > +++ b/drivers/net/hns3/meson.build > @@ -35,7 +35,20 @@ deps +=3D ['hash'] >=20 > if arch_subdir =3D=3D 'arm' and dpdk_conf.get('RTE_ARCH_64') > sources +=3D files('hns3_rxtx_vec.c') > + > + # compile SVE when: > + # a. support SVE in minimum instruction set baseline > + # b. it's not minimum instruction set, but compiler support > if cc.get_define('__ARM_FEATURE_SVE', args: machine_args) !=3D '' > + cflags +=3D ['-DCC_SVE_SUPPORT'] > sources +=3D files('hns3_rxtx_vec_sve.c') > + elif cc.has_argument('-march=3Darmv8.2-a+sve') > + cflags +=3D ['-DCC_SVE_SUPPORT'] > + hns3_sve_lib =3D static_library('hns3_sve_lib', > + 'hns3_rxtx_vec_sve.c', > + dependencies: [static_rte_ethdev], > + include_directories: includes, > + c_args: [cflags, '-march=3Darmv8.2-a+sve']) > + objs +=3D hns3_sve_lib.extract_objects('hns3_rxtx_vec_sve.c') > endif > endif > -- > 2.8.1