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 5408D45BCD; Wed, 30 Oct 2024 07:22:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 478B142FAF; Wed, 30 Oct 2024 07:22:23 +0100 (CET) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 0D406402EE for ; Wed, 30 Oct 2024 07:22:21 +0100 (CET) Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XdcRb6X78z6G86x; Wed, 30 Oct 2024 14:19:55 +0800 (CST) Received: from frapeml500005.china.huawei.com (unknown [7.182.85.13]) by mail.maildlp.com (Postfix) with ESMTPS id 1B57C140A35; Wed, 30 Oct 2024 14:22:20 +0800 (CST) Received: from GurSIX1 (10.204.107.102) by frapeml500005.china.huawei.com (7.182.85.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 30 Oct 2024 07:22:16 +0100 From: Gur Stavi To: 'Stephen Hemminger' CC: , "John W. Linville" , Ferruh Yigit References: <20241029194111.4d59987f@hermes.local> In-Reply-To: <20241029194111.4d59987f@hermes.local> Subject: RE: [PATCH v01] net/af_packet: add rollover and defrag options Date: Wed, 30 Oct 2024 08:22:16 +0200 Message-ID: <000f01db2a94$16d5ac30$44810490$@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHbKfX0aw5keSu4wkuAlso/DntGD7KehayAgABNsXA= Content-Language: en-us X-Originating-IP: [10.204.107.102] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To frapeml500005.china.huawei.com (7.182.85.13) 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 > > + 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?