DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tummala, Sivaprasad" <Sivaprasad.Tummala@amd.com>
To: David Marchand <david.marchand@redhat.com>
Cc: "david.hunt@intel.com" <david.hunt@intel.com>,
	"anatoly.burakov@intel.com" <anatoly.burakov@intel.com>,
	"jerinj@marvell.com" <jerinj@marvell.com>,
	"radu.nicolau@intel.com" <radu.nicolau@intel.com>,
	"gakhil@marvell.com" <gakhil@marvell.com>,
	"cristian.dumitrescu@intel.com" <cristian.dumitrescu@intel.com>,
	"Yigit, Ferruh" <Ferruh.Yigit@amd.com>,
	"konstantin.ananyev@huawei.com" <konstantin.ananyev@huawei.com>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"mb@smartsharesystems.com" <mb@smartsharesystems.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v6 01/14] examples/l3fwd: fix queue ID restriction
Date: Mon, 25 Mar 2024 12:45:29 +0000	[thread overview]
Message-ID: <CH3PR12MB8233F6387264A4C7028ED7A786362@CH3PR12MB8233.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CAJFAV8ziPYp-BnE5k7j6CSh_LKJAQa0P50sKfMJTz7kfM+c09Q@mail.gmail.com>

[AMD Official Use Only - General]

