DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: "Wu, Jingjing" <jingjing.wu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Thomas Monjalon <thomas@monjalon.net>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: support non contiguous socket ids
Date: Mon, 8 May 2017 17:35:48 +0000	[thread overview]
Message-ID: <AM4PR05MB15051AB8F84C4E8C744A7B17C3EE0@AM4PR05MB1505.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <9BB6961774997848B5B42BEC655768F810D6383D@SHSMSX103.ccr.corp.intel.com>



--Shahaf


> -----Original Message-----
> From: Wu, Jingjing [mailto:jingjing.wu@intel.com]
> Sent: Monday, May 8, 2017 3:54 AM
> To: Shahaf Shuler <shahafs@mellanox.com>
> Cc: dev@dpdk.org; Thomas Monjalon <thomas@monjalon.net>;
> stable@dpdk.org
> Subject: RE: [PATCH v2] app/testpmd: support non contiguous socket ids
> 
> 
> 
> > -----Original Message-----
> > From: Shahaf Shuler [mailto:shahafs@mellanox.com]
> > Sent: Sunday, May 7, 2017 2:06 PM
> > To: Wu, Jingjing <jingjing.wu@intel.com>
> > Cc: dev@dpdk.org; Thomas Monjalon <thomas@monjalon.net>;
> > stable@dpdk.org
> > Subject: RE: [PATCH v2] app/testpmd: support non contiguous socket ids
> >
> > Saturday, May 6, 2017 4:41 AM, Wu, Jingjing:
> > > >
> > > > The test assumes the socket ids are contiguous. This is not
> > > > necessarily the case on all servers and may cause mempool creation to
> fail.
> > > >
> > > > Fixing it by detecting the list of valid socket ids and use it for
> > > > the mempool creation.
> > > >
> > > > Fixes: 7acf894d07d1 ("app/testpmd: detect numa socket count")
> > > >
> > > > CC: stable@dpdk.org
> > > > Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> > > > ---
> > > > on v2:
> > > >  * fix minor typo on commit message : be->by.
> > > > ---
> > > >  app/test-pmd/parameters.c | 38 ++++++++++++++++++++++++++++-
> ----
> > > -----
> > > >  app/test-pmd/testpmd.c    | 38 +++++++++++++++++++++++++++++-
> -----
> > > ---
> > > >  app/test-pmd/testpmd.h    |  4 +++-
> > > >  3 files changed, 60 insertions(+), 20 deletions(-)
> > > >
> >
> > [..]
> >
> > > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > > > dfe64427d..a556a8aff 100644
> > > > --- a/app/test-pmd/testpmd.c
> > > > +++ b/app/test-pmd/testpmd.c
> >
> > [..]
> >
> > > > +/*
> > > >   * Setup default configuration.
> > > >   */
> > > >  static void
> > > > @@ -388,12 +405,14 @@ set_default_fwd_lcores_config(void)
> > > >
> > > >  	nb_lc = 0;
> > > >  	for (i = 0; i < RTE_MAX_LCORE; i++) {
> > > > -		sock_num = rte_lcore_to_socket_id(i) + 1;
> > > > -		if (sock_num > max_socket) {
> > > > -			if (sock_num > RTE_MAX_NUMA_NODES)
> > > > -				rte_exit(EXIT_FAILURE, "Total sockets
> > > greater
> > > > than %u\n", RTE_MAX_NUMA_NODES);
> > > > -			max_socket = sock_num;
> > > > +		sock_num = rte_lcore_to_socket_id(i);
> > > +1 is missed?
> >
> > I don't think so.
> > On previous implementation this logic was meant to find the max_socket.
> > max_socket was the first invalid socket_id and was used, for example :
> >
> > if (socket_id >= max_socket) {
> >
> > or
> >
> > for (i = 0; i < max_socket; i++)
> >
> > now, on above logic, we list the valid socket id. Therefore
> > rte_lcore_to_socket_id return a valid id and not need to add 1.
> >
> >
> OK, but at list the following check "if (sock_num >
> RTE_MAX_NUMA_NODES)"
> Should be "if (sock_num +1 > RTE_MAX_NUMA_NODES)", right?
> 

Right, i prefer the following though, what do you think?

       for (i = 0; i < RTE_MAX_LCORE; i++) {
                sock_num = rte_lcore_to_socket_id(i);
                if (new_socket_id(sock_num)) {
                        if (num_sockets >= RTE_MAX_NUMA_NODES) {
                                rte_exit(EXIT_FAILURE,
                                         "Total sockets greater than %u\n",
                                         RTE_MAX_NUMA_NODES);
                        }
                        socket_ids[num_sockets++] = sock_num;
                }

> One more thing, if this patch is fixing a bug, I think "fix" should be added in
> title.

OK, I guess I can change the commit title and message.

BTW note that there is a V3 with Thomas requested changes.
If we agree on above I can submit a v4 with the last updates.


> 
> Thanks
> Jingjing

  reply	other threads:[~2017-05-08 17:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 13:44 Shahaf Shuler
2017-05-06  1:41 ` Wu, Jingjing
2017-05-07  6:06   ` Shahaf Shuler
2017-05-08  0:54     ` Wu, Jingjing
2017-05-08 17:35       ` Shahaf Shuler [this message]
2017-05-09  0:43         ` Wu, Jingjing
2017-05-07 12:14 ` Thomas Monjalon
2017-05-07 13:05 ` [dpdk-dev] [PATCH v3] " Shahaf Shuler
2017-05-09  7:28   ` [dpdk-dev] [PATCH v4] app/testpmd: fix mempool creation by socket id Shahaf Shuler
2017-05-09  8:54     ` Wu, Jingjing
2017-05-10 16:41       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM4PR05MB15051AB8F84C4E8C744A7B17C3EE0@AM4PR05MB1505.eurprd05.prod.outlook.com \
    --to=shahafs@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).