From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v6 5/9] librte_ether:add data structures of VxLAN filter Date: Wed, 22 Oct 2014 11:31:06 +0200 Message-ID: <1475006.YvKxECmGku@xps13> References: <1413881168-20239-1-git-send-email-jijiang.liu@intel.com> <1893361.J7EnPDFulE@xps13> <1ED644BD7E0A5F4091CF203DAFB8E4CC01D827DB@SHSMSX101.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: "Liu, Jijiang" Return-path: In-Reply-To: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D827DB-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-10-22 02:25, Liu, Jijiang: > From: Thomas Monjalon [mailto:thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org] > > 2014-10-21 16:46, Jijiang Liu: > > > +#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. Checking bit mask doesn't imply to define all combinations of bit masks. There's probably something obvious that one of us is missing. > 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; > ......