Hi Jingjing

> -----Original Message-----
> From: Wu, Jingjing
> Sent: Friday, March 24, 2017 5:55 PM
> To: Zhang, Qi Z <qi.z.zh...@intel.com>; Zhang, Helin
> <helin.zh...@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v3 2/3] net/i40e: configurable PTYPE mapping
> 
> > diff --git a/drivers/net/i40e/rte_pmd_i40e.h
> > b/drivers/net/i40e/rte_pmd_i40e.h index a0ad88c..1e25270 100644
> > --- a/drivers/net/i40e/rte_pmd_i40e.h
> > +++ b/drivers/net/i40e/rte_pmd_i40e.h
> > @@ -65,6 +65,13 @@ struct rte_pmd_i40e_mb_event_param {
> >     uint16_t msglen;   /**< length of the message */
> >  };
> >
> > +#define RTE_PMD_I40E_PTYPE_USER_DEFINE_MASK 0x80000000
> > +
> 
> Could you add more comments to describe the MASK's meaning?
> And what is user defined packet type, and what is the user defined packet
> type?

The purpose of this mask is to let application define their own software PTYPE 
while not break existing ones.
I will add more comments to explain this.
> 
> 
> And what is the difference between update and replace map?

Both APIs is used to update the ptype mapping table

The difference is 

rte_pmd_i40e_ptype_mapping_replace will searched the specific software ptype 
(or group) in ptype mapping table and replace it with the new one.
One of the situation to use this API is, application try to simplify the ptype 
table by representing a group of more specific sw ptype with a generic one like 
below
rte_pmd_i40e_ptype_mapping_replace(port_id, RTE_PTYPE_L2_MASK, 1, 
RTE_PTYPE_L2_ETHER);

rte_pmd_i40e_ptype_mapping_update is a little bit low level, because the 
application need to know about the hardware ptype encode, 
Application can define its own ptype mapping table according to datasheet from 
scratch or just by modifying the return content from 
rte_pmd_i40e_ptype_mapping_get 
then use this API to override the whole old table (exclusive set), or part of 
the old one (exclusive not set)

Thanks
Qi

Reply via email to