ethdev: refine API to query supported packet types
authorJianfeng Tan <jianfeng.tan@intel.com>
Wed, 6 Apr 2016 03:51:13 +0000 (11:51 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 6 Apr 2016 14:40:40 +0000 (16:40 +0200)
commit4c50e2f6bf412544ae02a1fe4e04622d12953fd9
tree0d01df97c02bb21800c1c01a1d999cb36d26fa07
parent5fe8c8a2ba751b0464cba16660601c3795d37422
ethdev: refine API to query supported packet types

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.

Fixes: 78a38edf66de ("ethdev: query supported packet types")

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.h