From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CAF843D0E; Fri, 22 Mar 2024 16:41:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1AA9402D4; Fri, 22 Mar 2024 16:41:29 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id EE87F40284 for ; Fri, 22 Mar 2024 16:41:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711122087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KngvMDgVY86v/mrZokQrJ6LBtp3xZqZy7XmpZhqG2jA=; b=P7uiuxgq4EjHz89bmPcJEINEByuPezrnDx0fZfNgE67h/oaBhU/A4x9isrQibOg0rLW38E ebGQcXrWOtagU3CDFhSTrXmdKIJ+3HxZHvmp2VP++LKxwCjnYomyvbQ26T0LbdZD1Hf6z+ +rTdTgQ+QNy48XWFOSDFp8xdOAA8HgM= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-RXXXnluoNtS5zfxQdvFvUA-1; Fri, 22 Mar 2024 11:41:25 -0400 X-MC-Unique: RXXXnluoNtS5zfxQdvFvUA-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2d6b5ac2537so4824641fa.0 for ; Fri, 22 Mar 2024 08:41:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122084; x=1711726884; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KngvMDgVY86v/mrZokQrJ6LBtp3xZqZy7XmpZhqG2jA=; b=LTqoICQroWQtfNMY3cvHu1rwUIwrATK41I1I++FYL6HjOSmSdtLAoQKYWGfVS3DWLL RYhpRClNbNzfVgOg47PyCuN/Bcah9mqde63XFJGTcSsFaed6BXeVnXiZzet7g1P2fKC2 Pd0vLwP3jE0xSvEc24S6qFz0HRM30Oqj45fLmTATYgYt8nuaTyTsNZw0AZMC2bpr2NGD qCk+inkbh+cBsDxW8Z6cLXuLH/nv3g5LNh5tFAYYO4Ky9q/NoXDfjzvqDExY/oII44h9 Zs7wF7RzXehftoSbKmOB9hs9H9pKuF51pwxP+3ICV/r2z3CsQM1SNOrYU7dgqAamx3Hz iBbw== X-Forwarded-Encrypted: i=1; AJvYcCXSf2gBiAb0jRp5Ad0AG17dv17gVDYBt+NoNc6EakssfaFf8EWnzGWnNNwpXK1IwxbPgbSH+UFt5W9TCwQ= X-Gm-Message-State: AOJu0YyroeHGNFcMaK5gn0UpllNcKczo8Dnrjuv0yKlreXgDo0ILBFjG fO9WME4gTeIJ2Z80HTocntJNsVQ0sW9jGsb1Wr/IuqRr+aOX5p5ziVOcb8DHMPGEDjtWm6a97mS LyhkgPXLJD4ukgEBWyHLHBC7UHKQGypyepSwqOXb3v0PdP4Faf1GgmdA7FVaMeWBAa01A3okN7g t8vDT9u43PxepOY2w= X-Received: by 2002:a2e:b010:0:b0:2d5:9703:263f with SMTP id y16-20020a2eb010000000b002d59703263fmr1933177ljk.44.1711122083939; Fri, 22 Mar 2024 08:41:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaPzZOf16c9uJte8PwfoMlQf+U8pIpWLQU0vxXdX6kugadjhRkIzCMwSVZGdCvvNo0IjnpSlaK4dacDyR0SBg= X-Received: by 2002:a2e:b010:0:b0:2d5:9703:263f with SMTP id y16-20020a2eb010000000b002d59703263fmr1933155ljk.44.1711122083596; Fri, 22 Mar 2024 08:41:23 -0700 (PDT) MIME-Version: 1.0 References: <20240318173146.24303-1-sivaprasad.tummala@amd.com> <20240321184721.69040-1-sivaprasad.tummala@amd.com> <20240321184721.69040-2-sivaprasad.tummala@amd.com> In-Reply-To: <20240321184721.69040-2-sivaprasad.tummala@amd.com> From: David Marchand Date: Fri, 22 Mar 2024 16:41:11 +0100 Message-ID: Subject: Re: [PATCH v6 01/14] examples/l3fwd: fix queue ID restriction To: Sivaprasad Tummala Cc: david.hunt@intel.com, anatoly.burakov@intel.com, jerinj@marvell.com, radu.nicolau@intel.com, gakhil@marvell.com, cristian.dumitrescu@intel.com, ferruh.yigit@amd.com, konstantin.ananyev@huawei.com, stephen@networkplumber.org, mb@smartsharesystems.com, thomas@monjalon.net, dev@dpdk.org, stable@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hello, On Thu, Mar 21, 2024 at 7:48=E2=80=AFPM Sivaprasad Tummala 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? (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 =3D (rte_get_tsc_hz() + US_PER_S - 1) > @@ -1020,7 +1020,7 @@ acl_main_loop(__rte_unused void *dummy) > portid =3D qconf->rx_queue_list[i].port_id; > queueid =3D qconf->rx_queue_list[i].queue_id; > RTE_LOG(INFO, L3FWD, > - " -- lcoreid=3D%u portid=3D%u rxqueueid=3D%hhu\n"= , > + " -- lcoreid=3D%u portid=3D%u rxqueueid=3D%hu\n", Nit: should be %PRIu16 (idem in other hunks formatting a queue). > 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 =3D lcore_conf[lcore].n_rx_queue; > if (nb_rx_queue >=3D MAX_RX_QUEUE_PER_LCORE) { > printf("error: too many queues (%u) for lcore: %u= \n", > - (unsigned)nb_rx_queue + 1, (unsigned)lcor= e); > + (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). > return -1; > } else { > lcore_conf[lcore].rx_queue_list[nb_rx_queue].port= _id =3D > @@ -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] =3D {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] =3D {255, RTE_MAX_QUEUES_PER_PORT, 255}; > > nb_lcore_params =3D 0; > > @@ -518,7 +520,8 @@ parse_config(const char *q_arg) > for (i =3D 0; i < _NUM_FLD; i++){ > errno =3D 0; > int_fld[i] =3D strtoul(str_fld[i], &end, 0); > - if (errno !=3D 0 || end =3D=3D str_fld[i] || int_= fld[i] > 255) > + if (errno !=3D 0 || end =3D=3D str_fld[i] || int_= fld[i] > > + m= ax_fld[i]) Nit: no newline. > return -1; > } > if (nb_lcore_params >=3D MAX_LCORE_PARAMS) { [snip] The other changes on the l3fwd example code in this series look good to me. Thanks. --=20 David Marchand