From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 7D5131B21A for ; Fri, 2 Nov 2018 11:42:48 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id d10-v6so1494440wrs.5 for ; Fri, 02 Nov 2018 03:42:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=UYdwEkR+sVaycZpURwtfkCz4vMjSZOX/5IvvFVMxbhY=; b=AO6zd1XLaEmGCWKBwW+7wm6jg8RwIVAX75DO+TARq4rgA5e+E6cZEQzsqYo2jst9RB rlLMLGPd3CFkPUer2VVLHnhz0ixyI4Qri5+vHCemXRxtskd2ww6tkT8TSwOoDcdIHvPS kI/1v2TcN3WK0VtYa+QzdWZk9ElhuJmIVHxBaF7vLinVJ9vLudiEv/xhRY1bWAtTYFwd /+kOJDAQCQRZGF2GirmIinHKCBKvVTdVEGugZSVigtLJYbhnu85jm7yKXReaPI2eDOBc BU1SvC6L0Y+Slj0IbXCfTmO5Oz1MClETiqGAymGcxWPlHFm91b+wRoTue5RtmdvSUqU2 zxHw== X-Gm-Message-State: AGRZ1gLtJS9ooX2CfpMDSBkBjRb5V6aqvQQUn/p5+6GyQu1cRqe0okLG 42Ox8LQmgZlLDu+8gs18ZvI= X-Google-Smtp-Source: AJdET5eLyIc60Q1x10QQRL3RPaDmyBBJuEajN4BmI1UkUFfJcXoGr9FuxKnnSMWpMSabDnv4EUzIqg== X-Received: by 2002:a5d:4e01:: with SMTP id p1-v6mr10182342wrt.320.1541155367972; Fri, 02 Nov 2018 03:42:47 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id x197-v6sm33817351wme.15.2018.11.02.03.42.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 03:42:46 -0700 (PDT) Message-ID: <1541155365.4849.14.camel@debian.org> From: Luca Boccassi To: Phil Yang , stable@dpdk.org Date: Fri, 02 Nov 2018 10:42:45 +0000 In-Reply-To: <1541144417-11169-1-git-send-email-phil.yang@arm.com> References: <1541144417-11169-1-git-send-email-phil.yang@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 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: Fri, 02 Nov 2018 10:42:48 -0000 On Fri, 2018-11-02 at 15:40 +0800, Phil Yang wrote: > [ backported from upstream commit > 29841336438400ce040e394c0c00040c21644727 ] >=20 > 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 > to > socket 0. It will cause failure when the socket 0 is unavailable. >=20 > 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 >=20 > ... > Configuring Port 0 (socket 0) > Failed to setup RX queue:No mempool allocation on the socket 0 > EAL: Error - exiting with code: 1 > =C2=A0 Cause: Start ports failed >=20 > Fix by allocate the devices port to the first available socket or the > socket configured in port-numa-config. >=20 > Fixes: 487f9a5 ("app/testpmd: fix NUMA structures initialization") > Fixes: 20a0286fd2c0 ("app/testpmd: check socket id validity") >=20 > Signed-off-by: Phil Yang > Reviewed-by: Gavin Hu > Reviewed-by: Ferruh Yigit > --- > =C2=A0app/test-pmd/testpmd.c | 29 +++++++++++++++++------------ > =C2=A01 file changed, 17 insertions(+), 12 deletions(-) >=20 > 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) > =C2=A0 > =C2=A0 memset(port_per_socket,0,RTE_MAX_NUMA_NODES); > =C2=A0 > - 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); > - } > - > =C2=A0 /* Configuration of logical cores. */ > =C2=A0 fwd_lcores =3D rte_zmalloc("testpmd: fwd_lcores", > =C2=A0 sizeof(struct fwd_lcore *) * > nb_lcores, > @@ -617,9 +611,12 @@ init_config(void) > =C2=A0 else { > =C2=A0 uint32_t socket_id =3D > rte_eth_dev_socket_id(pid); > =C2=A0 > - /* if socket_id is invalid, set to 0 > */ > + /* > + =C2=A0* if socket_id is invalid, > + =C2=A0* set to the first available > socket. > + =C2=A0*/ > =C2=A0 if (check_socket_id(socket_id) < 0) > - socket_id =3D 0; > + socket_id =3D socket_ids[0]; > =C2=A0 port_per_socket[socket_id]++; > =C2=A0 } > =C2=A0 } > @@ -753,9 +750,12 @@ init_fwd_streams(void) > =C2=A0 else { > =C2=A0 port->socket_id =3D > rte_eth_dev_socket_id(pid); > =C2=A0 > - /* if socket_id is invalid, set to 0 > */ > + /* > + =C2=A0* if socket_id is invalid, > + =C2=A0* set to the first available > socket. > + =C2=A0*/ > =C2=A0 if (check_socket_id(port->socket_id)=20 > < 0) > - port->socket_id =3D 0; > + port->socket_id =3D > socket_ids[0]; > =C2=A0 } > =C2=A0 } > =C2=A0 else { > @@ -1774,9 +1774,9 @@ attach_port(char *identifier) > =C2=A0 return; > =C2=A0 > =C2=A0 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. */ > =C2=A0 if (check_socket_id(socket_id) < 0) > - socket_id =3D 0; > + socket_id =3D socket_ids[0]; > =C2=A0 reconfig(pi, socket_id); > =C2=A0 rte_eth_promiscuous_enable(pi); > =C2=A0 > @@ -2325,6 +2325,11 @@ init_port(void) > =C2=A0 "rte_zmalloc(%d struct rte_port) > failed\n", > =C2=A0 RTE_MAX_ETHPORTS); > =C2=A0 } > + > + /* 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); > =C2=A0} > =C2=A0 > =C2=A0static 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_conf= ig=E2=80=99: /home/bluca/git/dpdk/app/test-pmd/testpmd.c:537:18: error: =E2=80=98socket_= 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 undeclared i= dentifier 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=98socket_= 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=98attach_po= rt=E2=80=99: /home/bluca/git/dpdk/app/test-pmd/testpmd.c:1604:15: error: =E2=80=98socket= _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 --=20 Kind regards, Luca Boccassi