From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com
 [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id 4B7E0B37C
 for <dev@dpdk.org>; Wed, 27 Aug 2014 17:08:11 +0200 (CEST)
Received: by mail-wi0-f171.google.com with SMTP id hi2so5992069wib.16
 for <dev@dpdk.org>; Wed, 27 Aug 2014 08:12:14 -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=5TZVo2+3yxhTDO5lsjEvOaPowuFXgyIt6/EOp5q2dKo=;
 b=kExAw3hH444+26vViuBbUuJR8SloNIntM+IOfvxWi5CWjaRnQCotIURgczNQdXyUS/
 HVQk3hzF0F51T9GdgX1WZDBbdr4DmcET7fo5rw3/3BrFbW/OTab5cySAwXk/a6GBcso1
 o1GxxehAfhLI7BcMi5Du3YUwPCq9tbByxKaRaMwfp9nhdDIm9rQdsAclDdOMFXyX2gVA
 3r23NKxttQfKdFtu3bFzMe3wKooEQvwQIlROQvix32Zh5mszOSAqVa5RfFxWBTA+pNkQ
 aWGzwB7STFSt6Ysgd2UQ1DzTc/L8qz8dpExQM6Y20M+nUiXBlU3fnpIXbDC90FKM2omK
 jlHA==
X-Gm-Message-State: ALoCoQkMAOXmcwNY17+TMSL3o49PRbPX1ef5TZhyBU/5yw7uwlPGpduEAuZ7O/rQFGWQBBTjZdCf
X-Received: by 10.180.19.35 with SMTP id b3mr29049592wie.52.1409152333151;
 Wed, 27 Aug 2014 08:12:13 -0700 (PDT)
Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net.
 [82.239.227.177])
 by mx.google.com with ESMTPSA id kr8sm1798268wjb.20.2014.08.27.08.12.11
 for <multiple recipients>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 27 Aug 2014 08:12:12 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Jijiang Liu <jijiang.liu@intel.com>
Date: Wed, 27 Aug 2014 17:12:06 +0200
Message-ID: <3586297.ZW2M4AoP7m@xps13>
Organization: 6WIND
User-Agent: KMail/4.13.3 (Linux/3.15.8-1-ARCH; KDE/4.13.3; x86_64; ; )
In-Reply-To: <1409038294-21693-4-git-send-email-jijiang.liu@intel.com>
References: <1409038294-21693-1-git-send-email-jijiang.liu@intel.com>
 <1409038294-21693-4-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 v2 3/7]rte_ether:add API of VxLAN packet
	filter in librte_ether
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Aug 2014 15:08:11 -0000

2014-08-26 15:31, Jijiang Liu:
> +enum rte_tunnel_filter_type {
> +	RTE_TUNNEL_FILTER_TYPE_NONE = 0,
> +	RTE_TUNNEL_FILTER_IMAC_IVLAN, /**< Filter by inner MAC and VLAN ID. */
> +	RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID,
> +	/**< Filter by inner MAC address and VLAN ID, tenned ID. */
> +	RTE_TUNNEL_FILTER_IMAC_TENID, /**< Filter by inner MAC and tenant ID. */
> +	RTE_TUNNEL_FILTER_IMAC, /**< Filter by inner MAC address */
> +	RTE_TUNNEL_FILTER_OMAC_TENID_IMAC,
> +	/**< Filter by outer MAC address, tenant ID and Inner MAC */
> +	RTE_TUNNEL_FILTER_TYPE_MAX,
> +};
[...]
>  /**
> + * Tunnel Packet filter configuration.
> + */
> +struct rte_eth_tunnel_filter_conf {
> +	struct ether_addr *outer_mac;  /**< Outer MAC address fiter. */
> +	struct ether_addr *inner_mac;  /**< Inner MAC address fiter. */
> +	uint16_t inner_vlan;           /**< Inner VLAN fiter. */
> +	enum rte_tunnel_iptype ip_type; /**< IP address type. */
> +	union {
> +		uint32_t ipv4_addr;    /**< IPv4 source address to match. */
> +		uint32_t ipv6_addr[4]; /**< IPv6 source address to match. */
> +	} ip_addr; /**< IPv4/IPv6 source address to match (union of above). */
> +
> +	uint8_t filter_type;           /**< Filter type. */
> +	uint8_t to_queue;              /**< Use MAC and VLAN to point to a queue. */
> +	enum rte_eth_tunnel_type tunnel_type; /**< Tunnel Type. */
> +	uint32_t tenant_id;            /** < Tenant number. */
> +	uint16_t queue_id;             /** < queue number. */
> +};
[...]
> +typedef int (*eth_tunnel_filter_set_t)(struct rte_eth_dev *dev,
> +				      struct rte_eth_tunnel_filter_conf *tunnel_filter,
> +				      uint8_t filter_count, uint8_t add);
> +/**< @internal Set tunnel filter */
[...]
> + /**
> + * Add tunnel filter configuration of Ethernet device
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param tunnel_filter
> + *   Where to store the current Tunneling UDP configuration
> + *   of the Ethernet device.
> + * @param filter_count
> + *   How many filters are going to added.
> + * @param add
> + *   0: remove tunnel filter
> + *   1: add tunnel filter
> + *
> + * @return
> + *   - (0) if successful.
> + *   - (-ENODEV) if port identifier is invalid.
> + *   - (-EINVAL) if bad parameter.
> + *   - (-ENOTSUP) if hardware doesn't support tunnel type.
> + */
> +int
> +rte_eth_dev_tunnel_filter_set(uint8_t port_id,
> +			struct rte_eth_tunnel_filter_conf *tunnel_filter,
> +			uint8_t filter_count, uint8_t add);

I wonder if we could use a common function to set all kind of filters?

Thoughts are welcome.

-- 
Thomas