DPDK patches and discussions
 help / color / mirror / Atom feed
From: "He, Shaopeng" <shaopeng.he@intel.com>
To: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v4 3/7] ixgbe: support l2 tunnel config
Date: Fri, 4 Mar 2016 01:47:05 +0000	[thread overview]
Message-ID: <FB82FCC69332B84596FE0CEC3C131094C23D4F@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1455763573-2867-4-git-send-email-wenzhuo.lu@intel.com>

Hi Wenzhuo,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Thursday, February 18, 2016 10:46 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v4 3/7] ixgbe: support l2 tunnel config
> 
> Add support of l2 tunnel configuration.
> Support modifying ether type of a type of l2 tunnel.
> Support enabling and disabling the support of a type of l2 tunnel.
> Only E-tag tunnel is supported now.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 140
> +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 140 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index b99e48e..b15a4b6 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -139,6 +139,10 @@
>  #define IXGBE_CYCLECOUNTER_MASK   0xffffffffffffffffULL
> 
>  #define IXGBE_VT_CTL_POOLING_MODE_MASK         0x00030000
> +#define DEFAULT_ETAG_ETYPE                     0x893f
> +#define IXGBE_ETAG_ETYPE                       0x00005084
> +#define IXGBE_ETAG_ETYPE_MASK                  0x0000ffff
> +#define IXGBE_ETAG_ETYPE_VALID                 0x80000000
> 
>  static int eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev);
>  static int eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev);
> @@ -339,6 +343,14 @@ static int ixgbe_timesync_read_time(struct
> rte_eth_dev *dev,
>  				   struct timespec *timestamp);
>  static int ixgbe_timesync_write_time(struct rte_eth_dev *dev,
>  				   const struct timespec *timestamp);
> +static int ixgbe_dev_l2_tunnel_eth_type_conf
> +	(struct rte_eth_dev *dev, struct rte_eth_l2_tunnel *l2_tunnel);
> +static int ixgbe_dev_l2_tunnel_enable
> +	(struct rte_eth_dev *dev,
> +	 enum rte_eth_l2_tunnel_type l2_tunnel_type);
> +static int ixgbe_dev_l2_tunnel_disable
> +	(struct rte_eth_dev *dev,
> +	 enum rte_eth_l2_tunnel_type l2_tunnel_type);
> 
>  /*
>   * Define VF Stats MACRO for Non "cleared on read" register
> @@ -497,6 +509,9 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops =
> {
>  	.timesync_adjust_time = ixgbe_timesync_adjust_time,
>  	.timesync_read_time   = ixgbe_timesync_read_time,
>  	.timesync_write_time  = ixgbe_timesync_write_time,
> +	.l2_tunnel_eth_type_conf = ixgbe_dev_l2_tunnel_eth_type_conf,
> +	.l2_tunnel_enable        = ixgbe_dev_l2_tunnel_enable,
> +	.l2_tunnel_disable       = ixgbe_dev_l2_tunnel_disable,
>  };
> 
>  /*
> @@ -6201,6 +6216,131 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev
> *dev,
>  	return 0;
>  }
> 
> +/* Update e-tag ether type */
> +static int
> +ixgbe_update_e_tag_eth_type(struct ixgbe_hw *hw,
> +			    uint16_t ether_type)
> +{
> +	uint32_t etag_etype;
> +
> +	if (hw->mac.type != ixgbe_mac_X550 &&
> +	    hw->mac.type != ixgbe_mac_X550EM_x) {
> +		return -ENOTSUP;
> +	}
> +
> +	etag_etype = IXGBE_READ_REG(hw, IXGBE_ETAG_ETYPE);
> +	etag_etype &= ~IXGBE_ETAG_ETYPE_MASK;
> +	etag_etype |= ether_type;
> +	IXGBE_WRITE_REG(hw, IXGBE_ETAG_ETYPE, etag_etype);
> +	IXGBE_WRITE_FLUSH(hw);
> +
> +	return 0;
> +}
> +
> +/* Config l2 tunnel ether type */
> +static int
> +ixgbe_dev_l2_tunnel_eth_type_conf(struct rte_eth_dev *dev,
> +				  struct rte_eth_l2_tunnel *l2_tunnel)
> +{
> +	int ret = 0;
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +
> +	if (l2_tunnel == NULL)
> +		return -EINVAL;
> +
> +	switch (l2_tunnel->l2_tunnel_type) {
> +	case RTE_L2_TUNNEL_TYPE_E_TAG:
> +		ret = ixgbe_update_e_tag_eth_type(hw, l2_tunnel-
> >ether_type);
> +		break;
> +	default:
> +		PMD_DRV_LOG(ERR, "Invalid tunnel type");
> +		ret = -1;

Better to use: ret = -EINVAL?

> +		break;
> +	}
> +
> +	return ret;
> +}
> +
> +/* Enable e-tag tunnel */
> +static int
> +ixgbe_e_tag_enable(struct ixgbe_hw *hw)
> +{
> +	uint32_t etag_etype;
> +
> +	if (hw->mac.type != ixgbe_mac_X550 &&
> +	    hw->mac.type != ixgbe_mac_X550EM_x) {
> +		return -ENOTSUP;
> +	}
> +
> +	etag_etype = IXGBE_READ_REG(hw, IXGBE_ETAG_ETYPE);
> +	etag_etype |= IXGBE_ETAG_ETYPE_VALID;
> +	IXGBE_WRITE_REG(hw, IXGBE_ETAG_ETYPE, etag_etype);
> +	IXGBE_WRITE_FLUSH(hw);
> +
> +	return 0;
> +}
> +
> +/* Enable l2 tunnel */
> +static int
> +ixgbe_dev_l2_tunnel_enable(struct rte_eth_dev *dev,
> +			   enum rte_eth_l2_tunnel_type l2_tunnel_type)
> +{
> +	int ret = 0;
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +
> +	switch (l2_tunnel_type) {
> +	case RTE_L2_TUNNEL_TYPE_E_TAG:
> +		ret = ixgbe_e_tag_enable(hw);
> +		break;
> +	default:
> +		PMD_DRV_LOG(ERR, "Invalid tunnel type");
> +		ret = -1;
> +		break;
> +	}
> +
> +	return ret;
> +}
> +
> +/* Disable e-tag tunnel */
> +static int
> +ixgbe_e_tag_disable(struct ixgbe_hw *hw)
> +{
> +	uint32_t etag_etype;
> +
> +	if (hw->mac.type != ixgbe_mac_X550 &&
> +	    hw->mac.type != ixgbe_mac_X550EM_x) {
> +		return -ENOTSUP;
> +	}
> +
> +	etag_etype = IXGBE_READ_REG(hw, IXGBE_ETAG_ETYPE);
> +	etag_etype &= ~IXGBE_ETAG_ETYPE_VALID;
> +	IXGBE_WRITE_REG(hw, IXGBE_ETAG_ETYPE, etag_etype);
> +	IXGBE_WRITE_FLUSH(hw);
> +
> +	return 0;
> +}
> +
> +/* Disable l2 tunnel */
> +static int
> +ixgbe_dev_l2_tunnel_disable(struct rte_eth_dev *dev,
> +			    enum rte_eth_l2_tunnel_type l2_tunnel_type)
> +{
> +	int ret = 0;
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +
> +	switch (l2_tunnel_type) {
> +	case RTE_L2_TUNNEL_TYPE_E_TAG:
> +		ret = ixgbe_e_tag_disable(hw);
> +		break;
> +	default:
> +		PMD_DRV_LOG(ERR, "Invalid tunnel type");
> +		ret = -1;
> +		break;
> +	}
> +
> +	return ret;
> +}
> +
>  static struct rte_driver rte_ixgbe_driver = {
>  	.type = PMD_PDEV,
>  	.init = rte_ixgbe_pmd_init,
> --
> 1.9.3

  reply	other threads:[~2016-03-04  1:47 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29  7:03 [dpdk-dev] [PATCH 0/8] support E-tag offloading and forwarding on Intel X550 NIC Wenzhuo Lu
2016-01-29  7:03 ` [dpdk-dev] [PATCH 1/8] ixgbe: select pool by MAC when using double VLAN Wenzhuo Lu
2016-01-29  7:03 ` [dpdk-dev] [PATCH 2/8] lib/librte_ether: support l2 tunnel config Wenzhuo Lu
2016-01-29  7:03 ` [dpdk-dev] [PATCH 3/8] ixgbe: " Wenzhuo Lu
2016-01-29  7:03 ` [dpdk-dev] [PATCH 4/8] app/testpmd: add CLIs for " Wenzhuo Lu
2016-01-29  7:03 ` [dpdk-dev] [PATCH 5/8] lib/librte_ether: support new l2 tunnel operation Wenzhuo Lu
2016-01-29  7:03 ` [dpdk-dev] [PATCH 6/8] ixgbe: support " Wenzhuo Lu
2016-01-29  7:03 ` [dpdk-dev] [PATCH 7/8] app/testpmd: add CLIs for E-tag operation Wenzhuo Lu
2016-01-29  7:03 ` [dpdk-dev] [PATCH 8/8] doc: add release note for E-tag Wenzhuo Lu
2016-02-01 16:15   ` Mcnamara, John
2016-01-29  7:16 ` [dpdk-dev] [PATCH 0/8] support E-tag offloading and forwarding on Intel X550 NIC Qiu, Michael
2016-02-01  1:04   ` Lu, Wenzhuo
2016-02-01  1:39     ` Yuanhan Liu
2016-02-01  1:56       ` Lu, Wenzhuo
2016-02-01  2:06         ` Yuanhan Liu
2016-02-01  3:00           ` Lu, Wenzhuo
2016-02-01  8:31       ` Qiu, Michael
2016-02-02  1:24         ` Lu, Wenzhuo
2016-02-02  6:56 ` [dpdk-dev] [PATCH v2 0/7] " Wenzhuo Lu
2016-02-02  6:56   ` [dpdk-dev] [PATCH v2 1/7] ixgbe: select pool by MAC when using double VLAN Wenzhuo Lu
2016-02-02  6:57   ` [dpdk-dev] [PATCH v2 2/7] lib/librte_ether: support l2 tunnel config Wenzhuo Lu
2016-02-02 12:03     ` Bruce Richardson
2016-02-03  1:05       ` Lu, Wenzhuo
2016-02-03  3:36     ` Stephen Hemminger
2016-02-03  8:08       ` Lu, Wenzhuo
2016-02-02  6:57   ` [dpdk-dev] [PATCH v2 3/7] ixgbe: " Wenzhuo Lu
2016-02-02  6:57   ` [dpdk-dev] [PATCH v2 4/7] app/testpmd: add CLIs for " Wenzhuo Lu
2016-02-02  6:57   ` [dpdk-dev] [PATCH v2 5/7] lib/librte_ether: support new l2 tunnel operation Wenzhuo Lu
2016-02-02  6:57   ` [dpdk-dev] [PATCH v2 6/7] ixgbe: support " Wenzhuo Lu
2016-02-02  6:57   ` [dpdk-dev] [PATCH v2 7/7] app/testpmd: add CLIs for E-tag operation Wenzhuo Lu
2016-02-12 13:50   ` [dpdk-dev] [PATCH v2 0/7] support E-tag offloading and forwarding on Intel X550 NIC De Lara Guarch, Pablo
2016-02-15  1:21     ` Lu, Wenzhuo
2016-02-15  9:39       ` De Lara Guarch, Pablo
2016-02-16  8:20 ` [dpdk-dev] [PATCH v3 " Wenzhuo Lu
2016-02-16  8:20   ` [dpdk-dev] [PATCH v3 1/7] ixgbe: select pool by MAC when using double VLAN Wenzhuo Lu
2016-02-16  8:20   ` [dpdk-dev] [PATCH v3 2/7] lib/librte_ether: support l2 tunnel config Wenzhuo Lu
2016-02-16  8:20   ` [dpdk-dev] [PATCH v3 3/7] ixgbe: " Wenzhuo Lu
2016-02-16  8:20   ` [dpdk-dev] [PATCH v3 4/7] app/testpmd: add CLIs for " Wenzhuo Lu
2016-02-16  8:20   ` [dpdk-dev] [PATCH v3 5/7] lib/librte_ether: support new l2 tunnel operation Wenzhuo Lu
2016-02-16  8:20   ` [dpdk-dev] [PATCH v3 6/7] ixgbe: support " Wenzhuo Lu
2016-02-16  8:20   ` [dpdk-dev] [PATCH v3 7/7] app/testpmd: add CLIs for E-tag operation Wenzhuo Lu
2016-02-18  2:46 ` [dpdk-dev] [PATCH v4 0/7] support E-tag offloading and forwarding on Intel X550 NIC Wenzhuo Lu
2016-02-18  2:46   ` [dpdk-dev] [PATCH v4 1/7] ixgbe: select pool by MAC when using double VLAN Wenzhuo Lu
2016-02-18  2:46   ` [dpdk-dev] [PATCH v4 2/7] lib/librte_ether: support l2 tunnel config Wenzhuo Lu
2016-02-18  2:46   ` [dpdk-dev] [PATCH v4 3/7] ixgbe: " Wenzhuo Lu
2016-03-04  1:47     ` He, Shaopeng [this message]
2016-03-04  3:17       ` Lu, Wenzhuo
2016-02-18  2:46   ` [dpdk-dev] [PATCH v4 4/7] app/testpmd: add CLIs for " Wenzhuo Lu
2016-02-18  2:46   ` [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new l2 tunnel operation Wenzhuo Lu
2016-03-04  1:47     ` He, Shaopeng
2016-03-04  3:31       ` Lu, Wenzhuo
2016-03-07  2:04         ` He, Shaopeng
2016-02-18  2:46   ` [dpdk-dev] [PATCH v4 6/7] ixgbe: support " Wenzhuo Lu
2016-03-04  1:46     ` He, Shaopeng
2016-03-04  3:15       ` Lu, Wenzhuo
2016-02-18  2:46   ` [dpdk-dev] [PATCH v4 7/7] app/testpmd: add CLIs for E-tag operation Wenzhuo Lu
2016-03-04  1:46     ` He, Shaopeng
2016-03-04  3:11       ` Lu, Wenzhuo
2016-03-04  9:23   ` [dpdk-dev] [PATCH v4 0/7] support E-tag offloading and forwarding on Intel X550 NIC Liu, Yong
2016-03-07  2:42 ` [dpdk-dev] [PATCH v5 0/7] support E-tag offloading and forwarding on X550 Wenzhuo Lu
2016-03-07  2:42   ` [dpdk-dev] [PATCH v5 1/7] ixgbe: select pool by MAC when using double VLAN Wenzhuo Lu
2016-03-07  2:42   ` [dpdk-dev] [PATCH v5 2/7] lib/librte_ether: support l2 tunnel config Wenzhuo Lu
2016-03-07  2:42   ` [dpdk-dev] [PATCH v5 3/7] ixgbe: " Wenzhuo Lu
2016-03-07  2:42   ` [dpdk-dev] [PATCH v5 4/7] app/testpmd: add CLIs for " Wenzhuo Lu
2016-03-07  2:42   ` [dpdk-dev] [PATCH v5 5/7] lib/librte_ether: support new l2 tunnel operation Wenzhuo Lu
2016-03-07  3:29     ` Wu, Jingjing
2016-03-07  5:29       ` Lu, Wenzhuo
2016-03-07  2:42   ` [dpdk-dev] [PATCH v5 6/7] ixgbe: support " Wenzhuo Lu
2016-03-07  2:42   ` [dpdk-dev] [PATCH v5 7/7] app/testpmd: add CLIs for E-tag operation Wenzhuo Lu
2016-03-08  6:53 ` [dpdk-dev] [PATCH v6 0/5] support E-tag offloading and forwarding on X550 Wenzhuo Lu
2016-03-08  6:53   ` [dpdk-dev] [PATCH v6 1/5] ixgbe: select pool by MAC when using double VLAN Wenzhuo Lu
2016-03-08  6:53   ` [dpdk-dev] [PATCH v6 2/5] lib/librte_ether: support l2 tunnel operations Wenzhuo Lu
2016-03-09  0:14     ` Thomas Monjalon
2016-03-09  1:15       ` Lu, Wenzhuo
2016-03-09  9:27         ` Thomas Monjalon
2016-03-10  0:54           ` Lu, Wenzhuo
2016-03-08  6:53   ` [dpdk-dev] [PATCH v6 3/5] ixgbe: " Wenzhuo Lu
2016-03-08  6:53   ` [dpdk-dev] [PATCH v6 4/5] app/testpmd: add CLIs for l2 tunnel config Wenzhuo Lu
2016-03-08  6:53   ` [dpdk-dev] [PATCH v6 5/5] app/testpmd: add CLIs for E-tag operation Wenzhuo Lu
2016-03-08  8:08   ` [dpdk-dev] [PATCH v6 0/5] support E-tag offloading and forwarding on X550 Wu, Jingjing
2016-03-09  7:44 ` [dpdk-dev] [PATCH v7 " Wenzhuo Lu
2016-03-09  7:44   ` [dpdk-dev] [PATCH v7 1/5] ixgbe: select pool by MAC when using double VLAN Wenzhuo Lu
2016-03-09  7:44   ` [dpdk-dev] [PATCH v7 2/5] lib/librte_ether: support l2 tunnel operations Wenzhuo Lu
2016-03-09  7:44   ` [dpdk-dev] [PATCH v7 3/5] ixgbe: " Wenzhuo Lu
2016-03-09  7:44   ` [dpdk-dev] [PATCH v7 4/5] app/testpmd: add CLIs for l2 tunnel config Wenzhuo Lu
2016-03-09  7:44   ` [dpdk-dev] [PATCH v7 5/5] app/testpmd: add CLIs for E-tag operation Wenzhuo Lu
2016-03-09 10:07   ` [dpdk-dev] [PATCH v7 0/5] support E-tag offloading and forwarding on X550 Thomas Monjalon
2016-03-10  0:44     ` Lu, Wenzhuo
2016-03-11  1:10 ` [dpdk-dev] [PATCH v8 " Wenzhuo Lu
2016-03-11  1:10   ` [dpdk-dev] [PATCH v8 1/5] ixgbe: select pool by MAC when using double VLAN Wenzhuo Lu
2016-03-11  1:10   ` [dpdk-dev] [PATCH v8 2/5] lib/librte_ether: support l2 tunnel operations Wenzhuo Lu
2016-03-11  1:10   ` [dpdk-dev] [PATCH v8 3/5] ixgbe: " Wenzhuo Lu
2016-03-11  1:10   ` [dpdk-dev] [PATCH v8 4/5] app/testpmd: add CLIs for l2 tunnel config Wenzhuo Lu
2016-03-11  1:10   ` [dpdk-dev] [PATCH v8 5/5] app/testpmd: add CLIs for E-tag operation Wenzhuo Lu
2016-03-11 22:27   ` [dpdk-dev] [PATCH v8 0/5] support E-tag offloading and forwarding on X550 Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FB82FCC69332B84596FE0CEC3C131094C23D4F@shsmsx102.ccr.corp.intel.com \
    --to=shaopeng.he@intel.com \
    --cc=dev@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).