Skip to contentSkip to conversation

do deprecation in 2.1

PATCH Superseded Stephen Hemminger 5 participants 10 messages Jun 12, 2015 – Jun 15, 2015 Network drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover do deprecation in 2.1

From: Stephen Hemminger <[email protected]>

For features that were correctly marked as deprecated in rte_ring and kni in 2.0, go ahead and remove them in 2.1

The ACL deprecation was only a comment, so mark those functions as deprecated (instead or removing right now), to allow users to see the problem.

Stephen Hemminger (3):
rte_ring: remove deprecated functions
kni: remove deprecated functions
acl: mark deprecated functions

 app/test/Makefile                         |  8 ++---
 app/test/test_kni.c                       | 36 --------------------
 drivers/net/ring/rte_eth_ring.c           | 55 -------------------------------
 drivers/net/ring/rte_eth_ring_version.map |  2 --
 lib/librte_acl/rte_acl.h                  |  4 +--
 lib/librte_kni/rte_kni.c                  | 50 ----------------------------
 lib/librte_kni/rte_kni.h                  | 54 ------------------------------
 7 files changed, 6 insertions(+), 203 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/3 rte_ring: remove deprecated functions

From: Stephen Hemminger <[email protected]>

These were deprecated in 2.0 so remove them from 2.1

---
 drivers/net/ring/rte_eth_ring.c           | 55 -------------------------------
 drivers/net/ring/rte_eth_ring_version.map |  2 --
 2 files changed, 57 deletions(-)
drivers/net/ring/rte_eth_ring.c +0 -55
index 6832f01..3dd96ca 100644
@@ -390,61 +390,6 @@ eth_dev_ring_create(const char *name, const unsigned numa_node,
 	return 0;
 }
 
-
-static int
-eth_dev_ring_pair_create(const char *name, const unsigned numa_node,
-		enum dev_action action)
-{
-	/* rx and tx are so-called from point of view of first port.
-	 * They are inverted from the point of view of second port
-	 */
-	struct rte_ring *rx[RTE_PMD_RING_MAX_RX_RINGS];
-	struct rte_ring *tx[RTE_PMD_RING_MAX_TX_RINGS];
-	unsigned i;
-	char rx_rng_name[RTE_RING_NAMESIZE];
-	char tx_rng_name[RTE_RING_NAMESIZE];
-	unsigned num_rings = RTE_MIN(RTE_PMD_RING_MAX_RX_RINGS,
-			RTE_PMD_RING_MAX_TX_RINGS);
-
-	for (i = 0; i < num_rings; i++) {
-		snprintf(rx_rng_name, sizeof(rx_rng_name), "ETH_RX%u_%s", i, name);
-		rx[i] = (action == DEV_CREATE) ?
-				rte_ring_create(rx_rng_name, 1024, numa_node,
-						RING_F_SP_ENQ|RING_F_SC_DEQ) :
-				rte_ring_lookup(rx_rng_name);
-		if (rx[i] == NULL)
-			return -1;
-		snprintf(tx_rng_name, sizeof(tx_rng_name), "ETH_TX%u_%s", i, name);
-		tx[i] = (action == DEV_CREATE) ?
-				rte_ring_create(tx_rng_name, 1024, numa_node,
-						RING_F_SP_ENQ|RING_F_SC_DEQ):
-				rte_ring_lookup(tx_rng_name);
-		if (tx[i] == NULL)
-			return -1;
-	}
-
-	if (rte_eth_from_rings(rx_rng_name, rx, num_rings, tx, num_rings,
-			numa_node) || rte_eth_from_rings(tx_rng_name, tx, num_rings, rx,
-					num_rings, numa_node))
-		return -1;
-
-	return 0;
-}
-
-int
-rte_eth_ring_pair_create(const char *name, const unsigned numa_node)
-{
-	RTE_LOG(WARNING, PMD, "rte_eth_ring_pair_create is deprecated\n");
-	return eth_dev_ring_pair_create(name, numa_node, DEV_CREATE);
-}
-
-int
-rte_eth_ring_pair_attach(const char *name, const unsigned numa_node)
-{
-	RTE_LOG(WARNING, PMD, "rte_eth_ring_pair_attach is deprecated\n");
-	return eth_dev_ring_pair_create(name, numa_node, DEV_ATTACH);
-}
-
 struct node_action_pair {
 	char name[PATH_MAX];
 	unsigned node;
drivers/net/ring/rte_eth_ring_version.map +0 -2
index 8ad107d..0875e25 100644
@@ -2,8 +2,6 @@ DPDK_2.0 {
 	global:
 
 	rte_eth_from_rings;
-	rte_eth_ring_pair_attach;
-	rte_eth_ring_pair_create;
 
 	local: *;
 };
Signature · 1 line
2.1.4
#6 lore raw

PATCH 2/3 kni: remove deprecated functions

In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>

These functions were tagged as deprecated in 2.0 so they can be removed in 2.1

---
 app/test/Makefile        |  6 ------
 app/test/test_kni.c      | 36 --------------------------------
 lib/librte_kni/rte_kni.c | 50 --------------------------------------------
 lib/librte_kni/rte_kni.h | 54 ------------------------------------------------
 4 files changed, 146 deletions(-)
app/test/Makefile +0 -6
index 3c777bf..81bd226 100644
@@ -142,12 +142,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
-# Disable warnings of deprecated-declarations in test_kni.c
-ifeq ($(CC), icc)
-CFLAGS_test_kni.o += -wd1478
-else
-CFLAGS_test_kni.o += -Wno-deprecated-declarations
-endif
 CFLAGS += -D_GNU_SOURCE
 
 # Disable VTA for memcpy test
app/test/test_kni.c +0 -36
index 506b543..9dad988 100644
@@ -398,17 +398,6 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp)
 		printf("fail to create kni\n");
 		return -1;
 	}
