Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1568158pxb; Tue, 17 Aug 2021 15:19:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQb2gUDJltx+rFku5aN6cLyjTCUu5NSqxBIA6W8nddjn7fHxIb2oWxY5ayP6jr3zPE3EAu X-Received: by 2002:a05:6402:3193:: with SMTP id di19mr6350440edb.183.1629238784942; Tue, 17 Aug 2021 15:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629238784; cv=none; d=google.com; s=arc-20160816; b=oOCONetCCZfu8bO87VB6nqSH41RaOLNWqscYLDWkG7gUZ/+zLjFn+hhzTJnX6sh1Xu 7ZHXC2lk05JJvcSNB9wSOJhyq3RW88snbcfSfRE1PLoN+IPoeskopLpxdb5D+/dzYF6y a9ugb6RwJYX6Jgdxp6xwGHK3Lhq3QRxPBGQSBziuS1sz/09azE9ZUMQp9XwgFBkrHo3u 99y+dJynyjs4pp4VHTvlGu51Klcwf7GfxVB+0ulRwSN6GO03GN+rVThUDxyX75YSsaXL tQJR+ggQVjimNFHLXZH6J/p7Bmj+kEHtxr0Uk73NKu2zwZbd7QL+EUah4kcZiHoD27Qg KvWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mljevfVZg9W0PLYDtlwlbBEhr+6DfsuJN2uRRXLrTdA=; b=rRAbeYhKJpMMGf2jHbHe4wLsNifIBAvvist9npLbyrJYIzvJJstKu64DccphCA2t18 UqJxGkMBCiDpv8saIl3DIvVPkcvAY17w6zdBlXEsQ9poGjj1usHAmKRfs2ACtJ05QnUp 0DRauigMC9BagXerSTL2b9xXdgOgfxEhueiTAm5UrrXTlvoz8ibPyAK33eeGx0r533wJ ZbyL2xeeE98ZAtXmLkMUPFM8H/6JQnds959nNISUopxp+BN5MrFKsbsRED21KZnX0XcK ltOprNWPkwNQ15cc/+ZgQhk6Orj1I+nwwpyn9Mn3QKk/zk56N+8HYi1Bih2e21kQfuJ5 KZsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BlNQ0+OP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 16si3818729ejj.242.2021.08.17.15.19.21; Tue, 17 Aug 2021 15:19:44 -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=@google.com header.s=20161025 header.b=BlNQ0+OP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236318AbhHQWSP (ORCPT + 99 others); Tue, 17 Aug 2021 18:18:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235982AbhHQWSO (ORCPT ); Tue, 17 Aug 2021 18:18:14 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8C66C0613CF for ; Tue, 17 Aug 2021 15:17:40 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id n6so1297825ljp.9 for ; Tue, 17 Aug 2021 15:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mljevfVZg9W0PLYDtlwlbBEhr+6DfsuJN2uRRXLrTdA=; b=BlNQ0+OPM7VpucPeXAVKTheEGDOKJKISIjmvrHvb2xsF6E7cF0gr65rpm1HkTdmyCW /PaDVAFwU6CnZuYF4AkYyeDyIZ/V2qz5SIkjC8RUccrLzMU/PVRg0ktt4nQoP9fQvM7o F20nrp58qEjRG8/UWa23IdxKak2IZyhUSojIFHEx3YZSLFznUPqJ3e9WVu9MDGAxXuJD hRCDySvAnQKN1lxFLYWFk42iee1GeYWNJlXcgsbTJLnfURgt/Z7DIVtWj5Y5WvzdwA+m qyvlIQE7EcBL92a3HiAyYtA++E4hhFlZ/ckmwA9Vp+dXH6nt82gnFF3bW0MTKr0k9Xqp MibQ== 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=mljevfVZg9W0PLYDtlwlbBEhr+6DfsuJN2uRRXLrTdA=; b=GmsdXH12kLQplv5pIi40K2BAYOksNndmIVDgFnsCnBeBk44vqvsc5CSf5ODJvlX9T2 5pRoeEFli4dx8MxhlCrqRNKmDqPXYsT+7pvBezZJlXwm94t5MfLjphrsmFOHxmNB6ars EEcZAf6DM+Y6/RpKDbf6+nZ2yziY2BMbhgE9lYn4hllplrSQi6a2ktcreB/7zo9SjvYb kNkoYsojzXaE83cz+Q67bCrCPE/JosvkPfm3VdA3+8NuNQQj3jsCmvuuPbyfWAiEDIzq K4XHXi53eirS5rCCAt0xPMqxDqpxNjlgewQRrIOGv5AWtZBkcq70ZdZEK8dbCXJ5odCs vezQ== X-Gm-Message-State: AOAM5331tGhIkap0sbjV7TWQIJo3rDP1BA+aMkyCTs9bmLKRe+8olnir 1wQbp4mWEtxa87ffkk9cdgZd0SOPNW5sy4x4C2KmgA== X-Received: by 2002:a2e:a4d1:: with SMTP id p17mr5020868ljm.82.1629238658796; Tue, 17 Aug 2021 15:17:38 -0700 (PDT) MIME-Version: 1.0 References: <20210810190159.4103778-1-richardsonnick@google.com> <20210810190159.4103778-3-richardsonnick@google.com> In-Reply-To: From: Nick Richardson Date: Tue, 17 Aug 2021 18:17:23 -0400 Message-ID: Subject: Re: [PATCH v2 2/3] pktgen: Add imix distribution bins To: 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.