From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 371932BE3 for ; Wed, 9 Mar 2016 01:16:18 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id l68so171483318wml.0 for ; Tue, 08 Mar 2016 16:16:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=PlzCV5KTJRcrFBywtczCsvPawHwky3lCsuggR2nsDdw=; b=QeKkIeNdVbnQ5GYA9K9dhgrI7+X6+Wbof6mfl+nniC0jsP1vQti2GQIzSWL2bBRZE4 DKkt25LONEISYpmgnmg4k9orhnNOPLcS7SYd3M1KePJTvIctTwSaG6L+37ksrJTMXzg9 Sq/iqbWM76IgIWi4UrIjX+0gAL4qnnCEzRTFh4Voi9RJOsf6zP7LRU47DRvx6v2g3/Ly 367VFeDE142lKpcpY7Ho9zBtFSSdXnpZ2/hMbHMGX8h2msPhLbD1sbS1gijC992HgG8T Bew3fhVZjgznA8JWIAeZnhAJBjhRSn/FfWbCfqJNgz+vzj5d0LlDAe1Besc0Vq/bWHWO 5V0g== 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; bh=PlzCV5KTJRcrFBywtczCsvPawHwky3lCsuggR2nsDdw=; b=FV6d2yRgdRQh60wfVqisDrTBCfC2SX3o/EbcVJKN5zwN5/hgvIwh3JnPPwZ/n1EiEO j24R8uM4Id1lTsx28kr4pPMEzggmClxO/L+DeL9WBsB0xcWGgaEOsA1wga19cpiCT/i9 LLVt4b/ClycJ6WWAjYrKs3VuN3Jd5pC7PMKLwNrF5mHHufOJSDdj+sCQybpLQVSA94r2 /UFvxBIDtTIE3exPhbfqr0YYhDjV6JDBFqUNeSBr2I7jLNWYR2bU3Pi1fZyKMBQPGjAg pCbyUqe3seRSDbvWPdMk80WqYOsv9rCfA77Tp2Goed2gGCS3XRzqCjLyNVO3puUxIzwC lAtw== X-Gm-Message-State: AD7BkJLnOd0ntLvZ+VRwehhV3dSVFHSat0OJ9rXS5dx+eMeJc2zVXV381lnAB2ZWXGeyKz5g X-Received: by 10.194.90.77 with SMTP id bu13mr31068112wjb.60.1457482578042; Tue, 08 Mar 2016 16:16:18 -0800 (PST) Received: from xps13.localnet (171.36.101.84.rev.sfr.net. [84.101.36.171]) by smtp.gmail.com with ESMTPSA id q139sm5739098wmd.2.2016.03.08.16.16.16 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Mar 2016 16:16:16 -0800 (PST) From: Thomas Monjalon To: Wenzhuo Lu Date: Wed, 09 Mar 2016 01:14:38 +0100 Message-ID: <1879903.OgO4X0RlNL@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1457420017-15345-3-git-send-email-wenzhuo.lu@intel.com> References: <1454051035-25757-1-git-send-email-wenzhuo.lu@intel.com> <1457420017-15345-1-git-send-email-wenzhuo.lu@intel.com> <1457420017-15345-3-git-send-email-wenzhuo.lu@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 2/5] lib/librte_ether: support l2 tunnel operations 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, 09 Mar 2016 00:16:18 -0000 2016-03-08 14:53, Wenzhuo Lu: > +/** > + * l2 tunnel type. > + */ > +enum rte_eth_l2_tunnel_type { > + RTE_L2_TUNNEL_TYPE_NONE = 0, > + RTE_L2_TUNNEL_TYPE_E_TAG, > + RTE_L2_TUNNEL_TYPE_MAX, > +}; We already have rte_eth_tunnel_type. Why this struct is in rte_eth_ctrl.h and not used with rte_eth_dev_filter_ctrl? > + /** > + * Config l2 tunnel ether type of an Ethernet device for filtering specific > + * tunnel packets by ether type. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param l2_tunnel > + * l2 tunnel configuration. > + * > + * @return > + * - (0) if successful. > + * - (-ENODEV) if port identifier is invalid. > + * - (-ENOTSUP) if hardware doesn't support tunnel type. > + */ > +int > +rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, > + struct rte_eth_l2_tunnel *l2_tunnel); > + > + /** > + * Enable/disable l2 tunnel offload functions. Include, > + * 1, The ability of parsing a type of l2 tunnel of an Ethernet device. > + * Filtering, forwarding and offloading this type of tunnel packets depend on > + * this ability. > + * 2, Stripping the l2 tunnel tag. > + * 3, Insertion of the l2 tunnel tag. > + * 4, Forwarding the packets based on the l2 tunnel tag. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param l2_tunnel > + * l2 tunnel parameters. > + * @param mask > + * Indicate the offload function. > + * @param en > + * Enable or disable this function. > + * > + * @return > + * - (0) if successful. > + * - (-ENODEV) if port identifier is invalid. > + * - (-ENOTSUP) if hardware doesn't support tunnel type. > + */ > +int > +rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, > + struct rte_eth_l2_tunnel *l2_tunnel, > + uint32_t mask, > + uint8_t en); > + > + /** > + * Add a filter for packet forwarding based on l2 tunnel tag of an Ethernet > + * device for specific tunnel packets. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param l2_tunnel > + * l2 tunnel configuration. > + * > + * @return > + * - (0) if successful. > + * - (-ENODEV) if port identifier is invalid. > + * - (-ENOTSUP) if hardware doesn't support tunnel type. > + */ > +int > +rte_eth_dev_l2_tunnel_filter_add(uint8_t port_id, > + struct rte_eth_l2_tunnel *l2_tunnel); > + > + /** > + * Delete a filter for packet forwarding based on l2 tunnel tag of an Ethernet > + * device for specific tunnel packets. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param l2_tunnel > + * l2 tunnel configuration. > + * > + * @return > + * - (0) if successful. > + * - (-ENODEV) if port identifier is invalid. > + * - (-ENOTSUP) if hardware doesn't support tunnel type. > + */ > +int > +rte_eth_dev_l2_tunnel_filter_del(uint8_t port_id, > + struct rte_eth_l2_tunnel *l2_tunnel); > + Why are we still adding some filtering functions after having the assertion that the new filtering API in lib/librte_ether/rte_eth_ctrl.h was generic enough? The filtering API v2 was a total failure. Are we going to add new functions each time a new bit of a header must be parsed by an offloaded filtering? Are we going to add new functions for each new filter of a NIC? > --- a/lib/librte_ether/rte_ether_version.map > +++ b/lib/librte_ether/rte_ether_version.map > @@ -114,6 +114,10 @@ DPDK_2.2 { > rte_eth_tx_queue_setup; > rte_eth_xstats_get; > rte_eth_xstats_reset; > + rte_eth_dev_l2_tunnel_eth_type_conf; > + rte_eth_dev_l2_tunnel_offload_set; > + rte_eth_dev_l2_tunnel_filter_add; > + rte_eth_dev_l2_tunnel_filter_del; It is not the right section but it doesn't really matter.