From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 6F0A854AE for ; Sat, 3 Nov 2018 11:53:36 +0100 (CET) Received: by mail-lj1-f196.google.com with SMTP id s15-v6so3907123lji.3 for ; Sat, 03 Nov 2018 03:53:36 -0700 (PDT) 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=FcytL0whTC+KtMBnnPPipKXdo8/IisHhpA/kSUAmxkY=; b=umdAuNXsvrWA1CYnsQEEmHfjbe4VwCaUuQ6WSxaxcAfd5byI6jggPZl+CVBApjC8ne ldReDUR3wMqBoJMarx+s/PIb3QBKT1icZEHe3XGbCYNrP6adIYYFfa4ED3WLfLtV4dSv oqpPb1OeN7qYuiLIVRPbtnYLfrDFHNasg2OeLDTiCcuRhp6jmq1JUPwb8IrYBhkv3wTX jomxGSM5huQzBlIsYIjhBRSYnYT9nxvHxXlDUSIqXmn28RgtoZ6yXiKkttg9o05dPLTH B27GzTGZk/+pIVwaHvwHCoqq7j+7W3qgd+DkaY8h2RMU++UmhYQSqkQWZaNGhG6VaeO3 A2IA== X-Gm-Message-State: AGRZ1gK0pPvAyc6NpubEBm5XMoHlrzbmzTa8HQ3Owoh0MuT6QgBUgr+J soSKL/NLszVsR3WwSCcsIiXhRpXLVIU= X-Google-Smtp-Source: AJdET5fQMuZvERQfZkcoDq98QfmtwEvYHiYRZlTfGfgTGpr7OVO9EKFW8rhjaj/JMDx+psJmdibaSA== X-Received: by 2002:a2e:9819:: with SMTP id a25-v6mr10663215ljj.6.1541242415486; Sat, 03 Nov 2018 03:53:35 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id o88sm2960244lfk.38.2018.11.03.03.53.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:53:34 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id f3-v6so3877359ljk.9 for ; Sat, 03 Nov 2018 03:53:34 -0700 (PDT) X-Received: by 2002:a2e:45d:: with SMTP id 90-v6mr9967724lje.110.1541242414051; Sat, 03 Nov 2018 03:53:34 -0700 (PDT) MIME-Version: 1.0 References: <1541144417-11169-1-git-send-email-phil.yang@arm.com> <1541155365.4849.14.camel@debian.org> In-Reply-To: From: Luca Boccassi Date: Sat, 3 Nov 2018 10:53:21 +0000 X-Gmail-Original-Message-ID: Message-ID: To: "Phil Yang (Arm Technology China)" Cc: dpdk stable Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH 16.11 1/3] app/testpmd: fix vdev socket initialization X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 10:53:36 -0000 On Sat, 3 Nov 2018, 10:10 Phil Yang (Arm Technology China) < Phil.Yang@arm.com wrote: > > -----Original Message----- > > From: Luca Boccassi > > Sent: Friday, November 2, 2018 6:43 PM > > To: Phil Yang (Arm Technology China) ; > stable@dpdk.org > > Subject: Re: [dpdk-stable] [PATCH 16.11 1/3] app/testpmd: fix vdev sock= et > > initialization > > > > On Fri, 2018-11-02 at 15:40 +0800, Phil Yang wrote: > > > [ backported from upstream commit > > > 29841336438400ce040e394c0c00040c21644727 ] > > > > > > The cmdline settings of port-numa-config and rxring-numa-config have > > > been flushed by the following init_config. If we don't configure the > > > port-numa-config, the virtual device will allocate the device ports t= o > > > socket 0. It will cause failure when the socket 0 is unavailable. > > > > > > eg: > > > testpmd -l --vdev net_pcap0,iface=3Dlo > > > --socket-mem=3D64 -- --numa --port-numa-config=3D"(0,1)" > > > --ring-numa-config=3D"(0,1,1),(0,2,1)" -i > > > > > > ... > > > Configuring Port 0 (socket 0) > > > Failed to setup RX queue:No mempool allocation on the socket 0 > > > EAL: Error - exiting with code: 1 > > > Cause: Start ports failed > > > > > > Fix by allocate the devices port to the first available socket or the > > > socket configured in port-numa-config. > > > > > > Fixes: 487f9a5 ("app/testpmd: fix NUMA structures initialization") > > > Fixes: 20a0286fd2c0 ("app/testpmd: check socket id validity") > > > > > > Signed-off-by: Phil Yang > > > Reviewed-by: Gavin Hu > > > Reviewed-by: Ferruh Yigit > > > --- > > > app/test-pmd/testpmd.c | 29 +++++++++++++++++------------ > > > 1 file changed, 17 insertions(+), 12 deletions(-) > > > > > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > > > c3ab448..8984d0b 100644 > > > --- a/app/test-pmd/testpmd.c > > > +++ b/app/test-pmd/testpmd.c > > > @@ -582,12 +582,6 @@ init_config(void) > > > > > > memset(port_per_socket,0,RTE_MAX_NUMA_NODES); > > > > > > -if (numa_support) { > > > -memset(port_numa, NUMA_NO_CONFIG, > > RTE_MAX_ETHPORTS); > > > -memset(rxring_numa, NUMA_NO_CONFIG, > > > RTE_MAX_ETHPORTS); > > > -memset(txring_numa, NUMA_NO_CONFIG, > > > RTE_MAX_ETHPORTS); > > > -} > > > - > > > /* Configuration of logical cores. */ > > > fwd_lcores =3D rte_zmalloc("testpmd: fwd_lcores", > > > sizeof(struct fwd_lcore *) * > > > nb_lcores, > > > @@ -617,9 +611,12 @@ init_config(void) > > > else { > > > uint32_t socket_id =3D > > > rte_eth_dev_socket_id(pid); > > > > > > -/* if socket_id is invalid, set to 0 > > > */ > > > +/* > > > + * if socket_id is invalid, > > > + * set to the first available > > > socket. > > > + */ > > > if (check_socket_id(socket_id) < 0) > > > -socket_id =3D 0; > > > +socket_id =3D socket_ids[0]; > > > port_per_socket[socket_id]++; > > > } > > > } > > > @@ -753,9 +750,12 @@ init_fwd_streams(void) > > > else { > > > port->socket_id =3D > > > rte_eth_dev_socket_id(pid); > > > > > > -/* if socket_id is invalid, set to 0 > > > */ > > > +/* > > > + * if socket_id is invalid, > > > + * set to the first available > > > socket. > > > + */ > > > if (check_socket_id(port->socket_id) < 0) > > > -port->socket_id =3D 0; > > > +port->socket_id =3D > > > socket_ids[0]; > > > } > > > } > > > else { > > > @@ -1774,9 +1774,9 @@ attach_port(char *identifier) > > > return; > > > > > > socket_id =3D (unsigned)rte_eth_dev_socket_id(pi); > > > -/* if socket_id is invalid, set to 0 */ > > > +/* if socket_id is invalid, set to the first available > > > socket. */ > > > if (check_socket_id(socket_id) < 0) > > > -socket_id =3D 0; > > > +socket_id =3D socket_ids[0]; > > > reconfig(pi, socket_id); > > > rte_eth_promiscuous_enable(pi); > > > > > > @@ -2325,6 +2325,11 @@ init_port(void) > > > "rte_zmalloc(%d struct rte_port) > > > failed\n", > > > RTE_MAX_ETHPORTS); > > > } > > > + > > > +/* Initialize ports NUMA structures */ > > > +memset(port_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); > > > +memset(rxring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); > > > +memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); > > > } > > > > > > static void > > > > Hi Phil, > > > > Thanks for sending the series, but I just tried to apply it and there's > conflicts in > > the first patch. Once solved, it fails to build: > > > > /home/bluca/git/dpdk/app/test-pmd/testpmd.c: In function =E2=80=98init_= config=E2=80=99: > > /home/bluca/git/dpdk/app/test-pmd/testpmd.c:537:18: error: =E2=80=98soc= ket_ids=E2=80=99 > > undeclared (first use in this function) > > socket_id =3D socket_ids[0]; > > ^~~~~~~~~~ > > /home/bluca/git/dpdk/app/test-pmd/testpmd.c:537:18: note: each undeclar= ed > > identifier is reported only once for each function it appears in > > /home/bluca/git/dpdk/app/test-pmd/testpmd.c: In function > =E2=80=98init_fwd_streams=E2=80=99: > > /home/bluca/git/dpdk/app/test-pmd/testpmd.c:652:24: error: =E2=80=98soc= ket_ids=E2=80=99 > > undeclared (first use in this function) > > port->socket_id =3D socket_ids[0]; > > ^~~~~~~~~~ > > /home/bluca/git/dpdk/app/test-pmd/testpmd.c: In function =E2=80=98attac= h_port=E2=80=99: > > /home/bluca/git/dpdk/app/test-pmd/testpmd.c:1604:15: error: =E2=80=98so= cket_ids=E2=80=99 > > undeclared (first use in this function) > > socket_id =3D socket_ids[0]; > > > > > > Have you tested this on the latest tip of 16.11? As a reminder, you can > get it > > from here: > > > > https://git.dpdk.org/dpdk-stable/log/?h=3D16.11 > > > > Hi Luca, > > It's my fault. I had put the patchset on the top of master branch. It is > workable on the latest tip of master. > > I think I need to rework these patches for 16.11 branch. > > Thanks for your reminder. > No problem, and if it's too much work it's also fine to skip this set entirely. Changes to testpmd are less urgent for an old release like 16.11. >