[dpdk-dev] [PATCH v2] ethdev: refine new API to query supported ptypes

Thomas Monjalon thomas.monjalon at 6wind.com
Wed Apr 6 16:32:58 CEST 2016


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 <bruce.richardson at intel.com>
> Signed-off-by: Jianfeng Tan <jianfeng.tan at intel.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>

Applied, thanks



More information about the dev mailing list