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 B76D8A0C45; Thu, 13 May 2021 01:12:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D7674067E; Thu, 13 May 2021 01:12:53 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80083.outbound.protection.outlook.com [40.107.8.83]) by mails.dpdk.org (Postfix) with ESMTP id 3C9534003F for ; Thu, 13 May 2021 01:12:52 +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=bKhTVba5vEBITKzUjNzSHamt3AhTsA0kPNxxpBNKzMA=; b=vL1rtnWn5Q5EDvfkFEBq6GxuUW67lkd75ABXXhwgrC6popuE5MTNlN0+bPobdgmTsO/DYsoB9sOqiKFMTZyEh93qKidI4jnNTOZ8gf4xyWPSC/IjAnHVXKGdlyGhWMu+sdqCFyNsKFLTlqHwFSLNXYlVQ2fRolXohjKjmze6q78= Received: from DU2P251CA0015.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:230::19) by AM6PR08MB4439.eurprd08.prod.outlook.com (2603:10a6:20b:be::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 12 May 2021 23:12:49 +0000 Received: from DB5EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:230:cafe::e8) by DU2P251CA0015.outlook.office365.com (2603:10a6:10:230::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27 via Frontend Transport; Wed, 12 May 2021 23:12:49 +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 DB5EUR03FT047.mail.protection.outlook.com (10.152.21.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Wed, 12 May 2021 23:12:49 +0000 Received: ("Tessian outbound 9a5bb9d11315:v91"); Wed, 12 May 2021 23:12:49 +0000 X-CR-MTA-TID: 64aa7808 Received: from 0c0d7fea22ad.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E949A88C-3017-44C5-B01E-FD668FB96DD3.1; Wed, 12 May 2021 23:12:38 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0c0d7fea22ad.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 12 May 2021 23:12:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cW3DVyQcmi9APuItwTQ+8YkbYRXSa+rz/9RoDnac9rKRHN9/10rbIa31q9W8oHhSRsKu8LOEpNyYX5WU6AwD9EbFanUBpWwmLc25uZ2aySKK/PfInG1W33LWa564pAv7nvkb2nMKkMhMcVsBzq2TdMb2koN//Se1MZ6gBqiXDhrSgiFLz7nYWO7jxO1hhFWas4+caGN46k9wACrW9itoaWPFNQBuY6Y0wu77kTsf5rU7tfynkhf41Aiykgq6CkMJB2/HYW/hEfjE+GU3B182ewtXcxNk7UOj1Qjqqdaw0xYkg6ETambdGA2TbKfvEJH7svWDe+tJE30O/fD8D2IHOg== 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=bKhTVba5vEBITKzUjNzSHamt3AhTsA0kPNxxpBNKzMA=; b=kvOppl6btUYLuwi0Lrfjs4aK7aSXrrnfvsSvy19cxFsv112XrLvFEdfExHxSEgcgiHGvKFUGkYG+CgBC6nmasQh6hBSO3Rz36zGlSGN/fFp03FPxi7dgPNxMOShuN3APwQVLdDQJSncNNVyPqYewpSIozPq02EMdwmg9Drj1Od9e43LxyjOiFWSvQldTGNzErLEVLnH3welHN49wMMcsamG2ttf9aijix7+H3zijCyfnwD++WIPbSEyK0lilUw/C1UchOF1H/6nLglO7Uh1Jcd2ROF1V1GJrCWG1qpZobyEmMwEjyUxbiozVuNqIS0IRDl+JaCkxToKItmdZlqKXbw== 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=bKhTVba5vEBITKzUjNzSHamt3AhTsA0kPNxxpBNKzMA=; b=vL1rtnWn5Q5EDvfkFEBq6GxuUW67lkd75ABXXhwgrC6popuE5MTNlN0+bPobdgmTsO/DYsoB9sOqiKFMTZyEh93qKidI4jnNTOZ8gf4xyWPSC/IjAnHVXKGdlyGhWMu+sdqCFyNsKFLTlqHwFSLNXYlVQ2fRolXohjKjmze6q78= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB9PR08MB6442.eurprd08.prod.outlook.com (2603:10a6:10:259::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.31; Wed, 12 May 2021 23:12:36 +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.025; Wed, 12 May 2021 23:12:36 +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" , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH 2/2] net/hns3: refactor SVE code compile method Thread-Index: AQHXRwlKc4fxsI0SS0KXXIdURovZZ6rgePlA Date: Wed, 12 May 2021 23:12:36 +0000 Message-ID: References: <1620808126-18876-1-git-send-email-fengchengwen@huawei.com> <1620808126-18876-3-git-send-email-fengchengwen@huawei.com> In-Reply-To: <1620808126-18876-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: B403D8C403260A42A16142454734CEE5.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: [107.77.217.34] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 401eb0a7-748e-4e42-f169-08d9159b75fb x-ms-traffictypediagnostic: DB9PR08MB6442:|AM6PR08MB4439: 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:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: HhAH1Le5m/3RFs9T32ya8tJIsVEmSejNnaf8QlGc0XIMymxsZx+9i2/Do3HNF+7Y0/BXqXfLBqJ/30JungjX7F8iQoFOCS+Cs3eBkrhBqfikg5078TeAkxy/E/MOI3uBwh51cVWaRuJiIdJ5d1xgYiLXEk/wtLuv3cDtS/OrVklR25XLnZQ/nU7hk4+z0giEtOoYARSusMbOiunwSK6eoLMkHqvUOL+noTrfXOZU1FheIXkNpG5RVT9Qjh1yamLbrbg69S5YUx8z21uWyG0gKnMKQikXzFR18xh8SdUsmq4FvBG9LThvEAKenQBENKwurHI2wpo1Gyy7KmOmTJmeuhiksIIlmwl+QvfN8fHCWoghM62bYURwvDvJpPVPV95vfO9NHE/OVVB8aLeqAb+1VI1uYTowkLzZU9ZQPU06QOpodZZSgRIFB1U507i/2bUUkcs/0ounvHKsTcitY5yLAW1my6+mkQZJM5qFFDuOljkLiUMfMrpIYosDaF8/JlJQIvGsSkIXDR7oWorIKOW94UX+JeKsDEdWV/gMFXSTlM/JM9fVzAQM+1yu/H7QvWRfjBPfOEprgDzE1y/r5cB7y9M2yTrH3B6jsG1fGZQtlomRmka/a1aun4hvQnwSUABR8Qte0KCc5/rNf4KEKscbhylzZIVYzUJ3tanUtTzkKMkU5qsPsBLg089JLJhmyVK2 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)(346002)(376002)(39860400002)(136003)(396003)(52536014)(38100700002)(6506007)(122000001)(478600001)(71200400001)(64756008)(2906002)(316002)(86362001)(4326008)(26005)(7696005)(5660300002)(55016002)(33656002)(66556008)(9686003)(186003)(110136005)(76116006)(8936002)(54906003)(966005)(66446008)(8676002)(66946007)(83380400001)(66476007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?6AR2UrOi82GDz3Nh7Miq8O6lCq4ooyFH+pz0mR4zL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8p3fyhTVSThriMPSKJW7F2wEMhEa0JtQnnff75ZuXEx?= =?us-ascii?Q?KOLDmcCSlVdalRILn5DToEqpavS8kICw7wH6y/VT7lwz7pl78SMfkreFzmm/?= =?us-ascii?Q?WalmI/P40x23QWakordS6NssConOc+QY27fHn6z6Ev+wEQR65y4zHQO+ZF8r?= =?us-ascii?Q?intVBHQ2xvuhSZ+HSGAoGNySY04khM3EZFBkbxQfW26XYaZHvWlwkGlrzHjg?= =?us-ascii?Q?WAfMjAIBVvOMVvrS2v0/9vNZ3nhwL0+Eo5ugThCZossOKhZueoD4CnYLfRA8?= =?us-ascii?Q?ObWtyDHakEkHg/4KWD5zdkq4DFF/k58zlux6P7nhQqOq0jEYhnRCpX/QJqXS?= =?us-ascii?Q?9B32x1gj5MwkOdoMFQ8BH7k49ii/SshDxMssihLnjGjmbvFuRhHz0Ud6kRuS?= =?us-ascii?Q?OIP9jNeAib7+c8GOQ8t7ndtG?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6442 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: DB5EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 0036da0c-2c07-401c-eed9-08d9159b6e99 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rHComWGMFTPxOD1eimimGXVOgExxLfENmstPK0g2boz4UrB+DX1VfBBvQcRVxjohBH0AVT16OWIT9yDBwVQ3hoOcSbdY1u65ynBQ4NIUNDsNa6PkkGQHZazONio0rutvT6gyUZcqyaEQqASSx6Cneo+PcILr987dvEIEbKPmo9gEKQ+vwOLWigHwyfisgBj8lVTk4J2baq5+jd20MK9mH/TVO2r/DKG8dz46eZT1I+ViFWnYtiFrGls8/VuNvbCNlDx/5sxmo5yhm35jUlwuhzqddeppJAw5N3cpI4RyUXfMoTW7e9sAQVnCBC1CyrtfbFmYZ72skv9IX8Qx8qPOw75Gdz6SmNRxtXnVEkZunjjKCH3wr2tWQAkoMkJkRKgO9bIMrDWKbm9LYYAF8wGbaACRHk58ry7Cj5Ogli9MydGUcj904M4f+L1l6S3q5Z+ot5EVP15wNge603WQKr6gT/8KINv9YQjSmDO7JWNk4u1SI7Ft1d0f7eFA8+k9Zkp1q2FWJbPuWgNCgdTykKTy0KoKUcuuOHFwOsWxPxPMMOIRE5FW2eyM90V3kGx9f+XajxDukzls3O4jBQaiNG0LDJNUf9dtWVQTvV/6yb4Umk2k79sCAIWy6dt/ids+C5vQl6/HEZXfmR2GxSpppNvl94ByKvxelLqOPsR7T19/FsKEtNOqi9YfwWdNl0YK7MI9wdMo8OF0WUbV9/0AudNImnKWn7G5Jy2ghut+Mf0J5og= 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)(39860400002)(346002)(396003)(376002)(136003)(36840700001)(46966006)(966005)(86362001)(478600001)(33656002)(26005)(5660300002)(81166007)(52536014)(356005)(83380400001)(82310400003)(2906002)(36860700001)(47076005)(6506007)(110136005)(8936002)(54906003)(82740400003)(55016002)(9686003)(70206006)(8676002)(70586007)(186003)(4326008)(316002)(336012)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2021 23:12:49.3125 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 401eb0a7-748e-4e42-f169-08d9159b75fb 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: DB5EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4439 Subject: Re: [dpdk-dev] [PATCH 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 > --- > 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'] Why is the CC_SVE_SUPPORT flag needed? The compiler has __ARM_FEATURE_SVE f= lag already which gets defined when '+sve" is added to '-march'. > sources +=3D files('hns3_rxtx_vec_sve.c') > + elif cc.has_argument('-march=3Darmv8.2-a+sve') I think this check and the above check do the same thing. i.e. both of them= check if +sve flag is passed to the compiler. > + 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