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 55AE445C15; Wed, 30 Oct 2024 15:59:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 248EA433DA; Wed, 30 Oct 2024 15:59:14 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id DB835402EE for ; Wed, 30 Oct 2024 15:59:12 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2e2dcf4b153so5053825a91.1 for ; Wed, 30 Oct 2024 07:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1730300352; x=1730905152; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=8VF1p5BWyGnykhhOsUBcLJZagaMmkG0uYYn4ER8CBww=; b=f4g0a1jevQ66KFypR/E5yfYZBrEfNOYlchlD4zHGZTGZwbVdxkVBs+h/eJu/55Mwgm pLQpoUw/+jlSn+ar0JOHS2ZQ+IYDXfFmiJk5L8nqot2/YX0NHPFTozT4soOqS4nyJhLL 2KfiCuWQcc4y99EMwjevqr01rp7O8xYMPNtm4Rp3aYmnCeN6s88CqTdInGcLE0ulkK8I BH4W6R3IwjMIhb7N1aSsxEkI+iZ5kVSomPjZMMMo3J3U0ukxHFBgkdO7baekCMoQ1+// xccAJ7oW1f8z9L/giOv9luV64Wbs3TTKe2B65mQrBq7nyb9HZAZfbi0M3Ueb8GWl24ZH ic6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730300352; x=1730905152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8VF1p5BWyGnykhhOsUBcLJZagaMmkG0uYYn4ER8CBww=; b=u99gXqD2P5iL3PX7zyfJrPeA12bD39e5brFFHoIbLiMSR+miF+Xt7T2U5JCCBQV+uP OtDvcfWX5pvURjAZNoZFcDx/MfFw8A0W64IAbB5G+K4GEqXGp6UodiI3y7Jc/a6neP6V nnanwdjIEzs+8Ae2KRt71f/XJS9COs5ZXNPqG1waAteVpj3YKXfidohDqj+KIVQz+yt5 FNCZZheLI5XG2iQURoftCVJnYMatPMRwY/5d+iRRHGipKIT+Z8qk2pVW8wlfp3KfT1VD 1hOnjkSQt/TDHTNlCZcLRrjdrM9T7ltFHQBOaHciDzpU7EKsJuU2xdfC/XvtrXB/y1C1 X99g== X-Gm-Message-State: AOJu0Yy/mPLRVL7PabZusUz+XYYbqBxo0+R9uff3Jl/pKo+4n6mtmeJR DQWO2L3MB4+ZQjJk5QuuQ7dwglL51Dv6Z8toLYRgIjndrkVrczcqMjxtEHdArrc= X-Google-Smtp-Source: AGHT+IHxzFJsj0la6sch7k0VzK8aYhocvDHjEt7l7+lRhF44StBZi8NExqAPJnrfXSMitA4mgodEXQ== X-Received: by 2002:a17:90a:53a2:b0:2e0:f896:b806 with SMTP id 98e67ed59e1d1-2e92cf2d020mr3813361a91.27.1730300351806; Wed, 30 Oct 2024 07:59:11 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa36b47sm1867393a91.17.2024.10.30.07.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 07:59:11 -0700 (PDT) Date: Wed, 30 Oct 2024 07:59:09 -0700 From: Stephen Hemminger To: Gur Stavi Cc: , "John W. Linville" , Ferruh Yigit Subject: Re: [PATCH v01] net/af_packet: add rollover and defrag options Message-ID: <20241030075909.56a363da@hermes.local> In-Reply-To: <000f01db2a94$16d5ac30$44810490$@huawei.com> References: <20241029194111.4d59987f@hermes.local> <000f01db2a94$16d5ac30$44810490$@huawei.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 Wed, 30 Oct 2024 08:22:16 +0200 Gur Stavi wrote: > > > + if (strstr(pair->key, ETH_AF_PACKET_ROLLOVER) != NULL) { > > > + rollover = atoi(pair->value); > > > + if (rollover != 0 && rollover != 1) { > > > + PMD_LOG(ERR, > > > + "%s: invalid rollover value", > > > + name); > > > + return -1; > > > + } > > > + continue; > > > + } > > > > The problem is that atoi() provides little to no error handling. > > Prefer using strtoul() and/or having a common routine for parsing flag > > values. > > This block was copy-pasted from the handling of the other options. > I even copied by mistake the indentation error that checkpatch > complained about. > > Do you want the atoi to be removed from the old code as well or just > from the new code? > > Lets fix that as another patch later.