Hi,

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, March 22, 2024 9:11 PM
> To: Tummala, Sivaprasad <Sivaprasad.Tummala@amd.com>
> Cc: david.hunt@intel.com; anatoly.burakov@intel.com; jerinj@marvell.com;
> radu.nicolau@intel.com; gakhil@marvell.com; cristian.dumitrescu@intel.com; Yigit,
> Ferruh <Ferruh.Yigit@amd.com>; konstantin.ananyev@huawei.com;
> stephen@networkplumber.org; mb@smartsharesystems.com;
> thomas@monjalon.net; dev@dpdk.org; stable@dpdk.org
> Subject: Re: [PATCH v6 01/14] examples/l3fwd: fix queue ID restriction
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hello,
>
> On Thu, Mar 21, 2024 at 7:48 PM Sivaprasad Tummala
> <sivaprasad.tummala@amd.com> wrote:
> >
> > Currently application supports queue IDs up to 255
>
> I think it only relates to Rx queue IDs.
>
> Before this patch, the Tx queue count is already stored as a uint32_t or uint16_t
> and checked against RTE_MAX_LCORE.
> So no limit on the Tx queue count side.
>
> Can you just adjust the commitlog accordingly?
OK
>
>
> (One may argue that the Tx queue count should be also checked against
> RTE_MAX_QUEUES_PER_PORT, but it is a separate issue to this patch and in
> practice, we probably always have RTE_MAX_QUEUES_PER_PORT >
> RTE_MAX_LCORE).
>
>
> > and max queues of 256 irrespective of device support.
> > This limits the number of active lcores to 256.
> >
> > The patch fixes these constraints by increasing the queue IDs to
> > support up to 65535.
>
> [snip]
>
> > diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c
> > index 401692bcec..2bd63181bc 100644
> > --- a/examples/l3fwd/l3fwd_acl.c
> > +++ b/examples/l3fwd/l3fwd_acl.c
> > @@ -997,7 +997,7 @@ acl_main_loop(__rte_unused void *dummy)
> >         uint64_t prev_tsc, diff_tsc, cur_tsc;
> >         int i, nb_rx;
> >         uint16_t portid;
> > -       uint8_t queueid;
> > +       uint16_t queueid;
> >         struct lcore_conf *qconf;
> >         int socketid;
> >         const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)
> > @@ -1020,7 +1020,7 @@ acl_main_loop(__rte_unused void *dummy)
> >                 portid = qconf->rx_queue_list[i].port_id;
> >                 queueid = qconf->rx_queue_list[i].queue_id;
> >                 RTE_LOG(INFO, L3FWD,
> > -                       " -- lcoreid=%u portid=%u rxqueueid=%hhu\n",
> > +                       " -- lcoreid=%u portid=%u rxqueueid=%hu\n",
>
> Nit: should be %PRIu16 (idem in other hunks formatting a queue).
OK
>
>
> >                         lcore_id, portid, queueid);
> >         }
> >
>
> [snip]
>
>
> > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index
> > 8d32ae1dd5..4d4738b92b 100644
> > --- a/examples/l3fwd/main.c
> > +++ b/examples/l3fwd/main.c
>
> [snip]
>
>
> > @@ -366,7 +366,7 @@ init_lcore_rx_queues(void)
> >                 nb_rx_queue = lcore_conf[lcore].n_rx_queue;
> >                 if (nb_rx_queue >= MAX_RX_QUEUE_PER_LCORE) {
> >                         printf("error: too many queues (%u) for lcore: %u\n",
> > -                               (unsigned)nb_rx_queue + 1, (unsigned)lcore);
> > +                               (unsigned int)nb_rx_queue + 1,
> > + (unsigned int)lcore);
>
> Nit: this does not seem related to the patch (probably a split issue, as a later patch
> touches this part of the code too).
Yes, this was done to avoid checkpatch error.
>
>
> >                         return -1;
> >                 } else {
> >
> > lcore_conf[lcore].rx_queue_list[nb_rx_queue].port_id = @@ -500,6 +500,8 @@
> parse_config(const char *q_arg)
> >         char *str_fld[_NUM_FLD];
> >         int i;
> >         unsigned size;
> > +       uint16_t max_fld[_NUM_FLD] = {USHRT_MAX,
> > +                               USHRT_MAX, UCHAR_MAX};
>
> Nit: no newline.
>
> This part validates user input for the rx queue used by a lcore.
> Some later check in the example (or in ethdev) may raise an error if requesting too
> many queues, but I think the limit here should be RTE_MAX_QUEUES_PER_PORT.
>
> Besides, this hunk also changes the check on max port and max lcore.
> This is something that should be left untouched at this point of the series.
>
> I would expect something like:
> uint16_t max_fld[_NUM_FLD] = {255, RTE_MAX_QUEUES_PER_PORT, 255};
I agree on the RTE_MAX_QUEUES_PER_PORT, but port_id is already uint16_t and
Hence USHRT_MAX is relevant and similarly UCHAR_MAX expands to 255.
>
>
> >
> >         nb_lcore_params = 0;
> >
> > @@ -518,7 +520,8 @@ parse_config(const char *q_arg)
> >                 for (i = 0; i < _NUM_FLD; i++){
> >                         errno = 0;
> >                         int_fld[i] = strtoul(str_fld[i], &end, 0);
> > -                       if (errno != 0 || end == str_fld[i] || int_fld[i] > 255)
> > +                       if (errno != 0 || end == str_fld[i] || int_fld[i] >
> > +
> > + max_fld[i])
>
> Nit: no newline.
OK
>
> >                                 return -1;
> >                 }
> >                 if (nb_lcore_params >= MAX_LCORE_PARAMS) {
>
> [snip]
>
>
> The other changes on the l3fwd example code in this series look good to me.
>
>
> Thanks.
>
> --
> David Marchand


  reply	other threads:[~2024-03-25 12:45 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18  7:49 [PATCH 1/6] examples/l3fwd: fix lcore " Sivaprasad Tummala
2023-12-18  7:49 ` [PATCH 2/6] examples/l3fwd-power: " Sivaprasad Tummala
2023-12-18  7:49 ` [PATCH 3/6] examples/l3fwd-graph: " Sivaprasad Tummala
2023-12-18  7:49 ` [PATCH 4/6] examples/ipsec-secgw: " Sivaprasad Tummala
2023-12-18  7:49 ` [PATCH 5/6] examples/qos_sched: " Sivaprasad Tummala
2023-12-18  7:49 ` [PATCH 6/6] examples/vm_power_manager: " Sivaprasad Tummala
2023-12-19  3:28 ` [PATCH v2 0/6] " Sivaprasad Tummala
2023-12-19  3:28   ` [PATCH v2 1/6] examples/l3fwd: " Sivaprasad Tummala
2023-12-19 12:05     ` Konstantin Ananyev
2023-12-19 12:30       ` Konstantin Ananyev
2023-12-19 14:18         ` Tummala, Sivaprasad
2023-12-19 15:10           ` Konstantin Ananyev
2023-12-20  1:32             ` Tummala, Sivaprasad
2023-12-19  3:28   ` [PATCH v2 2/6] examples/l3fwd-power: " Sivaprasad Tummala
2023-12-19  3:28   ` [PATCH v2 3/6] examples/l3fwd-graph: " Sivaprasad Tummala
2023-12-19  3:28   ` [PATCH v2 4/6] examples/ipsec-secgw: " Sivaprasad Tummala
2023-12-19 12:03     ` Konstantin Ananyev
2023-12-19  3:28   ` [PATCH v2 5/6] examples/qos_sched: " Sivaprasad Tummala
2023-12-19  3:28   ` [PATCH v2 6/6] examples/vm_power_manager: " Sivaprasad Tummala
2023-12-19  3:28   ` [PATCH v2 0/6] " Sivaprasad Tummala
2023-12-20  6:44   ` [PATCH v3 " Sivaprasad Tummala
2023-12-20  6:44     ` [PATCH v3 1/6] examples/l3fwd: " Sivaprasad Tummala
2023-12-20  6:44     ` [PATCH v3 2/6] examples/l3fwd-power: " Sivaprasad Tummala
2023-12-20  6:44     ` [PATCH v3 3/6] examples/l3fwd-graph: " Sivaprasad Tummala
2023-12-20  6:44     ` [PATCH v3 4/6] examples/ipsec-secgw: " Sivaprasad Tummala
2023-12-20  6:45     ` [PATCH v3 5/6] examples/qos_sched: " Sivaprasad Tummala
2023-12-20 16:31       ` Stephen Hemminger
2024-01-09 15:16         ` Ferruh Yigit
2024-01-16 12:33           ` Tummala, Sivaprasad
2024-01-16 16:28             ` Stephen Hemminger
2023-12-20  6:45     ` [PATCH v3 6/6] examples/vm_power_manager: " Sivaprasad Tummala
2023-12-20  6:45     ` [PATCH v3 0/6] " Sivaprasad Tummala
2024-01-16 18:23     ` [PATCH v4 " Sivaprasad Tummala
2024-01-16 18:23       ` [PATCH v4 1/6] examples/l3fwd: " Sivaprasad Tummala
2024-01-16 18:23       ` [PATCH v4 2/6] examples/l3fwd-power: " Sivaprasad Tummala
2024-01-16 18:23       ` [PATCH v4 3/6] examples/l3fwd-graph: " Sivaprasad Tummala
2024-01-16 18:23       ` [PATCH v4 4/6] examples/ipsec-secgw: " Sivaprasad Tummala
2024-01-16 18:23       ` [PATCH v4 5/6] examples/qos_sched: " Sivaprasad Tummala
2024-01-16 18:23       ` [PATCH v4 6/6] examples/vm_power_manager: " Sivaprasad Tummala
2024-01-16 18:23       ` [PATCH v4 0/6] " Sivaprasad Tummala
2024-03-18 17:31       ` [PATCH v5 " Sivaprasad Tummala
2024-03-18 17:31         ` [PATCH v5 1/6] examples/l3fwd: " Sivaprasad Tummala
2024-03-19  7:24           ` Morten Brørup
2024-03-21  9:55             ` Thomas Monjalon
2024-03-21 11:05               ` Tummala, Sivaprasad
2024-03-21 11:18                 ` Thomas Monjalon
2024-03-21 18:26                   ` Tummala, Sivaprasad
2024-03-21 11:05             ` Tummala, Sivaprasad
2024-03-18 17:31         ` [PATCH v5 2/6] examples/l3fwd-power: " Sivaprasad Tummala
2024-03-18 17:31         ` [PATCH v5 3/6] examples/l3fwd-graph: " Sivaprasad Tummala
2024-03-18 17:31         ` [PATCH v5 4/6] examples/ipsec-secgw: " Sivaprasad Tummala
2024-03-18 17:31         ` [PATCH v5 5/6] examples/qos_sched: " Sivaprasad Tummala
2024-03-18 17:31         ` [PATCH v5 6/6] examples/vm_power_manager: " Sivaprasad Tummala
2024-03-18 17:31         ` [PATCH v5 0/6] " Sivaprasad Tummala
2024-03-19 18:41         ` Ferruh Yigit
2024-03-21 18:47         ` [PATCH v6 00/10] " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 01/14] examples/l3fwd: fix queue " Sivaprasad Tummala
2024-03-22 15:41             ` David Marchand
2024-03-25 12:45               ` Tummala, Sivaprasad [this message]
2024-03-21 18:47           ` [PATCH v6 02/14] examples/l3fwd-power: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 03/14] examples/l3fwd-graph: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 04/14] examples/ipsec-secgw: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 05/14] examples/l3fwd: fix lcore " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 06/14] examples/l3fwd-power: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 07/14] examples/l3fwd-graph: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 08/14] examples/ipsec-secgw: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 09/14] examples/qos_sched: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 10/14] examples/vm_power_manager: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 11/14] examples/l3fwd: fix port " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 12/14] examples/l3fwd-power: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 13/14] examples/l3fwd-graph: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 14/14] examples/ipsec-secgw: " Sivaprasad Tummala
2024-03-21 18:47           ` [PATCH v6 00/10] fix lcore " Sivaprasad Tummala
2024-03-26 12:55           ` [PATCH v7 00/14] " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 01/14] examples/l3fwd: fix queue " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 02/14] examples/l3fwd-power: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 03/14] examples/l3fwd-graph: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 04/14] examples/ipsec-secgw: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 05/14] examples/l3fwd: fix lcore " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 06/14] examples/l3fwd-power: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 07/14] examples/l3fwd-graph: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 08/14] examples/ipsec-secgw: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 09/14] examples/qos_sched: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 10/14] examples/vm_power_manager: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 11/14] examples/l3fwd: fix port " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 12/14] examples/l3fwd-power: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 13/14] examples/l3fwd-graph: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 14/14] examples/ipsec-secgw: " Sivaprasad Tummala
2024-03-26 12:55             ` [PATCH v7 00/14] fix lcore " Sivaprasad Tummala
2024-04-25 12:31             ` Ferruh Yigit
2024-04-30 13:47               ` Ferruh Yigit
2024-03-07  8:34 ` [PATCH 1/6] examples/l3fwd: " David Marchand
2024-03-07  9:16   ` Morten Brørup
2024-03-07  9:22     ` David Marchand
2024-03-07  9:53       ` Morten Brørup
2024-03-13  9:14   ` Tummala, Sivaprasad

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=CH3PR12MB8233F6387264A4C7028ED7A786362@CH3PR12MB8233.namprd12.prod.outlook.com \
    --to=sivaprasad.tummala@amd.com \
    --cc=Ferruh.Yigit@amd.com \
    --cc=anatoly.burakov@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=david.hunt@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=konstantin.ananyev@huawei.com \
    --cc=mb@smartsharesystems.com \
    --cc=radu.nicolau@intel.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.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).