remove code marked as deprecated in 2.0
v2 cover remove code marked as deprecated in 2.0
From: Stephen Hemminger <[email protected]>
The ring and KNI patches remove functions marked as deprecated.
I wanted to do the same thing for ACL but the those functions were not properly marked as deprecated in 2.0 so final removal will have to wait until 2.2.
Stephen Hemminger (3):
pmd_ring: remove deprecated functions
kni: remove deprecated functions
acl: mark deprecated functions
app/test/Makefile | 8 ++-- app/test/test_kni.c | 36 ----------------- doc/guides/prog_guide/kernel_nic_interface.rst | 2 - drivers/net/ring/rte_eth_ring.c | 55 -------------------------- drivers/net/ring/rte_eth_ring_version.map | 4 +- lib/librte_acl/rte_acl.h | 4 +- lib/librte_kni/rte_kni.c | 50 ----------------------- lib/librte_kni/rte_kni.h | 54 ------------------------- lib/librte_kni/rte_kni_version.map | 4 +- 9 files changed, 8 insertions(+), 209 deletions(-)
Signature · 1 line
2.1.4
PATCH v2 1/3 pmd_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 | 4 +-- 2 files changed, 1 insertion(+), 58 deletions(-)
drivers/net/ring/rte_eth_ring.c +0 -55
@@ -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 +1 -3
@@ -1,9 +1,7 @@ -DPDK_2.0 { +DPDK_2.1 { global: rte_eth_from_rings; - rte_eth_ring_pair_attach; - rte_eth_ring_pair_create; local: *; };
Signature · 1 line
2.1.4
PATCH v2 2/3 kni: remove deprecated functions
In reply to Stephen HemmingerFrom: Stephen Hemminger <[email protected]>
These functions were tagged as deprecated in 2.0 so they can be removed in 2.1
---
v2 - remove doc and version map references
app/test/Makefile | 6 --- app/test/test_kni.c | 36 ----------------- doc/guides/prog_guide/kernel_nic_interface.rst | 2 - lib/librte_kni/rte_kni.c | 50 ------------------------ lib/librte_kni/rte_kni.h | 54 -------------------------- lib/librte_kni/rte_kni_version.map | 4 +- 6 files changed, 1 insertion(+), 151 deletions(-)
app/test/Makefile +0 -6
@@ -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
@@ -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);
doc/guides/prog_guide/kernel_nic_interface.rst +0 -2
@@ -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).
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
lib/librte_kni/rte_kni_version.map +1 -3
@@ -1,13 +1,11 @@ -DPDK_2.0 { +DPDK_2.1 { global: rte_kni_alloc; rte_kni_close; rte_kni_create; rte_kni_get; - rte_kni_get_port_id; rte_kni_handle_request; - rte_kni_info_get; rte_kni_init; rte_kni_register_handlers; rte_kni_release;
Signature · 1 line
2.1.4
PATCH v2 3/3 acl: mark deprecated functions
In reply to Stephen HemmingerFrom: 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
@@ -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
@@ -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
Re: [PATCH 1/3] pmd_ring: remove deprecated functions
In reply to Stephen HemmingerQuoted 10 lines · Stephen Hemminger
From: Stephen Hemminger <[email protected]>
These were deprecated in 2.0 so remove them from 2.1
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/ring/rte_eth_ring.c | 55 ------------------------------- drivers/net/ring/rte_eth_ring_version.map | 4 +-- 2 files changed, 1 insertion(+), 58 deletions(-)
[..snip..]
Quoted 5 lines
drivers/net/ring/rte_eth_ring_version.map +0
-0
drivers/net/ring/rte_eth_ring_version.map line 7
Quoted 10 lines
drivers/net/ring/rte_eth_ring_version.map +1
-3@@ -1,9 +1,7 @@ -DPDK_2.0 { +DPDK_2.1 { global: rte_eth_from_rings; - rte_eth_ring_pair_attach; - rte_eth_ring_pair_create; local: *; };
[ABI newbie question] Is this how deprecating a fn is done? We no longer have any DPDK_2.0 version listings in the .map file?
Re: [PATCH 1/3] pmd_ring: remove deprecated functions
Quoted 25 lines · On Tue, 16 Jun 2015 14:52:16 +0100 Bruce Richardson…
Quoted 10 lines · Stephen Hemminger
From: Stephen Hemminger <[email protected]>
These were deprecated in 2.0 so remove them from 2.1
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/ring/rte_eth_ring.c | 55 ------------------------------- drivers/net/ring/rte_eth_ring_version.map | 4 +-- 2 files changed, 1 insertion(+), 58 deletions(-)[..snip..]
Quoted 13 lines
drivers/net/ring/rte_eth_ring_version.map +1
-3@@ -1,9 +1,7 @@ -DPDK_2.0 { +DPDK_2.1 { global: rte_eth_from_rings; - rte_eth_ring_pair_attach; - rte_eth_ring_pair_create;
Quoted 5 lines
drivers/net/ring/rte_eth_ring_version.map line 7
Quoted 2 lines
drivers/net/ring/rte_eth_ring_version.map +0
-0local: *; };[ABI newbie question] Is this how deprecating a fn is done? We no longer have any DPDK_2.0 version listings in the .map file?
Notice the version # changed as well, so linker will generate a new version. The function was marked deprecated in last version.
Re: [PATCH 1/3] pmd_ring: remove deprecated functions
2015-06-16 16:05, Stephen Hemminger:
Quoted 28 lines
Quoted 25 lines · On Tue, 16 Jun 2015 14:52:16 +0100 Bruce Richardson…
Quoted 10 lines · Stephen Hemminger
From: Stephen Hemminger <[email protected]>
These were deprecated in 2.0 so remove them from 2.1
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/ring/rte_eth_ring.c | 55 ------------------------------- drivers/net/ring/rte_eth_ring_version.map | 4 +-- 2 files changed, 1 insertion(+), 58 deletions(-)[..snip..]
Quoted 13 lines
drivers/net/ring/rte_eth_ring_version.map +1
-3@@ -1,9 +1,7 @@ -DPDK_2.0 { +DPDK_2.1 { global: rte_eth_from_rings; - rte_eth_ring_pair_attach; - rte_eth_ring_pair_create;
Quoted 8 lines
Quoted 5 lines
drivers/net/ring/rte_eth_ring_version.map line 7
Quoted 2 lines
drivers/net/ring/rte_eth_ring_version.map +0
-0local: *; };[ABI newbie question] Is this how deprecating a fn is done? We no longer have any DPDK_2.0 version listings in the .map file?
Notice the version # changed as well, so linker will generate a new version. The function was marked deprecated in last version.
What happens if you load the 2.1 lib with an app built for 2.0? Shouldn't we keep the DPDK_2.0 block?
Re: [PATCH 1/3] pmd_ring: remove deprecated functions
In reply to a message not in the archiveQuoted 35 lines · On Tue, 16 Jun 2015 23:37:32 +0000 Thomas Monjalon <[email protected]>…
2015-06-16 16:05, Stephen Hemminger:
Quoted 34 lines
Quoted 30 lines · On Tue, 16 Jun 2015 14:52:16 +0100 Bruce Richardson…
Quoted 10 lines · Stephen Hemminger
From: Stephen Hemminger <[email protected]>
These were deprecated in 2.0 so remove them from 2.1
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/ring/rte_eth_ring.c | 55 ------------------------------- drivers/net/ring/rte_eth_ring_version.map | 4 +-- 2 files changed, 1 insertion(+), 58 deletions(-)[..snip..]
Quoted 5 lines
drivers/net/ring/rte_eth_ring_version.map +0
-0drivers/net/ring/rte_eth_ring_version.map line 7
Quoted 10 lines
drivers/net/ring/rte_eth_ring_version.map +1
-3@@ -1,9 +1,7 @@ -DPDK_2.0 { +DPDK_2.1 { global: rte_eth_from_rings; - rte_eth_ring_pair_attach; - rte_eth_ring_pair_create; local: *; };[ABI newbie question] Is this how deprecating a fn is done? We no longer have any DPDK_2.0 version listings in the .map file?
Quoted 5 lines
Quoted 2 lines
Notice the version # changed as well, so linker will generate a new version. The function was marked deprecated in last version.
What happens if you load the 2.1 lib with an app built for 2.0? Shouldn't we keep the DPDK_2.0 block?
What happens is that build process makes a new version of DPDK package with a new version number. This version can co-exist on same system with old library (depends on library packaging).
Old library will have old functions, and old application will use old library. New applications will be have new so version and get the new library.
http://unix.stackexchange.com/questions/475/how-do-so-shared-object-numbers-work
If we didn't do this, nothing could ever really be removed!
Re: [PATCH 1/3] pmd_ring: remove deprecated functions
Quoted 51 lines · Stephen Hemminger
Quoted 35 lines · On Tue, 16 Jun 2015 23:37:32 +0000 Thomas Monjalon <[email protected]>…
2015-06-16 16:05, Stephen Hemminger:
Quoted 34 lines
Quoted 30 lines · On Tue, 16 Jun 2015 14:52:16 +0100 Bruce Richardson…
Quoted 10 lines · Stephen Hemminger
From: Stephen Hemminger <[email protected]>
These were deprecated in 2.0 so remove them from 2.1
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/ring/rte_eth_ring.c | 55 ------------------------------- drivers/net/ring/rte_eth_ring_version.map | 4 +-- 2 files changed, 1 insertion(+), 58 deletions(-)[..snip..]
Quoted 5 lines
drivers/net/ring/rte_eth_ring_version.map +0
-0drivers/net/ring/rte_eth_ring_version.map line 7
Quoted 10 lines
drivers/net/ring/rte_eth_ring_version.map +1
-3@@ -1,9 +1,7 @@ -DPDK_2.0 { +DPDK_2.1 { global: rte_eth_from_rings; - rte_eth_ring_pair_attach; - rte_eth_ring_pair_create; local: *; };[ABI newbie question] Is this how deprecating a fn is done? We no longer have any DPDK_2.0 version listings in the .map file?
Quoted 5 lines
Quoted 2 lines
Notice the version # changed as well, so linker will generate a new version. The function was marked deprecated in last version.
What happens if you load the 2.1 lib with an app built for 2.0? Shouldn't we keep the DPDK_2.0 block?
What happens is that build process makes a new version of DPDK package with a new version number. This version can co-exist on same system with old library (depends on library packaging).
Old library will have old functions, and old application will use old library. New applications will be have new so version and get the new library.
Quoted 3 lines
http://unix.stackexchange.com/questions/475/how-do-so-shared-object-numbers-work
If we didn't do this, nothing could ever really be removed!
Yes, soname bump is required when symbols are removed.
However that doesn't change the version the remaining symbols were introduced, eg rte_eth_from_rings() in this case, so AIUI you should leave the DPDK_2.0 {} block version alone. If new symbols get added in 2.1 then a new DPDK_2.1 block needs to be added for those.
- Panu -
Re: [PATCH 3/3] acl: mark deprecated functions
In reply to Stephen HemmingerQuoted 6 lines · 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.
Signed-off-by Stephen Hemminger <[email protected]>
[...]
Quoted 15 lines
lib/librte_acl/rte_acl.h +1
-1@@ -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
lib/librte_acl/rte_acl.h rte_acl_ipv4vlan_add_rules(struct rte_acl_ctx *ctx, · line 484
Quoted 8 lines
lib/librte_acl/rte_acl.h +1
-1@@ -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
I've no objections to the patch as such, but I think the ABI policy is asking all deprecation notices to be added to the "Deprecation Notices" section in the policy document itself.
That said, the average developer is MUCH likelier to notice the compiler warning from these than a deprecation notice in some "who reads those" document :) Perhaps we could generate a list of functions marked for removal for the ABI policy document automatically based on the deprecated attributes.
- Panu -
cover announce deprecation of functions commented as deprecated
In reply to Stephen HemmingerAs suugested by Stephen, some functions are marked as deprecated in the code and should now be removed.
Let's follow the deprecation process and announce it in the release notes.
Thomas Monjalon (3):
doc: announce legacy 7-tuple acl rule removal
doc: announce removal of kni functions using port id
doc: announce ring PMD functions removal
doc/guides/rel_notes/deprecation.rst | 10 ++++++++++ 1 file changed, 10 insertions(+)
Signature · 1 line
2.4.2
PATCH 1/3 doc: announce legacy 7-tuple acl rule removal
These functions are marked as deprecated for a long time. As suggested in this patch, it should be removed:
http://dpdk.org/ml/archives/dev/2015-June/019255.html
--- doc/guides/rel_notes/deprecation.rst | 4 ++++ 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +4 -0
@@ -71,6 +71,10 @@ Deprecation Notices * The scheduler statistics structure will change to allow keeping track of RED actions. +* librte_acl: The structure rte_acl_ipv4vlan_rule is deprecated and should + be removed as well as the associated functions rte_acl_ipv4vlan_add_rules + and rte_acl_ipv4vlan_build. + * librte_cfgfile: In order to allow for longer names and values, the value of macros CFG_NAME_LEN and CFG_NAME_VAL will be increased. Most likely, the new values will be 64 and 256, respectively.
Signature · 1 line
2.4.2
PATCH 2/3 doc: announce removal of kni functions using port id
In reply to Thomas MonjalonThese functions are marked as deprecated for a long time:
fbf895d44cfe ("kni: identify device by name")
As suggested in this patch, it should be removed:
http://dpdk.org/ml/archives/dev/2015-June/019254.html
--- doc/guides/rel_notes/deprecation.rst | 3 +++ 1 file changed, 3 insertions(+)
doc/guides/rel_notes/deprecation.rst +3 -0
@@ -58,6 +58,9 @@ 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). + * ABI changes are planned for struct virtio_net in order to support vhost-user multiple queues feature. It should be integrated in release 2.2 without backward compatibility.
Signature · 1 line
2.4.2
PATCH 3/3 doc: announce ring PMD functions removal
In reply to Thomas MonjalonThese functions are marked as deprecated for a long time:
61934c0956d4 ("ring: convert to use of PMD_REGISTER_DRIVER and fix linking")
As suggested in this patch, it should be removed:
http://dpdk.org/ml/archives/dev/2015-June/019253.html
--- doc/guides/rel_notes/deprecation.rst | 3 +++ 1 file changed, 3 insertions(+)
doc/guides/rel_notes/deprecation.rst +3 -0
@@ -61,6 +61,9 @@ Deprecation Notices * 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. + * ABI changes are planned for struct virtio_net in order to support vhost-user multiple queues feature. It should be integrated in release 2.2 without backward compatibility.
Signature · 1 line
2.4.2
Thomas Monjalon
AppliedRe: [PATCH 0/3] announce deprecation of functions commented as deprecated
In reply to Thomas Monjalon2015-08-17 00:51, Thomas Monjalon:
Quoted 8 lines
As suugested by Stephen, some functions are marked as deprecated in the code and should now be removed.
Let's follow the deprecation process and announce it in the release notes.Thomas Monjalon (3):
doc: announce legacy 7-tuple acl rule removal
doc: announce removal of kni functions using port id
doc: announce ring PMD functions removal
Applied