From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 18A93593E for ; Thu, 16 Oct 2014 22:02:15 +0200 (CEST) Received: by mail-wg0-f46.google.com with SMTP id l18so4563797wgh.29 for ; Thu, 16 Oct 2014 13:10:09 -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=KG2scDyL4P07O1XIynu9Dr9EQ3qRAztG+k6VtJ6X7zM=; b=VPmue7LMSsCtAOf5kBIBE28kHrksvsx3y8YBT+UDXQ4bI6pLMWnKP5VLwQArtcIcqj xoF7pkzxzjTygkVXaNUMfUmdX3zIwFIHK76+g7cSOgUfKQXgh7STS6grMHN2Js5XmJ06 EqdbkdAOiRtY4bvBaA1GxPdPq6gtA6P3RKa8eDC7fMT//0FY2Q6rc1okSaRF4wzzYTQ9 6mAVp0HllA8ZSROAw7Qm2n2jnspwthl1djBzOUnli9D6/yHWnW24P3QCgaYm/D4pamU2 XdTp1ARpiPc1A4qNqMz8lkJcEfCoRsQtEAakt9fYzi2h41xZDE2C7UBr3/bbmwsdMRn1 J3oA== X-Gm-Message-State: ALoCoQldXubjzzofhOQN9X/PkBNG4mLWN50Gfl2cEw22+JUlFVIAHlXu34rIEKLo6tMAOYqczzIC X-Received: by 10.180.149.130 with SMTP id ua2mr23616633wib.31.1413490209858; Thu, 16 Oct 2014 13:10:09 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id gw6sm3163875wib.8.2014.10.16.13.10.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Oct 2014 13:10:09 -0700 (PDT) From: Thomas Monjalon To: Jijiang Liu Date: Thu, 16 Oct 2014 22:09:52 +0200 Message-ID: <1584946.LFzgr7T2Dy@xps13> Organization: 6WIND User-Agent: KMail/4.14.1 (Linux/3.16.4-1-ARCH; KDE/4.14.1; x86_64; ; ) In-Reply-To: <1413006935-22535-5-git-send-email-jijiang.liu@intel.com> References: <1413006935-22535-1-git-send-email-jijiang.liu@intel.com> <1413006935-22535-5-git-send-email-jijiang.liu@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 v5 4/8]librte_ether:add a common filter API 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: Thu, 16 Oct 2014 20:02:15 -0000 I don't review the common API as it should be done in an unique place and there are many copies in different patchsets. Let's focus on tunnels. 2014-10-11 13:55, Jijiang Liu: > +/**** TUNNEL FILTER DATA DEFINATION *** */ We cannot miss this comment :) > +#define ETH_TUNNEL_FILTER_OMAC 0x01 > +#define ETH_TUNNEL_FILTER_OIP 0x02 > +#define ETH_TUNNEL_FILTER_TENID 0x04 > +#define ETH_TUNNEL_FILTER_IMAC 0x08 > +#define ETH_TUNNEL_FILTER_IVLAN 0x10 > +#define ETH_TUNNEL_FILTER_IIP 0x20 > + > +#define RTE_TUNNEL_FLAGS_TO_QUEUE 1 These values requires some comments. > +/* > + * Tunneled filter type > + */ > +enum rte_tunnel_filter_type { > + RTE_TUNNEL_FILTER_TYPE_NONE = 0, > + RTE_TUNNEL_FILTER_OIP = ETH_TUNNEL_FILTER_OIP, > + RTE_TUNNEL_FILTER_IMAC_IVLAN = > + ETH_TUNNEL_FILTER_IMAC | ETH_TUNNEL_FILTER_IVLAN, > + RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID = > + ETH_TUNNEL_FILTER_IMAC | ETH_TUNNEL_FILTER_IVLAN | > + ETH_TUNNEL_FILTER_TENID, > + RTE_TUNNEL_FILTER_IMAC_TENID = > + ETH_TUNNEL_FILTER_IMAC | ETH_TUNNEL_FILTER_TENID, > + RTE_TUNNEL_FILTER_IMAC = ETH_TUNNEL_FILTER_IMAC, > + RTE_TUNNEL_FILTER_OMAC_TENID_IMAC = > + ETH_TUNNEL_FILTER_OMAC | ETH_TUNNEL_FILTER_TENID | > + ETH_TUNNEL_FILTER_IMAC, > + RTE_TUNNEL_FILTER_IIP = ETH_TUNNEL_FILTER_IIP, > + RTE_TUNNEL_FILTER_TYPE_MAX, > +}; It's absolutely impossible to understand. Keep in mind the first goal of an API: be used (which imply to be understood by users). And I really don't understand why you define values for combination of previous flags. Please, keep it simple. -- Thomas