-	if (rte_kni_get_port_id(kni) != port_id) {
-		printf("fail to get port id\n");
-		ret = -1;
-		goto fail_kni;
-	}
-
-	if (rte_kni_info_get(RTE_MAX_ETHPORTS)) {
-		printf("Unexpectedly get a KNI successfully\n");
-		ret = -1;
-		goto fail_kni;
-	}
 
 	test_kni_ctx = kni;
 	test_kni_processing_flag = 0;
@@ -591,14 +580,6 @@ test_kni(void)
 		goto fail;
 	}
 
-	/* test of getting port id according to NULL kni context */
-	if (rte_kni_get_port_id(NULL) < RTE_MAX_ETHPORTS) {
-		ret = -1;
-		printf("unexpectedly get port id successfully by NULL kni "
-								"pointer\n");
-		goto fail;
-	}
-
 	/* test of releasing NULL kni context */
 	ret = rte_kni_release(NULL);
 	if (ret == 0) {
@@ -645,23 +626,6 @@ test_kni(void)
 		goto fail;
 	}
 
-	/* test the interface of creating a KNI, for backward compatibility */
-	memset(&ops, 0, sizeof(ops));
-	ops = kni_ops;
-	kni = rte_kni_create(port_id, MAX_PACKET_SZ, mp, &ops);
-	if (!kni) {
-		ret = -1;
-		printf("Fail to create a KNI device for port %d\n", port_id);
-		goto fail;
-	}
-
-	ret = rte_kni_release(kni);
-	if (ret < 0) {
-		printf("Fail to release a KNI device\n");
-		goto fail;
-	}
-
-	ret = 0;
 
 fail:
 	rte_eth_dev_stop(port_id);
lib/librte_kni/rte_kni.c +0 -50

68 lines not on this page · raw message

lib/librte_kni/rte_kni.h +0 -54

72 lines not on this page · raw message

Signature · 1 line
2.1.4
#9 lore raw

PATCH 3/3 acl: mark deprecated functions

In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>

To allow for compatiablity with later releases, any functions to be removed should be marked as deprecated for one release.

---
 app/test/Makefile        | 8 +++++++-
 lib/librte_acl/rte_acl.h | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)
app/test/Makefile +7 -1
index 81bd226..061a83d 100644
@@ -141,9 +141,15 @@ SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
-
 CFLAGS += -D_GNU_SOURCE
 
+# Disable warnings of deprecated-declarations in test_acl.c
+ifeq ($(CC), icc)
+CFLAGS_test_acl.o += -wd1478
+else
+CFLAGS_test_acl.o += -Wno-deprecated-declarations
+endif
+
 # Disable VTA for memcpy test
 ifeq ($(CC), gcc)
 ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
