> -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com] > Sent: Tuesday, October 21, 2014 11:13 PM > To: Liu, Jijiang > Cc: dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH v6 5/9] librte_ether:add data structures of > VxLAN filter > > 2014-10-21 16:46, Jijiang Liu: > > +#define RTE_TUNNEL_FILTER_TO_QUEUE 1 /**< point to an queue by filter > type */ > > Sorry, I don't understand what is this value for? > > > +#define RTE_TUNNEL_FILTER_IMAC_IVLAN (ETH_TUNNEL_FILTER_IMAC | \ > > + ETH_TUNNEL_FILTER_IVLAN) > > +#define RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID > (ETH_TUNNEL_FILTER_IMAC | \ > > + ETH_TUNNEL_FILTER_IVLAN | \ > > + ETH_TUNNEL_FILTER_TENID) > > +#define RTE_TUNNEL_FILTER_IMAC_TENID (ETH_TUNNEL_FILTER_IMAC | \ > > + ETH_TUNNEL_FILTER_TENID) > > +#define RTE_TUNNEL_FILTER_OMAC_TENID_IMAC > (ETH_TUNNEL_FILTER_OMAC | \ > > + ETH_TUNNEL_FILTER_TENID | \ > > + ETH_TUNNEL_FILTER_IMAC) > > I thought you agree that these definitions are useless? >
Sorry, this MAY be some misunderstanding, I don't think these definition are useless. I just thought change "uint16_t filter_type" is better than define "enum filter_type". Let me explain here again. The filter condition are: 1. inner MAC + inner VLAN 2. inner MAC + IVLAN + tenant ID .. 5. outer MAC + tenant ID + inner MAC For each filter condition, we need to check if the mandatory parameters are valid by checking corresponding bit MASK. An pseudo code example: Switch (filter_type) Case 1: //inner MAC + inner VLAN If (filter_type & ETH_TUNNEL_FILTER_IMAC ) if (IMAC==NULL) return -1; case 5: // outer MAC + tenant ID + inner MAC If (filter_type & ETH_TUNNEL_FILTER_IMAC ) if (IMAC==NULL) return -1; If (filter_type & ETH_TUNNEL_FILTER_OMAC ) if (IMAC==NULL) return -1; ...... > Thomas