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 C258AA00BE; Fri, 11 Feb 2022 02:01:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A4A340683; Fri, 11 Feb 2022 02:01:51 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 02FD94013F for ; Fri, 11 Feb 2022 02:01:50 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id a39so12538155pfx.7 for ; Thu, 10 Feb 2022 17:01:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Upjz8zBDy6bBRrObnRSjFO1XvdUhQBPdwn5/S7PYPkk=; b=qM7iCYiUQJPF7SkhBBF/D9BPGiB6btuePOxHtoYj7fkdvYrZVlrA9MDYTe+gZNp5n4 5W2KIWcgzTKOWdRt7zqi/ovRPZ4qABxP6D8SiAPqff+cMcwpmM0MzmDPiKamjqNDWuRv G5VvC5R6lowxEqG7rf97cq12L3QR+iCVJ7MMI65kYIZDrv2ZKD2JG7gCQgQSSK5idhKt I5hMzYUqs+TnqMNMxzA+PG9lYJs/Jr/xpYR0hLgyrVVONwcqb675lb1Tl5/xSbmMzIU3 YUsQS4xCkxqyJFaLOxF/1R7QUCJJTh/+VvQYbBjLf4fz177JMUQxCJGZPW42LAxRZF0c mY4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Upjz8zBDy6bBRrObnRSjFO1XvdUhQBPdwn5/S7PYPkk=; b=RlJj0wXfslTE2+UpnC730T85YQDctlb3HkkmkUuqfpGdxLH4dPhZ5TxqOiu5NPlu3w vc8Bc+fnP5c8T2ig8bSRsZpuwvDuURmRe9pwrDUG5Vtlm99aJ2yqcOMw73r0R/ePvc2k SDNLZ/zUzd1wT+0/tlexN2RFiZh4jpT5P4vdT5zxdNwiKiyDHNA52Um11CA6ijZdSgWH XHJdTzsKZoM8Rw2saDa1tPsN145Ft8waQG7VG7ICpqMdoALei98mxDbg6lTRYJBh0n+A CgyF2+MNy99LMNOu7uwzqPR1dJM6HjZWzkbdwN0qBlL9GY1fInFurernsHtkbO/k8Nfy vPHQ== X-Gm-Message-State: AOAM533m2xH0gxsIyyk5QRvO5AFN4aMXfGNPWNL+Vd/o69BWgEktCGxx 1UvxvB6WAdioCzl18N7GrHv82Q== X-Google-Smtp-Source: ABdhPJwuiGcL3JzKoSGyZX7genVnLLy2hUtEd9qp75V+9OwSsn/Jqyh5DQCmHp/6L0e/O8AU9ZKjUA== X-Received: by 2002:a65:6751:: with SMTP id c17mr4451502pgu.197.1644541309980; Thu, 10 Feb 2022 17:01:49 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id p20sm337946pgd.21.2022.02.10.17.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 17:01:49 -0800 (PST) Date: Thu, 10 Feb 2022 17:01:47 -0800 From: Stephen Hemminger To: Honnappa Nagarahalli Cc: dev@dpdk.org, lijuan.tu@intel.com, juraj.linkes@pantheon.tech, ohilyard@iol.unh.edu, david.marchand@redhat.com, thomas@monjalon.net, jerinj@marvell.com, bruce.richardson@intel.com, kathleen.capella@arm.com, nd@arm.com, Ruifeng Wang Subject: Re: [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable Message-ID: <20220210170147.08c43652@hermes.local> In-Reply-To: <20220211002607.80058-2-honnappa.nagarahalli@arm.com> References: <20220202060403.118301-1-honnappa.nagarahalli@arm.com> <20220211002607.80058-1-honnappa.nagarahalli@arm.com> <20220211002607.80058-2-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Fri, 11 Feb 2022 00:26:07 +0000 Honnappa Nagarahalli wrote: > +static void > +parse_rx_queue_size(const char *rx_queue_size_arg) > +{ > + char *end = NULL; > + uint32_t rx_queue_size; > + > + /* parse decimal string */ > + rx_queue_size = strtoul(rx_queue_size_arg, &end, 10); > + if ((rx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0')) > + return; > + > + if (rx_queue_size == 0) > + return; > + > + nb_rxd = rx_queue_size; > +} > + > +static void > +parse_tx_queue_size(const char *tx_queue_size_arg) > +{ > + char *end = NULL; > + uint32_t tx_queue_size; > + > + /* parse decimal string */ > + tx_queue_size = strtoul(tx_queue_size_arg, &end, 10); > + if ((tx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0')) > + return; > + > + if (tx_queue_size == 0) > + return; > + > + nb_txd = tx_queue_size; These are duplications of the same function, just different result. Also programs should test for invalid queue size which is currently limited to 16 bits by rte_eth_dev_configure static void parse_queue_size(const char *size_arg, uint32_t *size_ret) { unsigned long result; char *end; result = strtoul(size_arg, &end, 0); if (size_arg[0] == '\0' || *end != '\0' || result > UINT16_MAX) rte_exit(EXIT_FAILURE, "Invalid queue size '%s'\n", size_arg); *size_ret = result; }