DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v9 1/5] lib/librte_ether: change function name of tunnel port config
Date: Thu, 10 Mar 2016 10:42:10 +0800	[thread overview]
Message-ID: <1457577734-17842-2-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1457577734-17842-1-git-send-email-wenzhuo.lu@intel.com>

The names of function for tunnel port configuration are not
accurate. They're tunnel_add/del, better change them to
tunnel_port_add/del.
As it may be an ABI change if change the names directly, the
new functions are added but not remove the old ones. The old
ones will be removed in the next release after an ABI change
announcement.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 app/test-pmd/cmdline.c                 |  6 +++--
 examples/tep_termination/vxlan_setup.c |  2 +-
 lib/librte_ether/rte_ethdev.c          | 45 ++++++++++++++++++++++++++++++++++
 lib/librte_ether/rte_ethdev.h          | 42 +++++++++++++++++++++++++++----
 lib/librte_ether/rte_ether_version.map |  7 ++++++
 5 files changed, 94 insertions(+), 8 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 52e9f5f..0fae655 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6782,9 +6782,11 @@ cmd_tunnel_udp_config_parsed(void *parsed_result,
 		tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN;
 
 	if (!strcmp(res->what, "add"))
-		ret = rte_eth_dev_udp_tunnel_add(res->port_id, &tunnel_udp);
+		ret = rte_eth_dev_udp_tunnel_port_add(res->port_id,
+						      &tunnel_udp);
 	else
-		ret = rte_eth_dev_udp_tunnel_delete(res->port_id, &tunnel_udp);
+		ret = rte_eth_dev_udp_tunnel_port_delete(res->port_id,
+							 &tunnel_udp);
 
 	if (ret < 0)
 		printf("udp tunneling add error: (%s)\n", strerror(-ret));
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 51ad133..8836603 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -191,7 +191,7 @@ vxlan_port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	/* Configure UDP port for UDP tunneling */
 	tunnel_udp.udp_port = udp_port;
 	tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN;
-	retval = rte_eth_dev_udp_tunnel_add(port, &tunnel_udp);
+	retval = rte_eth_dev_udp_tunnel_port_add(port, &tunnel_udp);
 	if (retval < 0)
 		return retval;
 	rte_eth_macaddr_get(port, &ports_eth_addr[port]);
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 1257965..937b348 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1949,6 +1949,28 @@ rte_eth_dev_udp_tunnel_add(uint8_t port_id,
 }
 
 int
+rte_eth_dev_udp_tunnel_port_add(uint8_t port_id,
+				struct rte_eth_udp_tunnel *udp_tunnel)
+{
+	struct rte_eth_dev *dev;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	if (udp_tunnel == NULL) {
+		RTE_PMD_DEBUG_TRACE("Invalid udp_tunnel parameter\n");
+		return -EINVAL;
+	}
+
+	if (udp_tunnel->prot_type >= RTE_TUNNEL_TYPE_MAX) {
+		RTE_PMD_DEBUG_TRACE("Invalid tunnel type\n");
+		return -EINVAL;
+	}
+
+	dev = &rte_eth_devices[port_id];
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->udp_tunnel_port_add, -ENOTSUP);
+	return (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel);
+}
+
+int
 rte_eth_dev_udp_tunnel_delete(uint8_t port_id,
 			      struct rte_eth_udp_tunnel *udp_tunnel)
 {
@@ -1972,6 +1994,29 @@ rte_eth_dev_udp_tunnel_delete(uint8_t port_id,
 }
 
 int
+rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id,
+				   struct rte_eth_udp_tunnel *udp_tunnel)
+{
+	struct rte_eth_dev *dev;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (udp_tunnel == NULL) {
+		RTE_PMD_DEBUG_TRACE("Invalid udp_tunnel parameter\n");
+		return -EINVAL;
+	}
+
+	if (udp_tunnel->prot_type >= RTE_TUNNEL_TYPE_MAX) {
+		RTE_PMD_DEBUG_TRACE("Invalid tunnel type\n");
+		return -EINVAL;
+	}
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->udp_tunnel_port_del, -ENOTSUP);
+	return (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel);
+}
+
+int
 rte_eth_led_on(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 16da821..511df82 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -738,10 +738,14 @@ struct rte_fdir_conf {
 
 /**
  * UDP tunneling configuration.
+ * Used to config the UDP port for a type of tunnel.
+ * NICs need the UDP port to identify the tunnel type.
+ * Normally a type of tunnel has a default UDP port, this structure can be used
+ * in case if the users want to change or support more UDP port.
  */
 struct rte_eth_udp_tunnel {
-	uint16_t udp_port;
-	uint8_t prot_type;
+	uint16_t udp_port; /**< UDP port used for the tunnel. */
+	uint8_t prot_type; /**< Tunnel type. Defined in rte_eth_tunnel_type. */
 };
 
 /**
@@ -1261,6 +1265,14 @@ typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
 				struct rte_dev_eeprom_info *info);
 /**< @internal Program eeprom data  */
 
+typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
+					 struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Add tunneling UDP port */
+
+typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
+					 struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Delete tunneling UDP port */
+
 #ifdef RTE_NIC_BYPASS
 
 enum {
@@ -1443,6 +1455,10 @@ struct eth_dev_ops {
 	eth_timesync_read_time timesync_read_time;
 	/** Set the device clock time. */
 	eth_timesync_write_time timesync_write_time;
+	/** Add UDP tunnel port. */
+	eth_udp_tunnel_port_add_t udp_tunnel_port_add;
+	/** Del UDP tunnel port. */
+	eth_udp_tunnel_port_del_t udp_tunnel_port_del;
 };
 
 /**
@@ -3387,8 +3403,11 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id,
 			      struct rte_eth_rss_conf *rss_conf);
 
  /**
- * Add UDP tunneling port of an Ethernet device for filtering a specific
- * tunneling packet by UDP port number.
+ * Add UDP tunneling port for a specific type of tunnel.
+ * The packets with this UDP port will be identified as this type of tunnel.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to change or add more UDP port for the tunnel. So the offloading function
+ * can take effect on the packets with the sepcific UDP port.
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
@@ -3401,11 +3420,20 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id,
  *   - (-ENOTSUP) if hardware doesn't support tunnel type.
  */
 int
+rte_eth_dev_udp_tunnel_port_add(uint8_t port_id,
+				struct rte_eth_udp_tunnel *tunnel_udp);
+/* Deprecated.  @see rte_eth_dev_udp_tunnel_port_add. */
+__rte_deprecated int
 rte_eth_dev_udp_tunnel_add(uint8_t port_id,
 			   struct rte_eth_udp_tunnel *tunnel_udp);
 
  /**
- * Detete UDP tunneling port configuration of Ethernet device
+ * Delete UDP tunneling port a specific type of tunnel.
+ * The packets with this UDP port will not be identified as this type of tunnel
+ * any more.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to delete a UDP port for the tunnel. So the offloading function will not take
+ * effect on the packets with the sepcific UDP port.
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
@@ -3418,6 +3446,10 @@ rte_eth_dev_udp_tunnel_add(uint8_t port_id,
  *   - (-ENOTSUP) if hardware doesn't support tunnel type.
  */
 int
+rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id,
+				   struct rte_eth_udp_tunnel *tunnel_udp);
+/* Deprecated.  @see rte_eth_dev_udp_tunnel_port_delete. */
+__rte_deprecated int
 rte_eth_dev_udp_tunnel_delete(uint8_t port_id,
 			      struct rte_eth_udp_tunnel *tunnel_udp);
 
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index d8db24d..1b28e75 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -117,3 +117,10 @@ DPDK_2.2 {
 
 	local: *;
 };
+
+DPDK_16.04 {
+	global:
+
+	rte_eth_dev_udp_tunnel_port_add;
+	rte_eth_dev_udp_tunnel_port_delete;
+}DPDK_2.2;
-- 
1.9.3

  reply	other threads:[~2016-03-10  2:42 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
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   ` Wenzhuo Lu [this message]
2016-03-11 23:02     ` [dpdk-dev] [PATCH v9 1/5] lib/librte_ether: change function name of tunnel port config 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=1457577734-17842-2-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.org \
    /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).