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 53AD9A0547; Wed, 21 Apr 2021 19:16:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C53FE4068B; Wed, 21 Apr 2021 19:16:55 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 377E94068A for ; Wed, 21 Apr 2021 19:16:52 +0200 (CEST) IronPort-SDR: YTd54Kd5xtG4poUumX/vD9UkgVcm2hW1/4gAOD5vnbj6ojmnf2G0R+U+DYR7qQmn/xhJXJUBkb A2dmmy8W8MPA== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="192550041" X-IronPort-AV: E=Sophos;i="5.82,240,1613462400"; d="scan'208";a="192550041" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 10:16:50 -0700 IronPort-SDR: 68kLOt8rqQUxNWGrfrUfNkuH7FNwQ6vpuVq8wVrXNbM80A7vQ7hrsWOR3rRAreYOZpyvlHmqCF pZDnP66RJPVg== X-IronPort-AV: E=Sophos;i="5.82,240,1613462400"; d="scan'208";a="455421652" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.206.218]) ([10.213.206.218]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 10:16:49 -0700 From: Ferruh Yigit To: "Min Hu (Connor)" , dev@dpdk.org Cc: thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, ktraynor@redhat.com References: <1618046334-39857-1-git-send-email-humin29@huawei.com> <1619008593-38231-1-git-send-email-humin29@huawei.com> <7c27eb6b-8957-f63a-b32e-02ee19105e9a@intel.com> X-User: ferruhy Message-ID: <4dc8949d-38e5-a072-f169-28cb15b40f64@intel.com> Date: Wed, 21 Apr 2021 18:16:45 +0100 MIME-Version: 1.0 In-Reply-To: <7c27eb6b-8957-f63a-b32e-02ee19105e9a@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v10] 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" On 4/21/2021 5:22 PM, Ferruh Yigit wrote: > On 4/21/2021 3:19 PM, Ferruh Yigit wrote: >> On 4/21/2021 1:36 PM, Min Hu (Connor) wrote: >>> This patch adds more sanity checks in control path APIs. >>> >>> Fixes: 214ed1acd125 ("ethdev: add iterator to match devargs input") >>> Fixes: 3d98f921fbe9 ("ethdev: unify prefix for static functions and variables") >>> Fixes: 0366137722a0 ("ethdev: check for invalid device name") >>> Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process >>> model") >>> Fixes: 5b7ba31148a8 ("ethdev: add port ownership") >>> Fixes: f8244c6399d9 ("ethdev: increase port id range") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Min Hu (Connor) >>> Signed-off-by: Ferruh Yigit >>> Reviewed-by: Andrew Rybchenko >>> Acked-by: Kevin Traynor >>> Acked-by: Thomas Monjalon >>> Reviewed-by: Andrew Rybchenko >> >> <...> >> >>> @@ -3256,6 +3371,13 @@ rte_eth_dev_fw_version_get(uint16_t port_id, char >>> *fw_version, size_t fw_size) >>>       RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >>>       dev = &rte_eth_devices[port_id]; >>> +    if (fw_version == NULL && fw_size > 0) { >>> +        RTE_ETHDEV_LOG(ERR, >>> +            "Cannot get ethdev port %u FW version to NULL\n", >> >> In the log problem seems like only 'fw_version' to be NULL but that is not >> exactly corret, what do you think to extend it as we did a few other places in >> this patch >> >> "Cannot get ethdev port %u FW version to NULL when string size is non zero\n" >> >> <...> >> >>> @@ -3323,6 +3451,14 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, >>> uint32_t ptype_mask, >>>       RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >>>       dev = &rte_eth_devices[port_id]; >>> + >>> +    if (ptypes == NULL && num > 0) { >>> +        RTE_ETHDEV_LOG(ERR, >>> +            "Cannot get ethdev port %u supported packet types to NULL\n", >>> +            port_id); >> >> Ditto. What about: >> >> "Cannot get ethdev port %u supported packet types to NULL when array size is >> non zero\n > > I can fix these in the next-net if there is no objection. Applied to dpdk-next-net/main, thanks. Above two logs updated while merging.