DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Qiu, Michael" <michael.qiu@intel.com>
To: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/4] ixgbe: support UDP tunnel add/del
Date: Thu, 3 Mar 2016 06:57:48 +0000	[thread overview]
Message-ID: <533710CFB86FA344BFBF2D6802E6028622F5BD7A@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1452496044-17524-2-git-send-email-wenzhuo.lu@intel.com>

On 1/11/2016 3:08 PM, Wenzhuo Lu wrote:
> Add UDP tunnel add/del support on ixgbe. Now it only support
> VxLAN port configuration.
> Although the VxLAN port has a default value 4789, it can be
> changed. We support VxLAN port configuration to meet the
> change.
> Note, the default value of VxLAN port in ixgbe NICs is 0. So
> please set it when using VxLAN off-load.
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 93 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 93 insertions(+)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 4c4c6df..381cbad 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -337,6 +337,10 @@ 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_udp_tunnel_add(struct rte_eth_dev *dev,
> +				    struct rte_eth_udp_tunnel *udp_tunnel);
> +static int ixgbe_dev_udp_tunnel_del(struct rte_eth_dev *dev,
> +				    struct rte_eth_udp_tunnel *udp_tunnel);
>  
>  /*
>   * Define VF Stats MACRO for Non "cleared on read" register
> @@ -495,6 +499,8 @@ 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,
> +	.udp_tunnel_add       = ixgbe_dev_udp_tunnel_add,
> +	.udp_tunnel_del       = ixgbe_dev_udp_tunnel_del,
>  };
>  
>  /*
> @@ -6191,6 +6197,93 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev,
>  	return 0;
>  }
>  
> +#define DEFAULT_VXLAN_PORT 4789
> +
> +/* on x550, there's only one register for VxLAN UDP port.
> + * So, we cannot add or del the port. We only update it.
> + */
> +static int
> +ixgbe_update_vxlan_port(struct ixgbe_hw *hw,
> +			uint16_t port)
> +{
> +	IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, port);
> +	IXGBE_WRITE_FLUSH(hw);
> +
> +	return 0;
> +}
> +
> +/* Add UDP tunneling port */
> +static int
> +ixgbe_dev_udp_tunnel_add(struct rte_eth_dev *dev,
> +			 struct rte_eth_udp_tunnel *udp_tunnel)
> +{
> +	int ret = 0;
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +
> +	if (hw->mac.type != ixgbe_mac_X550 &&
> +	    hw->mac.type != ixgbe_mac_X550EM_x) {
> +		return -ENOTSUP;
> +	}
> +
> +	if (udp_tunnel == NULL)
> +		return -EINVAL;
> +
> +	switch (udp_tunnel->prot_type) {
> +	case RTE_TUNNEL_TYPE_VXLAN:
> +		/* cannot add a port, update the port value */
> +		ret = ixgbe_update_vxlan_port(hw, udp_tunnel->udp_port);
> +		break;
> +
> +	case RTE_TUNNEL_TYPE_GENEVE:
> +	case RTE_TUNNEL_TYPE_TEREDO:
> +		PMD_DRV_LOG(ERR, "Tunnel type is not supported now.");
> +		ret = -1;
> +		break;
> +
> +	default:
> +		PMD_DRV_LOG(ERR, "Invalid tunnel type");
> +		ret = -1;
> +		break;
> +	}
> +
> +	return ret;
> +}
> +
> +/* Remove UDP tunneling port */
> +static int
> +ixgbe_dev_udp_tunnel_del(struct rte_eth_dev *dev,
> +			 struct rte_eth_udp_tunnel *udp_tunnel)
> +{
> +	int ret = 0;
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +
> +	if (hw->mac.type != ixgbe_mac_X550 &&
> +	    hw->mac.type != ixgbe_mac_X550EM_x) {
> +		return -ENOTSUP;
> +	}
> +
> +	if (udp_tunnel == NULL)
> +		return -EINVAL;
> +
> +	switch (udp_tunnel->prot_type) {
> +	case RTE_TUNNEL_TYPE_VXLAN:
> +		/* cannot del the port, reset it to default */
> +		ret = ixgbe_update_vxlan_port(hw, DEFAULT_VXLAN_PORT);
> +		break;
> +	case RTE_TUNNEL_TYPE_GENEVE:
> +	case RTE_TUNNEL_TYPE_TEREDO:
> +		PMD_DRV_LOG(ERR, "Tunnel type is not supported now.");
> +		ret = -1;

Better to use the -EINVAL or other, mixed style always not good.

Thanks,
Michael
> +		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,


  parent reply	other threads:[~2016-03-03  6:57 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11  7:07 [dpdk-dev] [PATCH 0/4] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-01-11  7:07 ` [dpdk-dev] [PATCH 1/4] ixgbe: support UDP tunnel add/del Wenzhuo Lu
2016-01-11  7:40   ` Vincent JARDIN
2016-01-11  8:28     ` Lu, Wenzhuo
2016-01-11  8:41       ` Vincent JARDIN
2016-01-12 12:37       ` Thomas Monjalon
2016-01-13  2:50         ` Lu, Wenzhuo
2016-03-03  6:57   ` Qiu, Michael [this message]
2016-03-03  7:14     ` Lu, Wenzhuo
2016-01-11  7:07 ` [dpdk-dev] [PATCH 2/4] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-01-11  7:07 ` [dpdk-dev] [PATCH 3/4] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-01-11  7:07 ` [dpdk-dev] [PATCH 4/4] doc: update release note for VxLAN & NVGRE checksum off-load support Wenzhuo Lu
2016-01-12 13:44   ` Mcnamara, John
2016-01-13  2:52     ` Lu, Wenzhuo
2016-01-14  1:38 ` [dpdk-dev] [PATCH v2 0/6] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 1/6] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 2/6] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 3/6] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 4/6] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-02-04 20:16     ` Ananyev, Konstantin
2016-02-15  2:15       ` Lu, Wenzhuo
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 5/6] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-02-04 18:55     ` Ananyev, Konstantin
2016-02-15  5:32       ` Lu, Wenzhuo
2016-02-15 10:03         ` Thomas Monjalon
2016-02-15 13:15           ` Ananyev, Konstantin
2016-02-17  5:47             ` Lu, Wenzhuo
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 6/6] doc: update release note for VxLAN & NVGRE checksum off-load support Wenzhuo Lu
2016-02-18  3:17 ` [dpdk-dev] [PATCH v3 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-02-25 14:53     ` Ananyev, Konstantin
2016-02-26  1:34       ` Lu, Wenzhuo
2016-02-26  1:37       ` Lu, Wenzhuo
2016-02-26  8:35 ` [dpdk-dev] [PATCH v4 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-02  6:45 ` [dpdk-dev] [PATCH v5 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-02  8:56     ` Panu Matilainen
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-03  1:22 ` [dpdk-dev] [PATCH v6 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-03  9:51     ` Panu Matilainen
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-03 18:37   ` [dpdk-dev] [PATCH v6 0/5] Support VxLAN & NVGRE checksum off-load on X550 Ananyev, Konstantin
2016-03-04  2:35 ` [dpdk-dev] [PATCH v7 " Wenzhuo Lu
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-08 23:35     ` Thomas Monjalon
2016-03-09  0:53       ` Lu, Wenzhuo
2016-03-09  1:04         ` Thomas Monjalon
2016-03-09  1:25           ` Lu, Wenzhuo
2016-03-09  2:30             ` Lu, Wenzhuo
2016-03-09  9:32             ` Thomas Monjalon
2016-03-10  0:37               ` Lu, Wenzhuo
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-04  5:45   ` [dpdk-dev] [PATCH v7 0/5] Support VxLAN & NVGRE checksum off-load on X550 Liu, Yong
2016-03-04  9:24   ` Liu, Yong
2016-03-08 23:23   ` Thomas Monjalon
2016-03-09  0:33     ` Lu, Wenzhuo
2016-03-09  3:35 ` [dpdk-dev] [PATCH v8 " Wenzhuo Lu
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-09  9:48     ` Thomas Monjalon
2016-03-10  0:40       ` Lu, Wenzhuo
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-10  2:42 ` [dpdk-dev] [PATCH v9 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-11 23:02     ` Thomas Monjalon
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu

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=533710CFB86FA344BFBF2D6802E6028622F5BD7A@SHSMSX101.ccr.corp.intel.com \
    --to=michael.qiu@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).