From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DD5FC433ED for ; Thu, 13 May 2021 15:24:45 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 8D66E613B5 for ; Thu, 13 May 2021 15:24:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D66E613B5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A63724067E; Thu, 13 May 2021 17:24:43 +0200 (CEST) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by mails.dpdk.org (Postfix) with ESMTP id 397CF4003F for ; Thu, 13 May 2021 17:24:43 +0200 (CEST) Received: by mail-io1-f43.google.com with SMTP id p8so25202865iol.11 for ; Thu, 13 May 2021 08:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8mbkY+q4eg45b55+Ql1d/7arRfBqRm+ZwsBgIBUsUhw=; b=otJ1QRL1bB05Z482FGuWYGPXn87L+meWcNodafvdy/ltb3Rvu81CaBCb4arLEO/ZJ8 EwzqQb83wuYdS42HRJ0BOo0zGujDUByvoMLclL2l5jxFWkk9In0O/RPYBqpYY/KBQzHS 9arvJ0N7wihVYx51VLOSjxkSbeY0gnnPqB3LeIohYD8FwWLkre8vjH1icz0oxiMa2sZX p4F+2cerFH5IvCEe/tVazhXXNVomhnhi3HkpBJkhQgZ9bG3upc8W2cV+rZCYdaehXTJY PRPtzBLn5FlBsSUAWAIDxX+ZMnc0PJZf8Bs3htvQcxQqBHI7jLegTd2gbKD+jFC6/6fx +JMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8mbkY+q4eg45b55+Ql1d/7arRfBqRm+ZwsBgIBUsUhw=; b=J2FoV8RPdmRr7D2Cng2oLEJkliVNuxL1Nwg292GDgHh5eYrgfJUy84rDkjZo0dFbUV BrbWXRKhR7Bt14eiNKTj5U37rnT7NnCMo22ZKAW7EMWNpKyCuNn+JjyGg8vxBCgfzdFe F5XPF3eqMh7uQg2/RqVOGLa7IyG07ItzAqESgZ/KoFeiMQyNvr2xjPRxMXFrTTMPJ+o1 qpJg87thk7gNFHWFUy4yWbX+te51eCC2pNWGkclosDEYXbuZY4GEw1oGPRFAmdolZZJo h/aZ5L4f4iaH3rJg/HdDCkeOv5Mg0rN03qWE3uBtrJziINCims58VTrqoyi3eFsGas1t Pj7g== X-Gm-Message-State: AOAM531JQ+z78JfLBLw3xMRsDl2Im0+wcjHp2GO5sEie667+h5mDoE8Y YHuNv9DxlTcBR1qM8tGsIFF5+QaFPYt0512fvZg= X-Google-Smtp-Source: ABdhPJzEqadxj/J0fGze3Z7aygLFRDeUWYKjL+ZjO39A8LaXz4jixSn247FbiJ9N3sr/fDNJA3cWwt7yQ0+yAYb08gY= X-Received: by 2002:a5d:8188:: with SMTP id u8mr31746257ion.163.1620919482630; Thu, 13 May 2021 08:24:42 -0700 (PDT) MIME-Version: 1.0 References: <1620808126-18876-1-git-send-email-fengchengwen@huawei.com> <1620911283-55627-1-git-send-email-fengchengwen@huawei.com> <1620911283-55627-2-git-send-email-fengchengwen@huawei.com> In-Reply-To: <1620911283-55627-2-git-send-email-fengchengwen@huawei.com> From: Jerin Jacob Date: Thu, 13 May 2021 20:54:26 +0530 Message-ID: To: Chengwen Feng Cc: Thomas Monjalon , Ferruh Yigit , dpdk-dev , Jerin Jacob , "Ruifeng Wang (Arm Technology China)" , Jan Viktorin , "Richardson, Bruce" , Honnappa Nagarahalli , =?UTF-8?Q?Juraj_Linke=C5=A1?= , nd Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v4 1/2] config/arm: select most suitable -march for kunpeng soc 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" On Thu, May 13, 2021 at 6:41 PM Chengwen Feng wrote: > > Currently, the soc_kunpeng930 declares '-march=armv8.2-a+crypto+sve', > but some compiler doesn't recognize the march because it doesn't > support sve. > > To solve this bug we use the following scheme: > 1. Define 'march_base' tuple which defines support march, it should > arrange from lower to higher. > e.g. 'march_base' : ['-march=armv8-a', '-march=armv8.2-a'] > 2. Define 'march_feature' tuple which defines support feature. > e.g. 'march_feature' : ['crypto', 'sve'] > 3. Select the most suitable march+feature combination based on > 'march_base' and 'march_feature' tuples. > 4. Use the selected march+feature combination as the default > machine_args. > > Fixes: 7cf32a22b240 ("config/arm: add Hisilicon kunpeng") > > Signed-off-by: Chengwen Feng > --- > config/arm/meson.build | 27 +++++++++++++++++++++++++-- > 1 file changed, 25 insertions(+), 2 deletions(-) > > diff --git a/config/arm/meson.build b/config/arm/meson.build > index 3f34ec9..8551a80 100644 > --- a/config/arm/meson.build > +++ b/config/arm/meson.build > @@ -149,7 +149,9 @@ implementer_hisilicon = { > ], > 'part_number_config': { > '0xd01': { > - 'machine_args': ['-march=armv8.2-a+crypto', '-mtune=tsv110'], > + 'march_base' : ['-march=armv8-a', '-march=armv8.2-a'], Another target has the same issue. Could you fix that all together as it is generic problem in the existing infrastructure. > + 'march_feature' : ['crypto'], > + 'machine_args': ['-mtune=tsv110'], > 'flags': [ > ['RTE_MACHINE', '"Kunpeng 920"'], > ['RTE_ARM_FEATURE_ATOMICS', true], > @@ -158,7 +160,9 @@ implementer_hisilicon = { > ] > }, > '0xd02': { > - 'machine_args': ['-march=armv8.2-a+crypto+sve'], > + 'march_base' : ['-march=armv8-a', '-march=armv8.2-a'], > + 'march_feature' : ['crypto', 'sve'], > + 'machine_args': [], > 'flags': [ > ['RTE_MACHINE', '"Kunpeng 930"'], > ['RTE_ARM_FEATURE_ATOMICS', true], > @@ -449,8 +453,27 @@ else > # add/overwrite flags in the proper order > dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags > > + # select the most suitable march+feature combination > + machine_march = [] > + if part_number_config.has_key('march_base') > + foreach arch: part_number_config['march_base'] > + if cc.has_argument(arch) > + machine_march = arch # Set the higher supported arch as possible > + endif > + endforeach > + endif > + if part_number_config.has_key('march_feature') > + foreach feature: part_number_config['march_feature'] > + tmp_machine_march = machine_march + '+' + feature > + if cc.has_argument(tmp_machine_march) > + machine_march = tmp_machine_march # Set the more supported feature as possible > + endif > + endforeach > + endif > + > # apply supported machine args > machine_args = [] # Clear previous machine args > + machine_args += machine_march > foreach flag: part_number_config['machine_args'] > if cc.has_argument(flag) > machine_args += flag > -- > 2.8.1 >