[dpdk-dev] [PATCH 01/12] ethdev: add API to query what/if packet type is set

Tan, Jianfeng jianfeng.tan at intel.com
Mon Jan 11 08:39:08 CET 2016


According to the proposal, I'm going to fix the definition of this API 
as below:
  * Retrieve the contextual information of an Ethernet device.
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param ptype_mask
  *   A hint of what kind of packet type which the caller is interested in
  * @param ptypes
  *   An array of packet types to be filled with
  * @param num
  * Size of ptypes[]
  * @return
  *   - (>=0) if successful. Indicate number of valid values in ptypes 
  *   - (-ENOTSUP) if hardware-assisted VLAN stripping not configured.
  *   - (-ENODEV) if *port_id* invalid.
extern int rte_eth_dev_get_ptype_info(uint8_t port_id,
                                 uint32_t ptype_mask, uint32_t ptypes[], 
uint32_t num);

Unresolved issues:
1) When num is exceeded, we just stop there and return num, or return 
The first way has a bug when: what app is exactly asking for is not 
filled in ptypes[] because of
exceeding num, but app believes this API returns with success.

2) if RTE_PTYPE_*_MAX_NUM macros necessary? Without them, we could calculate
num through 2^(number of bit 1 in RTE_PTPE_*_MASK).


More information about the dev mailing list