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 2A928A0C41; Fri, 16 Apr 2021 09:01:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10DCA141B27; Fri, 16 Apr 2021 09:01:48 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 67DEB40140 for ; Fri, 16 Apr 2021 09:01:46 +0200 (CEST) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FM6WF2Yr9zPr1D; Fri, 16 Apr 2021 14:58:49 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Fri, 16 Apr 2021 15:01:40 +0800 To: Thomas Monjalon , Kevin Traynor CC: , , References: <1618046334-39857-1-git-send-email-humin29@huawei.com> <1618447925-12168-1-git-send-email-humin29@huawei.com> <087b2c22-adda-2639-cbdf-2e765f463a91@redhat.com> <2194266.8AjRMLih77@thomas> From: "Min Hu (Connor)" Message-ID: <6bc0d8db-cec0-85c4-12f5-bd442f92cc4f@huawei.com> Date: Fri, 16 Apr 2021 15:01:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <2194266.8AjRMLih77@thomas> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v4] ethdev: add sanity checks in control APIs 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 Sender: "dev" Hi, Thomas, v6 has been sent to fix it, please check it out, thanks. ÔÚ 2021/4/15 20:15, Thomas Monjalon дµÀ: > 15/04/2021 14:04, Kevin Traynor: >> On 15/04/2021 01:52, Min Hu (Connor) wrote: >>> + if (iter == NULL) { >>> + RTE_ETHDEV_LOG(ERR, "Failed to iterator init for NULL\n"); >> >> "Failed to init iterator for NULL iterator\n" > > The word "Failed" looks weird in these checks. > What about "Cannot"? > Example: "Cannot init NULL iterator" > >>> + if (devargs_str == NULL) { >>> + RTE_ETHDEV_LOG(ERR, "Failed to iterate matching NULL\n"); >> >> "Failed to init iterator for NULL devargs\n" > > "Cannot init iterator for NULL devargs" > >>> + if (owner == NULL) { >>> + RTE_ETHDEV_LOG(ERR, "Failed to get ethdev port %u owner by NULL\n", >>> + port_id); >>> + return -EINVAL; >>> + } >> >> This fn uses both %u and %"PRIu16" for port_id > > I don't see the benefit of PRIu16. > >>> + if (str == NULL) { >>> + RTE_ETHDEV_LOG(ERR, "Failed to convert link to NULL\n"); >> >> "Failed to convert link to NULL string\n" > > "Cannot convert link in NULL string" > >>> + if (eth_link == NULL) { >>> + RTE_ETHDEV_LOG(ERR, "Failed to convert NULL to string\n"); >> >> "Failed to convert NULL link to string\n" > > "Cannot convert NULL link" > > > > . >