DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Cc: Stephen Hemminger <shemming@brocade.com>
Subject: [dpdk-dev] [PATCH v2 09/10] kni: remove deprecated functions
Date: Wed,  2 Sep 2015 15:16:42 +0200	[thread overview]
Message-ID: <1441199803-27055-10-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <1441199803-27055-1-git-send-email-thomas.monjalon@6wind.com>

From: Stephen Hemminger <shemming@brocade.com>

These functions were tagged as deprecated in 2.0 so they can be
removed in 2.2.
The library version is incremented.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Helin Zhang <helin.zhang@intel.com>
[Thomas: update doc and version]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
---
 app/test/Makefile                                 |  6 ---
 app/test/test_kni.c                               | 36 ---------------
 doc/guides/prog_guide/kernel_nic_interface.rst    |  2 -
 doc/guides/rel_notes/deprecation.rst              |  3 --
 doc/guides/rel_notes/release_2_2.rst              |  5 ++-
 doc/guides/sample_app_ug/kernel_nic_interface.rst |  9 ----
 lib/librte_kni/Makefile                           |  2 +-
 lib/librte_kni/rte_kni.c                          | 51 ---------------------
 lib/librte_kni/rte_kni.h                          | 54 -----------------------
 lib/librte_kni/rte_kni_version.map                |  3 --
 10 files changed, 5 insertions(+), 166 deletions(-)

diff --git a/app/test/Makefile b/app/test/Makefile
index e7f148f..7778e1c 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -146,12 +146,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
diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 506b543..9dad988 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -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);
diff --git a/doc/guides/prog_guide/kernel_nic_interface.rst b/doc/guides/prog_guide/kernel_nic_interface.rst
index 713d30b..0d91476 100644
--- a/doc/guides/prog_guide/kernel_nic_interface.rst
+++ b/doc/guides/prog_guide/kernel_nic_interface.rst
@@ -100,8 +100,6 @@ Refer to rte_kni_common.h in the DPDK source code for more details.
 
 The physical addresses will be re-mapped into the kernel address space and stored in separate KNI contexts.
 
-Once KNI interfaces are created, the KNI context information can be queried by calling the rte_kni_info_get() function.
-
 The KNI interfaces can be deleted by a DPDK application dynamically after being created.
 Furthermore, all those KNI interfaces not deleted will be deleted on the release operation
 of the miscellaneous device (when the DPDK application is closed).
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index e7e213c..04819fa 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -40,9 +40,6 @@ Deprecation Notices
   the tunnel type, TNI/VNI, inner MAC and inner VLAN are monitored.
   The release 2.2 will contain these changes without backwards compatibility.
 
-* librte_kni: Functions based on port id are deprecated for a long time and
-  should be removed (rte_kni_create, rte_kni_get_port_id and rte_kni_info_get).
-
 * librte_pmd_ring: The deprecated functions rte_eth_ring_pair_create and
   rte_eth_ring_pair_attach should be removed.
 
diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst
index 6e73092..6dcfe88 100644
--- a/doc/guides/rel_notes/release_2_2.rst
+++ b/doc/guides/rel_notes/release_2_2.rst
@@ -21,6 +21,9 @@ API Changes
 
 * The deprecated ACL API ipv4vlan is removed.
 
+* The deprecated KNI functions are removed:
+  rte_kni_create(), rte_kni_get_port_id() and rte_kni_info_get().
+
 
 ABI Changes
 -----------
@@ -56,7 +59,7 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_ip_frag.so.1
      librte_ivshmem.so.1
      librte_jobstats.so.1
-     librte_kni.so.1
+   + librte_kni.so.2
      librte_kvargs.so.1
    + librte_lpm.so.2
    + librte_mbuf.so.2
diff --git a/doc/guides/sample_app_ug/kernel_nic_interface.rst b/doc/guides/sample_app_ug/kernel_nic_interface.rst
index 02dde59..f1deca9 100644
--- a/doc/guides/sample_app_ug/kernel_nic_interface.rst
+++ b/doc/guides/sample_app_ug/kernel_nic_interface.rst
@@ -242,15 +242,6 @@ Setup of mbuf pool, driver and queues is similar to the setup done in the L2 For
 In addition, one or more kernel NIC interfaces are allocated for each
 of the configured ports according to the command line parameters.
 
-The code for creating the kernel NIC interface for a specific port is as follows:
-
-.. code-block:: c
-
-    kni = rte_kni_create(port, MAX_PACKET_SZ, pktmbuf_pool, &kni_ops);
-    if (kni == NULL)
-        rte_exit(EXIT_FAILURE, "Fail to create kni dev "
-           "for port: %d\n", port);
-
 The code for allocating the kernel NIC interfaces for a specific port is as follows:
 
 .. code-block:: c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index 7107832..1398164 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,7 +38,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
 
 EXPORT_MAP := rte_kni_version.map
 
-LIBABIVER := 1
+LIBABIVER := 2
 
 # all source are stored in SRCS-y
 SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 08155db..ea9baf4 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -311,31 +311,6 @@ kni_fail:
 			 max_kni_ifaces);
 }
 
-/* It is deprecated and just for backward compatibility */
-struct rte_kni *
-rte_kni_create(uint8_t port_id,
-	       unsigned mbuf_size,
-	       struct rte_mempool *pktmbuf_pool,
-	       struct rte_kni_ops *ops)
-{
-	struct rte_kni_conf conf;
-	struct rte_eth_dev_info info;
-
-	memset(&info, 0, sizeof(info));
-	memset(&conf, 0, sizeof(conf));
-	rte_eth_dev_info_get(port_id, &info);
-
-	snprintf(conf.name, sizeof(conf.name), "vEth%u", port_id);
-	conf.addr = info.pci_dev->addr;
-	conf.id = info.pci_dev->id;
-	conf.group_id = (uint16_t)port_id;
-	conf.mbuf_size = mbuf_size;
-
-	/* Save the port id for request handling */
-	ops->port_id = port_id;
-
-	return rte_kni_alloc(pktmbuf_pool, &conf, ops);
-}
 
 struct rte_kni *
 rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
