From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] ethdev: refine new API to query supported ptypes Date: Wed, 06 Apr 2016 16:32:58 +0200 Message-ID: <4577590.9NgA58xFzY@xps13> References: <1458875736-56444-1-git-send-email-jianfeng.tan@intel.com> <1459914673-27716-1-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, konstantin.ananyev@intel.com, bruce.richardson@intel.com To: Jianfeng Tan Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id E5A262C65 for ; Wed, 6 Apr 2016 16:34:37 +0200 (CEST) Received: by mail-wm0-f54.google.com with SMTP id u206so48574433wme.1 for ; Wed, 06 Apr 2016 07:34:37 -0700 (PDT) In-Reply-To: <1459914673-27716-1-git-send-email-jianfeng.tan@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-04-06 11:51, Jianfeng Tan: > This change is to make user code simpler. For PMDs which do not fill any > packet types, return 0 instead of -ENOTSUP as suggested by Bruce. > > Usually, users only care if the required (by ptype_mask) ptypes can be > filled by the specified PMD. If the PMD implements dev_supported_ptypes_get > func is not important. And the introduce of another return value (-ENOTSUP) > would increase the complexity of user programs to check it. > > Besides, there are ways to know if a PMD implements the func: > a. see doc/guides/nics/overview.rst. > b. use (~1) as parameter ptype_mask, then check if return 0. > > Suggested-by: Bruce Richardson > Signed-off-by: Jianfeng Tan > Acked-by: Konstantin Ananyev Applied, thanks