Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1573611pxb; Tue, 17 Aug 2021 15:29:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqGrHRhBJWJanByy0KBjgYdM1J+jUFJmQcPWCW8qUwvknTzOhrtRzKceMqkUzwZc5EIleT X-Received: by 2002:a05:6402:358d:: with SMTP id y13mr6449804edc.300.1629239362142; Tue, 17 Aug 2021 15:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629239362; cv=none; d=google.com; s=arc-20160816; b=R5+Kz57hNPqmgXhHv6kppkonJtEzsCpfvIwJhARdmiXEm19EY10MW50EPbUNfyPgLI 0Vt4Ki2kqoarm4v+1dlafL1wu4Nsu4pmFdX9Y+Z0I1xA4cvzbgFM+ozEHCQSW8Z67rYh mtGe81MLbdFlcg4OF0GLGjY6JTuS3HikIFywPObRsOQIqIq5/ahhghTE7FmV+u6Mn4HW SgSEsV39HGjRKzwM2Pi2UjblnozMA8FMT5lP1XjXck9exNBApF2GQ+08u7Gx5MBPkprP avDTwkVvW5EOxHW9d8t3MyYHJph9+pHpmdEeNjkIYoPPG7zv8k4PpYowgjMDHTS7GGqU O/qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=5eoxbckACJ/GEMUblhfIQtDZ3EWIDalzeNDzAJBJQ4o=; b=AEPh18NoicXU9jHG7NrZCb3s0t107GrYluwFZ5SVlnkum3YXiXW9fySlKcIieBCA1P ymy/4PEWo1ZXO5/v9kZYOyZ9CqjGPQpDkIAviDKXKqezo3rMn7q71qGbsgCz0XGlx10u HXrNK2E8KKGRaMwwQbVhSeqOdVV8GHOh9hnmDjclXg6XhxJhzr2hWhEf2vchRPEsOVp9 NWQYXFJQLR3UigoZJVWphnT67RAyiQXIdgutUUniY/knjT1TAg5uSMIfPJ8wkHLDyX9i 9+AN5/rZh8/2w8Sry2vx2L5N0WFdjTpGQ+xbnBZKVzGdiOMY2dL0BRBJfxcQ8uCl06KD /hNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ptVsGcNw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k24si3621108edv.610.2021.08.17.15.28.58; Tue, 17 Aug 2021 15:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ptVsGcNw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234809AbhHQW1q (ORCPT + 99 others); Tue, 17 Aug 2021 18:27:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:54406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232453AbhHQW1p (ORCPT ); Tue, 17 Aug 2021 18:27:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CFB82604AC; Tue, 17 Aug 2021 22:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629239232; bh=yL+zHAtB3UEw3Ksld7rKWAvgYILgcAm9dclgUnd/MPA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ptVsGcNwnfOKkV5zz3+yKmAtZbByihq56gC4pKkihsGXYu8bELFnd95+CCXtrROVD F6m7vC0rFxYoBXfzmvjsTHSsmgxGot+/zQbPtYKPMc5goZDsRpouiimE0I3a6XPt+O Pdw06aSMUa6SQZwFR/M5Xlfkw5EkJXLYBDuLqAGHQ0DZFc7uh6kPgZT7CPVIPmZf0s YEViBlQXN28m8W7cFDUH9q/mYXlu9qJEfxZDkwcHRlGnx4svtCqI7Nx2RqUeQqc6Q7 dYEQGGf1JaYR7lnoyRawv/W6CEiLmm8zccXOfz8EF3RYxNDAsSLK9gJKCyOpJZxdpP 6nO76UKSJiEVg== Subject: Re: [PATCH v2 2/3] pktgen: Add imix distribution bins To: Nick Richardson , Naresh Kamboju Cc: "David S. Miller" , Jakub Kicinski , nrrichar@ncsu.edu, Philip Romanov , Arun Kalyanasundaram , "Gustavo A. R. Silva" , Di Zhu , Leesoo Ahn , Ye Bin , Yejune Deng , Netdev , open list , Linux-Next Mailing List , lkft-triage@lists.linaro.org, Mark Brown , Stephen Rothwell References: <20210810190159.4103778-1-richardsonnick@google.com> <20210810190159.4103778-3-richardsonnick@google.com> From: Nathan Chancellor Message-ID: <4135e426-5a6f-c36a-d048-382c07f16b0a@kernel.org> Date: Tue, 17 Aug 2021 15:27:09 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/17/2021 3:17 PM, Nick Richardson wrote: > On Wed, 11 Aug 2021 at 00:32, Nicholas Richardson > wrote: >> >> From: Nick Richardson >> >> In order to represent the distribution of imix packet sizes, a >> pre-computed data structure is used. It features 100 (IMIX_PRECISION) >> "bins". Contiguous ranges of these bins represent the respective >> packet size of each imix entry. This is done to avoid the overhead of >> selecting the correct imix packet size based on the corresponding weights. >> >> Example: >> imix_weights 40,7 576,4 1500,1 >> total_weight = 7 + 4 + 1 = 12 >> >> pkt_size 40 occurs 7/total_weight = 58% of the time >> pkt_size 576 occurs 4/total_weight = 33% of the time >> pkt_size 1500 occurs 1/total_weight = 9% of the time >> >> We generate a random number between 0-100 and select the corresponding >> packet size based on the specified weights. >> Eg. random number = 358723895 % 100 = 65 >> Selects the packet size corresponding to index:65 in the pre-computed >> imix_distribution array. >> An example of the pre-computed array is below: >> >> The imix_distribution will look like the following: >> 0 -> 0 (index of imix_entry.size == 40) >> 1 -> 0 (index of imix_entry.size == 40) >> 2 -> 0 (index of imix_entry.size == 40) >> [...] -> 0 (index of imix_entry.size == 40) >> 57 -> 0 (index of imix_entry.size == 40) >> 58 -> 1 (index of imix_entry.size == 576) >> [...] -> 1 (index of imix_entry.size == 576) >> 90 -> 1 (index of imix_entry.size == 576) >> 91 -> 2 (index of imix_entry.size == 1500) >> [...] -> 2 (index of imix_entry.size == 1500) >> 99 -> 2 (index of imix_entry.size == 1500) >> >> Create and use "bin" representation of the imix distribution. >> >> Signed-off-by: Nick Richardson >> --- >> net/core/pktgen.c | 41 +++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 41 insertions(+) >> >> diff --git a/net/core/pktgen.c b/net/core/pktgen.c >> index a7e45eaccef7..ac1de15000e2 100644 >> --- a/net/core/pktgen.c >> +++ b/net/core/pktgen.c >> @@ -177,6 +177,7 @@ >> #define MPLS_STACK_BOTTOM htonl(0x00000100) >> /* Max number of internet mix entries that can be specified in imix_weights. */ >> #define MAX_IMIX_ENTRIES 20 >> +#define IMIX_PRECISION 100 /* Precision of IMIX distribution */ >> >> #define func_enter() pr_debug("entering %s\n", __func__); >> >> @@ -354,6 +355,8 @@ struct pktgen_dev { >> /* IMIX */ >> unsigned int n_imix_entries; >> struct imix_pkt imix_entries[MAX_IMIX_ENTRIES]; >> + /* Maps 0-IMIX_PRECISION range to imix_entry based on probability*/ >> + __u8 imix_distribution[IMIX_PRECISION]; >> >> /* MPLS */ >> unsigned int nr_labels; /* Depth of stack, 0 = no MPLS */ >> @@ -483,6 +486,7 @@ static void pktgen_stop_all_threads(struct pktgen_net *pn); >> >> static void pktgen_stop(struct pktgen_thread *t); >> static void pktgen_clear_counters(struct pktgen_dev *pkt_dev); >> +static void fill_imix_distribution(struct pktgen_dev *pkt_dev); > > Linux next 20210813 tag arm builds failed due to following build errors. > > Regressions found on arm: > > - build/gcc-10-ixp4xx_defconfig > - build/gcc-10-orion5x_defconfig > - build/gcc-10-multi_v5_defconfig > > net/core/pktgen.c:489:13: warning: 'fill_imix_distribution' used but > never defined > static void fill_imix_distribution(struct pktgen_dev *pkt_dev); > ^~~~~~~~~~~~~~~~~~~~~~ > ERROR: modpost: "fill_imix_distribution" [net/core/pktgen.ko] undefined! > make[2]: *** [scripts/Makefile.modpost:150: modules-only.symvers] Error 1 > make[2]: *** Deleting file 'modules-only.symvers' > make[2]: Target '__modpost' not remade because of errors. > make[1]: *** [Makefile:1918: modules] Error 2 > > Reported-by: Linux Kernel Functional Testing > > Steps to reproduce: > > # TuxMake is a command line tool and Python library that provides > # portable and repeatable Linux kernel builds across a variety of > # architectures, toolchains, kernel configurations, and make targets. > # > # TuxMake supports the concept of runtimes. > # See https://docs.tuxmake.org/runtimes/, for that to work it requires > # that you install podman or docker on your system. > # > # To install tuxmake on your system globally: > # sudo pip3 install -U tuxmake > # > # See https://docs.tuxmake.org/ for complete documentation. > > tuxmake --runtime podman --target-arch arm --toolchain gcc-10 > --kconfig orion5x_defconfig > > > On Sat, Aug 14, 2021 at 1:13 AM Naresh Kamboju > wrote: >> >> On Wed, 11 Aug 2021 at 00:32, Nicholas Richardson >> wrote: >>> >>> From: Nick Richardson >>> >>> In order to represent the distribution of imix packet sizes, a >>> pre-computed data structure is used. It features 100 (IMIX_PRECISION) >>> "bins". Contiguous ranges of these bins represent the respective >>> packet size of each imix entry. This is done to avoid the overhead of >>> selecting the correct imix packet size based on the corresponding weights. >>> >>> Example: >>> imix_weights 40,7 576,4 1500,1 >>> total_weight = 7 + 4 + 1 = 12 >>> >>> pkt_size 40 occurs 7/total_weight = 58% of the time >>> pkt_size 576 occurs 4/total_weight = 33% of the time >>> pkt_size 1500 occurs 1/total_weight = 9% of the time >>> >>> We generate a random number between 0-100 and select the corresponding >>> packet size based on the specified weights. >>> Eg. random number = 358723895 % 100 = 65 >>> Selects the packet size corresponding to index:65 in the pre-computed >>> imix_distribution array. >>> An example of the pre-computed array is below: >>> >>> The imix_distribution will look like the following: >>> 0 -> 0 (index of imix_entry.size == 40) >>> 1 -> 0 (index of imix_entry.size == 40) >>> 2 -> 0 (index of imix_entry.size == 40) >>> [...] -> 0 (index of imix_entry.size == 40) >>> 57 -> 0 (index of imix_entry.size == 40) >>> 58 -> 1 (index of imix_entry.size == 576) >>> [...] -> 1 (index of imix_entry.size == 576) >>> 90 -> 1 (index of imix_entry.size == 576) >>> 91 -> 2 (index of imix_entry.size == 1500) >>> [...] -> 2 (index of imix_entry.size == 1500) >>> 99 -> 2 (index of imix_entry.size == 1500) >>> >>> Create and use "bin" representation of the imix distribution. >>> >>> Signed-off-by: Nick Richardson >>> --- >>> net/core/pktgen.c | 41 +++++++++++++++++++++++++++++++++++++++++ >>> 1 file changed, 41 insertions(+) >>> >>> diff --git a/net/core/pktgen.c b/net/core/pktgen.c >>> index a7e45eaccef7..ac1de15000e2 100644 >>> --- a/net/core/pktgen.c >>> +++ b/net/core/pktgen.c >>> @@ -177,6 +177,7 @@ >>> #define MPLS_STACK_BOTTOM htonl(0x00000100) >>> /* Max number of internet mix entries that can be specified in imix_weights. */ >>> #define MAX_IMIX_ENTRIES 20 >>> +#define IMIX_PRECISION 100 /* Precision of IMIX distribution */ >>> >>> #define func_enter() pr_debug("entering %s\n", __func__); >>> >>> @@ -354,6 +355,8 @@ struct pktgen_dev { >>> /* IMIX */ >>> unsigned int n_imix_entries; >>> struct imix_pkt imix_entries[MAX_IMIX_ENTRIES]; >>> + /* Maps 0-IMIX_PRECISION range to imix_entry based on probability*/ >>> + __u8 imix_distribution[IMIX_PRECISION]; >>> >>> /* MPLS */ >>> unsigned int nr_labels; /* Depth of stack, 0 = no MPLS */ >>> @@ -483,6 +486,7 @@ static void pktgen_stop_all_threads(struct pktgen_net *pn); >>> >>> static void pktgen_stop(struct pktgen_thread *t); >>> static void pktgen_clear_counters(struct pktgen_dev *pkt_dev); >>> +static void fill_imix_distribution(struct pktgen_dev *pkt_dev); >> >> Linux next 20210813 tag arm builds failed due to following build errors. >> >> Regressions found on arm: >> >> - build/gcc-10-ixp4xx_defconfig >> - build/gcc-10-orion5x_defconfig >> - build/gcc-10-multi_v5_defconfig >> >> net/core/pktgen.c:489:13: warning: 'fill_imix_distribution' used but >> never defined >> static void fill_imix_distribution(struct pktgen_dev *pkt_dev); >> ^~~~~~~~~~~~~~~~~~~~~~ >> ERROR: modpost: "fill_imix_distribution" [net/core/pktgen.ko] undefined! >> make[2]: *** [scripts/Makefile.modpost:150: modules-only.symvers] Error 1 >> make[2]: *** Deleting file 'modules-only.symvers' >> make[2]: Target '__modpost' not remade because of errors. >> make[1]: *** [Makefile:1918: modules] Error 2 >> >> Reported-by: Linux Kernel Functional Testing >> >> Steps to reproduce: >> >> # TuxMake is a command line tool and Python library that provides >> # portable and repeatable Linux kernel builds across a variety of >> # architectures, toolchains, kernel configurations, and make targets. >> # >> # TuxMake supports the concept of runtimes. >> # See https://docs.tuxmake.org/runtimes/, for that to work it requires >> # that you install podman or docker on your system. >> # >> # To install tuxmake on your system globally: >> # sudo pip3 install -U tuxmake >> # >> # See https://docs.tuxmake.org/ for complete documentation. >> >> tuxmake --runtime podman --target-arch arm --toolchain gcc-10 >> --kconfig orion5x_defconfig >> >> -- >> Linaro LKFT >> https://lkft.linaro.org > > Thanks for the reply Naresh. Do you have any ideas on how to resolve > this error? Pktgen already defines a couple of function prototypes > before they are declared and that seems to be the cause of this error > message. The problem is that you declare and use fill_imix_distribution() unconditionally in the file but fill_imix_distribution() is only defined if CONFIG_XFRM is set, resulting in this error if CONFIG_XFRM is not set. Should fill_imix_distribution() be moved out of that block or does it truly depend on CONFIG_XFRM? If it does, should the use of fill_imix_distribution() be guarded by CONFIG_XFRM as well? Cheers, Nathan