@@ -650,16 +625,6 @@ kni_allocate_mbufs(struct rte_kni *kni)
 	}
 }
 
-/* It is deprecated and just for backward compatibility */
-uint8_t
-rte_kni_get_port_id(struct rte_kni *kni)
-{
-	if (!kni)
-		return ~0x0;
-
-	return kni->ops.port_id;
-}
-
 struct rte_kni *
 rte_kni_get(const char *name)
 {
@@ -686,22 +651,6 @@ rte_kni_get_name(const struct rte_kni *kni)
 	return kni->name;
 }
 
-/*
- * It is deprecated and just for backward compatibility.
- */
-struct rte_kni *
-rte_kni_info_get(uint8_t port_id)
-{
-	char name[RTE_MEMZONE_NAMESIZE];
-
-	if (port_id >= RTE_MAX_ETHPORTS)
-		return NULL;
-
-	snprintf(name, RTE_MEMZONE_NAMESIZE, "vEth%u", port_id);
-
-	return rte_kni_get(name);
-}
-
 static enum kni_ops_status
 kni_check_request_register(struct rte_kni_ops *ops)
 {
diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
index 52ffdb7..ef9faa9 100644
--- a/lib/librte_kni/rte_kni.h
+++ b/lib/librte_kni/rte_kni.h
@@ -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
@@ -258,21 +219,6 @@ extern struct rte_kni *rte_kni_get(const char *name);
 extern const char *rte_kni_get_name(const struct rte_kni *kni);
 
 /**
- * Get the KNI context of the specific port.
- *
- * Note: It is deprecated and just for backward compatibility.
- *
- * @param port_id
- *  the port id.
- *
- * @return
- *  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.
  *
diff --git a/lib/librte_kni/rte_kni_version.map b/lib/librte_kni/rte_kni_version.map
index a987d31..acd515e 100644
--- a/lib/librte_kni/rte_kni_version.map
+++ b/lib/librte_kni/rte_kni_version.map
@@ -3,12 +3,9 @@ DPDK_2.0 {
 
 	rte_kni_alloc;
 	rte_kni_close;
-	rte_kni_create;
 	rte_kni_get;
 	rte_kni_get_name;
-	rte_kni_get_port_id;
 	rte_kni_handle_request;
-	rte_kni_info_get;
 	rte_kni_init;
 	rte_kni_register_handlers;
 	rte_kni_release;
-- 
2.5.1

  parent reply	other threads:[~2015-09-02 13:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 20:18 [dpdk-dev] [PATCH 0/9] clean deprecated code Thomas Monjalon
2015-09-01 21:30 ` [dpdk-dev] [PATCH 1/9] ethdev: remove Rx interrupt switch Thomas Monjalon
2015-09-01 21:30 ` [dpdk-dev] [PATCH 2/9] mbuf: remove packet type from offload flags Thomas Monjalon
2015-09-01 21:30 ` [dpdk-dev] [PATCH 3/9] ethdev: remove SCTP flow entries switch Thomas Monjalon
2015-09-01 21:30 ` [dpdk-dev] [PATCH 4/9] eal: remove deprecated function Thomas Monjalon
2015-09-01 21:30 ` [dpdk-dev] [PATCH 5/9] mem: remove dummy malloc library Thomas Monjalon
2015-09-01 21:30 ` [dpdk-dev] [PATCH 6/9] lpm: remove deprecated field Thomas Monjalon
2015-09-01 21:31 ` [dpdk-dev] [PATCH 7/9] acl: remove old API Thomas Monjalon
2015-09-01 21:31 ` [dpdk-dev] [PATCH 8/9] kni: remove deprecated functions Thomas Monjalon
2015-09-01 21:31 ` [dpdk-dev] [PATCH 9/9] ring: " Thomas Monjalon
2015-09-01 22:10 ` [dpdk-dev] [PATCH 0/9] clean deprecated code Stephen Hemminger
2015-09-02 10:30 ` Neil Horman
2015-09-02 13:16 ` [dpdk-dev] [PATCH v2 00/10] " Thomas Monjalon
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 01/10] doc: init next release notes Thomas Monjalon
2015-09-03 15:39     ` Mcnamara, John
2015-09-03 15:44     ` Mcnamara, John
2015-09-04  7:50       ` Thomas Monjalon
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 02/10] ethdev: remove Rx interrupt switch Thomas Monjalon
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 03/10] mbuf: remove packet type from offload flags Thomas Monjalon
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 04/10] ethdev: remove SCTP flow entries switch Thomas Monjalon
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 05/10] eal: remove deprecated function Thomas Monjalon
2015-09-03 14:29     ` David Marchand
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 06/10] mem: remove dummy malloc library Thomas Monjalon
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 07/10] lpm: remove deprecated field Thomas Monjalon
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 08/10] acl: remove old API Thomas Monjalon
2015-09-02 15:59     ` Ananyev, Konstantin
2015-09-02 13:16   ` Thomas Monjalon [this message]
2015-09-02 13:16   ` [dpdk-dev] [PATCH v2 10/10] ring: remove deprecated functions Thomas Monjalon
2015-09-04  7:50   ` [dpdk-dev] [PATCH v2 00/10] clean deprecated code 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=1441199803-27055-10-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=shemming@brocade.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).