From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by dpdk.org (Postfix) with ESMTP id 149AD7E7B for ; Wed, 22 Oct 2014 11:23:04 +0200 (CEST) Received: by mail-wi0-f176.google.com with SMTP id n3so302111wiv.9 for ; Wed, 22 Oct 2014 02:31:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=+piwSUBiUcEjbCB89mCWOOFhdIARQm9YpiIIT4iYz3w=; b=dgyMeQr0uz/9addZK9NSmVgOq1BOl/B1LLMpsfQytciIJF/CZGYCgacGAVDRmNNaTB SLehyuzxTYiLvQ7JV9daKkyEDbhSMNkxAx0POChgXCPc6H6Y/PW6vtkURjdEaqLFC0KD fyf1OPEtE0e4hurd7OOTAnPNbI3igx6nvhnR4LZmOM1Qj6VNeVuJRgqQWAZ+U1Xg6SM2 xO7vR6tNEYNmTSQrg/Uu3E9f8TfCjzDHtjQQ+kMhcutew3qpzmlF+Hp35s2E7A/4tSXy p0MUm9Z8X70gLIWWhSIy3VsSxejq21uVfF2Nv5RvSCMuJTWxVyw5536kHqidedJz3rZr +ZsA== X-Gm-Message-State: ALoCoQlfCtNLS0YaaCjhD8zGvGz+BG0VFiaBGpyY/CqfAw9Vrva92c7H+/2SfTBlReJHTskN+ns3 X-Received: by 10.194.61.51 with SMTP id m19mr50134775wjr.15.1413970283784; Wed, 22 Oct 2014 02:31:23 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id om1sm18196080wjc.42.2014.10.22.02.31.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Oct 2014 02:31:23 -0700 (PDT) From: Thomas Monjalon To: "Liu, Jijiang" Date: Wed, 22 Oct 2014 11:31:06 +0200 Message-ID: <1475006.YvKxECmGku@xps13> Organization: 6WIND User-Agent: KMail/4.14.1 (Linux/3.16.4-1-ARCH; KDE/4.14.1; x86_64; ; ) In-Reply-To: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D827DB@SHSMSX101.ccr.corp.intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v6 5/9] librte_ether:add data structures of VxLAN filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2014 09:23:04 -0000 2014-10-22 02:25, Liu, Jijiang: > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > 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; > ......