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 13F8B43D21 for ; Fri, 22 Mar 2024 16:41:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0592D42EA1; Fri, 22 Mar 2024 16:41:31 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 9652840284 for ; Fri, 22 Mar 2024 16:41:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711122089; 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=DVI3gtCK++oe6jQ9aDWG34VyyvZjAxWdItwubCplgVCIISW1CBa6AJhU2fg7xkvolW9f20 uUQYvbngtp5DdqX35toPtxdL1dQfCZra5aiuUR1gAiw2DDRSTuVPU3JO/rYTiy+eSLEIYP RQkBgT125PRje2ktHkqhXF6J4kHOMpo= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-18-CRirIJJjO8e04NNNZtAxrg-1; Fri, 22 Mar 2024 11:41:25 -0400 X-MC-Unique: CRirIJJjO8e04NNNZtAxrg-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2d47e55e058so16534371fa.3 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=Tpm26AuqXXWA+Pt9NKaYwnkrdxdulfKEPex+ta0l8u6KF050rw1xt9a074UFNeJbMf 2h8l9oeOey3FjwvwecnNYJwCOcEKcxKTnJp+fihOBE05o4+j/2y2l2uyM+3AAHZ77E/X z2v9PEyZDotca15UJMvuv944wJXpDKuV3+sZdkV1LZT44XpbvhfwejDguA+cOtSz4lNW oXLjSCIAFjuo04bV5fidtM968/p5DhA1TTYABS+APajw5iGe8GcMSkfLUy2FM7GqQPTW hbk6I5qVL/uJyUdOCibX56dFND3l3hsy8bww1Km0/8oXglo3z0nk9GewSRdfTDnbSFz3 eJ1w== X-Forwarded-Encrypted: i=1; AJvYcCWwJXi9bLPQEqlF4TLofTtjkGcwEwnsLnpB3DMPqxE9ON8d8k/EfJzuUdshWAdgidgRJokmadfupa7c8rnE+5E= X-Gm-Message-State: AOJu0Yw1bis82XyWCR1hCkdjxOwxwvkc1M5LCAlatH/uNAHCukoO92gd trHFa3I2RtnR0U4QRJL9AhT0nRAMJHrggnnC3i47RT5KYWc9MGYhIuXIVZCwF4RCjuBbgWHDTcG OLxzcD89ngGFsU+zehQ3+kzM5AVs5uVjK53WdO2J74sLJkzVS1sk0k6ts8SP9xrFdRH7wiGMCTh I9YP5vFmX17MMnhhbK33M= X-Received: by 2002:a2e:b010:0:b0:2d5:9703:263f with SMTP id y16-20020a2eb010000000b002d59703263fmr1933170ljk.44.1711122083935; 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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