lib/librte_acl/rte_acl.h +2 -2
index 3a93730..0c32df0 100644
@@ -456,7 +456,7 @@ enum {
 int
 rte_acl_ipv4vlan_add_rules(struct rte_acl_ctx *ctx,
 	const struct rte_acl_ipv4vlan_rule *rules,
-	uint32_t num);
+	uint32_t num) __attribute__((deprecated));
 
 /**
  * Analyze set of ipv4vlan rules and build required internal
@@ -478,7 +478,7 @@ rte_acl_ipv4vlan_add_rules(struct rte_acl_ctx *ctx,
 int
 rte_acl_ipv4vlan_build(struct rte_acl_ctx *ctx,
 	const uint32_t layout[RTE_ACL_IPV4VLAN_NUM],
-	uint32_t num_categories);
+	uint32_t num_categories) __attribute__((deprecated));
 
 
 #ifdef __cplusplus
Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH 1/3] rte_ring: remove deprecated functions

In reply to Stephen Hemminger
Quoted 10 lines · Stephen Hemminger

From: Stephen Hemminger <[email protected]>

These were deprecated in 2.0 so remove them from 2.1

---
  drivers/net/ring/rte_eth_ring.c           | 55 -------------------------------
  drivers/net/ring/rte_eth_ring_version.map |  2 --
  2 files changed, 57 deletions(-)

[...]

drivers/net/ring/rte_eth_ring_version.map DPDK_2.0 { · line 7

Quoted 13 lines
drivers/net/ring/rte_eth_ring_version.map +0 -2
index 8ad107d..0875e25 100644
@@ -2,8 +2,6 @@ DPDK_2.0 {
  	global:
 
  	rte_eth_from_rings;
-	rte_eth_ring_pair_attach;
-	rte_eth_ring_pair_create;
 
  	local: *;
  };

Removing symbols is an ABI break so it additionally requires a soname bump for this library.

In addition, simply due to being the first library to do so, it'll also then break the combined shared library as is currently is. Mind you, this is not an objection at all, the need to change to a linker script approach has always been a matter of time.

- Panu -

#7 lore raw

Re: [PATCH 2/3] kni: remove deprecated functions

In reply to Stephen Hemminger
Quoted 13 lines · Stephen Hemminger

From: Stephen Hemminger <[email protected]>

These functions were tagged as deprecated in 2.0 so they can be removed in 2.1

---
  app/test/Makefile        |  6 ------
  app/test/test_kni.c      | 36 --------------------------------
  lib/librte_kni/rte_kni.c | 50 --------------------------------------------
  lib/librte_kni/rte_kni.h | 54 ------------------------------------------------
  4 files changed, 146 deletions(-)

[...]

Quoted 70 lines
lib/librte_kni/rte_kni.h +0 -47
index 603e2cd..f65ce24 100644
@@ -129,30 +129,6 @@ extern struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
  				     struct rte_kni_ops *ops);
 
  /**
- * It create a KNI device for specific port.
- *
- * Note: It is deprecated and just for backward compatibility.
- *
- * @param port_id
- *  Port ID.
- * @param mbuf_size
- *  mbuf size.
- * @param pktmbuf_pool
- *  The mempool for allocting mbufs for packets.
- * @param ops
- *  The pointer to the callbacks for the KNI kernel requests.
- *
- * @return
- *  - The pointer to the context of a KNI interface.
- *  - NULL indicate error.
- */
-extern struct rte_kni *rte_kni_create(uint8_t port_id,
-				      unsigned mbuf_size,
-				      struct rte_mempool *pktmbuf_pool,
-				      struct rte_kni_ops *ops) \
-				      __attribute__ ((deprecated));
-
-/**
   * Release KNI interface according to the context. It will also release the
   * paired KNI interface in kernel space. All processing on the specific KNI
   * context need to be stopped before calling this interface.
@@ -221,21 +197,6 @@ extern unsigned rte_kni_tx_burst(struct rte_kni *kni,
  		struct rte_mbuf **mbufs, unsigned num);
 
  /**
- * Get the port id from KNI interface.
- *
- * Note: It is deprecated and just for backward compatibility.
- *
- * @param kni
- *  The KNI interface context.
- *
- * @return
- *  On success: The port id.
- *  On failure: ~0x0
- */
-extern uint8_t rte_kni_get_port_id(struct rte_kni *kni) \
-				__attribute__ ((deprecated));
-
-/**
   * Get the KNI context of its name.
   *
   * @param name
@@ -248,21 +209,6 @@ extern uint8_t rte_kni_get_port_id(struct rte_kni *kni) \
  extern struct rte_kni *rte_kni_get(const char *name);
 
  /**
- * Get the KNI context of the specific port.
- *
- * Note: It is deprecated and just for backward compatibility.
- *
- * @param port_id
- *  the port id.
- *
- * @return

lib/librte_kni/rte_kni.h extern uint8_t rte_kni_get_port_id(struct rte_kni *kni) \ · line 214

Quoted 10 lines
lib/librte_kni/rte_kni.h +0 -7
- *  On success: Pointer to KNI interface.
- *  On failure: NULL
- */
-extern struct rte_kni *rte_kni_info_get(uint8_t port_id) \
-				__attribute__ ((deprecated));
-
-/**
   * Register KNI request handling for a specified port,and it can
   * be called by master process or slave process.
   *

These symbols need to be removed from rte_kni_version.map too, and since its an ABI break, the library soname needs a bump as well.

- Panu -

#3 lore raw

Re: [PATCH 1/3] rte_ring: remove deprecated functions

In reply to Panu Matilainen
Quoted 29 lines · Panu Matilainen
Quoted 10 lines · Stephen Hemminger

From: Stephen Hemminger <[email protected]>

These were deprecated in 2.0 so remove them from 2.1

---
 drivers/net/ring/rte_eth_ring.c           | 55 -------------------------------
 drivers/net/ring/rte_eth_ring_version.map |  2 --
 2 files changed, 57 deletions(-)

[...]

drivers/net/ring/rte_eth_ring_version.map DPDK_2.0 { · line 7

Quoted 13 lines
drivers/net/ring/rte_eth_ring_version.map +0 -2
index 8ad107d..0875e25 100644
@@ -2,8 +2,6 @@ DPDK_2.0 {
 	global:
 
 	rte_eth_from_rings;
-	rte_eth_ring_pair_attach;
-	rte_eth_ring_pair_create;
 
 	local: *;
 };

Removing symbols is an ABI break so it additionally requires a soname bump for this library.

Quoted 7 lines

In addition, simply due to being the first library to do so, it'll also then break the combined shared library as is currently is. Mind you, this is not an objection at all, the need to change to a linker script approach has always been a matter of time.

- Panu -

Also, patch title should be prefixed with "ring pmd" or "drivers/net/ring" rather than rte_ring, since this is a patch for the ring pmd, not the rte_ring library.

/Bruce

#4 lore raw

Re: [PATCH 1/3] rte_ring: remove deprecated functions

2015-06-12 15:00, Bruce Richardson:

Quoted 4 lines · Panu Matilainen
Quoted 1 line · Stephen Hemminger

Also, patch title should be prefixed with "ring pmd" or "drivers/net/ring" rather than rte_ring, since this is a patch for the ring pmd, not the rte_ring library.

Previously, there was no difference, it was only "ring".
Prefixes don't include full path nor "pmd".
Is it really important to make a difference in the commit title between ring lib and ring pmd?

#5 lore raw

Re: [PATCH 1/3] rte_ring: remove deprecated functions

Quoted 10 lines · Thomas Monjalon

2015-06-12 15:00, Bruce Richardson:

Quoted 4 lines · Panu Matilainen
Quoted 1 line · Stephen Hemminger

Also, patch title should be prefixed with "ring pmd" or "drivers/net/ring" rather than rte_ring, since this is a patch for the ring pmd, not the rte_ring library.

Previously, there was no difference, it was only "ring".
Prefixes don't include full path nor "pmd".
Is it really important to make a difference in the commit title between ring lib and ring pmd?

Not especially important, no.

However, if we are going to have prefixes to indicate what component is affected by a patch, they should at least be unique per component IMHO.

/Bruce

Acked-by on v1 2/3
#8 lore raw

Re: [PATCH 2/3] kni: remove deprecated functions

In reply to Stephen Hemminger
Quoted 9 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Friday, June 12, 2015 1:19 PM
To: [email protected]
Cc: Stephen Hemminger
Subject: [dpdk-dev] [PATCH 2/3] kni: remove deprecated functions

Quoted 5 lines

From: Stephen Hemminger <[email protected]>

These functions were tagged as deprecated in 2.0 so they can be removed in 2.1

Quoted 6 lines
---
 app/test/Makefile        |  6 ------
 app/test/test_kni.c      | 36 --------------------------------
 lib/librte_kni/rte_kni.c | 50 --------------------------------------------
 lib/librte_kni/rte_kni.h | 54 ------------------------------------------------
 4 files changed, 146 deletions(-)