[dpdk-dev,v7,07/17] lib: apply symbol versioning to distibutor lib

Message ID 1487647073-129064-8-git-send-email-david.hunt@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail Compilation issues

Commit Message

Hunt, David Feb. 21, 2017, 3:17 a.m. UTC
  Note: LIBABIVER is also bumped up in the Makefile

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 lib/librte_distributor/rte_distributor.c           | 10 +++++++++-
 lib/librte_distributor/rte_distributor_v20.c       | 10 ++++++++++
 lib/librte_distributor/rte_distributor_version.map | 14 ++++++++++++++
 3 files changed, 33 insertions(+), 1 deletion(-)
  

Comments

Hunt, David Feb. 21, 2017, 11:50 a.m. UTC | #1
On 21/2/2017 3:17 AM, David Hunt wrote:
> Note: LIBABIVER is also bumped up in the Makefile
>
> Signed-off-by: David Hunt <david.hunt@intel.com>
> ---
>   lib/librte_distributor/rte_distributor.c           | 10 +++++++++-
>   lib/librte_distributor/rte_distributor_v20.c       | 10 ++++++++++
>   lib/librte_distributor/rte_distributor_version.map | 14 ++++++++++++++
>   3 files changed, 33 insertions(+), 1 deletion(-)
>
--snip--

The following is generated by checkpatch for this patch:

ERROR:SPACING: space required after that ',' (ctx:VxO)
#70: FILE: lib/librte_distributor/rte_distributor.c:105:
+BIND_DEFAULT_SYMBOL(rte_distributor_request_pkt,, 17.05);
                                                 ^

However, I also tried with a space:

ERROR:SPACING: space prohibited before that ',' (ctx:WxW)
#26: FILE: lib/librte_distributor/rte_distributor.c:105:
+BIND_DEFAULT_SYMBOL(rte_distributor_request_pkt, , 17.05);
                                                   ^
So in either case it seems it's not possible to make checkpatch happy.


Rgds,
Dave.
  
Bruce Richardson Feb. 24, 2017, 2:12 p.m. UTC | #2
On Tue, Feb 21, 2017 at 03:17:43AM +0000, David Hunt wrote:
> Note: LIBABIVER is also bumped up in the Makefile
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>
> ---
>  lib/librte_distributor/rte_distributor.c           | 10 +++++++++-
>  lib/librte_distributor/rte_distributor_v20.c       | 10 ++++++++++
>  lib/librte_distributor/rte_distributor_version.map | 14 ++++++++++++++
>  3 files changed, 33 insertions(+), 1 deletion(-)
> 
In my sanity checks this breaks the build with shared libs. Please
investigate.

Regards,
/Bruce
  

Patch

diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
index b8e171c..2dc7738 100644
--- a/lib/librte_distributor/rte_distributor.c
+++ b/lib/librte_distributor/rte_distributor.c
@@ -43,7 +43,6 @@ 
 #include <rte_compat.h>
 #include "rte_distributor_private.h"
 #include "rte_distributor.h"
-#include "rte_distributor_v1705.h"
 #include "rte_distributor_v20.h"
 
 TAILQ_HEAD(rte_dist_burst_list, rte_distributor);
@@ -103,6 +102,7 @@  rte_distributor_request_pkt(struct rte_distributor *d,
 	 */
 	*retptr64 |= RTE_DISTRIB_GET_BUF;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_request_pkt,, 17.05);
 
 int
 rte_distributor_poll_pkt(struct rte_distributor *d,
@@ -139,6 +139,7 @@  rte_distributor_poll_pkt(struct rte_distributor *d,
 
 	return count;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_poll_pkt,, 17.05);
 
 int
 rte_distributor_get_pkt(struct rte_distributor *d,
@@ -169,6 +170,7 @@  rte_distributor_get_pkt(struct rte_distributor *d,
 	}
 	return count;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_get_pkt,, 17.05);
 
 int
 rte_distributor_return_pkt(struct rte_distributor *d,
@@ -198,6 +200,7 @@  rte_distributor_return_pkt(struct rte_distributor *d,
 
 	return 0;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_return_pkt,, 17.05);
 
 /**** APIs called on distributor core ***/
 
@@ -477,6 +480,7 @@  rte_distributor_process(struct rte_distributor *d,
 
 	return num_mbufs;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_process,, 17.05);
 
 /* return to the caller, packets returned from workers */
 int
@@ -505,6 +509,7 @@  rte_distributor_returned_pkts(struct rte_distributor *d,
 
 	return retval;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_returned_pkts,, 17.05);
 
 /*
  * Return the number of packets in-flight in a distributor, i.e. packets
@@ -550,6 +555,7 @@  rte_distributor_flush(struct rte_distributor *d)
 
 	return flushed;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_flush,, 17.05);
 
 /* clears the internal returns array in the distributor */
 void
@@ -566,6 +572,7 @@  rte_distributor_clear_returns(struct rte_distributor *d)
 	for (wkr = 0; wkr < d->num_workers; wkr++)
 		d->bufs[wkr].retptr64[0] = 0;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_clear_returns,, 17.05);
 
 /* creates a distributor instance */
 struct rte_distributor *
@@ -639,3 +646,4 @@  rte_distributor_create(const char *name,
 
 	return d;
 }
+BIND_DEFAULT_SYMBOL(rte_distributor_create,, 17.05);
diff --git a/lib/librte_distributor/rte_distributor_v20.c b/lib/librte_distributor/rte_distributor_v20.c
index 1f406c5..d74a789 100644
--- a/lib/librte_distributor/rte_distributor_v20.c
+++ b/lib/librte_distributor/rte_distributor_v20.c
@@ -42,6 +42,7 @@ 
 #include <rte_eal_memconfig.h>
 #include "rte_distributor_v20.h"
 #include "rte_distributor_private.h"
+#include "rte_compat.h"
 
 TAILQ_HEAD(rte_distributor_list, rte_distributor_v20);
 
@@ -63,6 +64,7 @@  rte_distributor_request_pkt_v20(struct rte_distributor_v20 *d,
 		rte_pause();
 	buf->bufptr64 = req;
 }
+VERSION_SYMBOL(rte_distributor_request_pkt, _v20, 2.0);
 
 struct rte_mbuf *
 rte_distributor_poll_pkt_v20(struct rte_distributor_v20 *d,
@@ -76,6 +78,7 @@  rte_distributor_poll_pkt_v20(struct rte_distributor_v20 *d,
 	int64_t ret = buf->bufptr64 >> RTE_DISTRIB_FLAG_BITS;
 	return (struct rte_mbuf *)((uintptr_t)ret);
 }
+VERSION_SYMBOL(rte_distributor_poll_pkt, _v20, 2.0);
 
 struct rte_mbuf *
 rte_distributor_get_pkt_v20(struct rte_distributor_v20 *d,
@@ -87,6 +90,7 @@  rte_distributor_get_pkt_v20(struct rte_distributor_v20 *d,
 		rte_pause();
 	return ret;
 }
+VERSION_SYMBOL(rte_distributor_get_pkt, _v20, 2.0);
 
 int
 rte_distributor_return_pkt_v20(struct rte_distributor_v20 *d,
@@ -98,6 +102,7 @@  rte_distributor_return_pkt_v20(struct rte_distributor_v20 *d,
 	buf->bufptr64 = req;
 	return 0;
 }
+VERSION_SYMBOL(rte_distributor_return_pkt, _v20, 2.0);
 
 /**** APIs called on distributor core ***/
 
@@ -314,6 +319,7 @@  rte_distributor_process_v20(struct rte_distributor_v20 *d,
 	d->returns.count = ret_count;
 	return num_mbufs;
 }
+VERSION_SYMBOL(rte_distributor_process, _v20, 2.0);
 
 /* return to the caller, packets returned from workers */
 int
@@ -334,6 +340,7 @@  rte_distributor_returned_pkts_v20(struct rte_distributor_v20 *d,
 
 	return retval;
 }
+VERSION_SYMBOL(rte_distributor_returned_pkts, _v20, 2.0);
 
 /* return the number of packets in-flight in a distributor, i.e. packets
  * being workered on or queued up in a backlog. */
@@ -362,6 +369,7 @@  rte_distributor_flush_v20(struct rte_distributor_v20 *d)
 
 	return flushed;
 }
+VERSION_SYMBOL(rte_distributor_flush, _v20, 2.0);
 
 /* clears the internal returns array in the distributor */
 void
@@ -372,6 +380,7 @@  rte_distributor_clear_returns_v20(struct rte_distributor_v20 *d)
 	memset(d->returns.mbufs, 0, sizeof(d->returns.mbufs));
 #endif
 }
+VERSION_SYMBOL(rte_distributor_clear_returns, _v20, 2.0);
 
 /* creates a distributor instance */
 struct rte_distributor_v20 *
@@ -415,3 +424,4 @@  rte_distributor_create_v20(const char *name,
 
 	return d;
 }
+VERSION_SYMBOL(rte_distributor_create, _v20, 2.0);
diff --git a/lib/librte_distributor/rte_distributor_version.map b/lib/librte_distributor/rte_distributor_version.map
index 414fdc3..7531cbe 100644
--- a/lib/librte_distributor/rte_distributor_version.map
+++ b/lib/librte_distributor/rte_distributor_version.map
@@ -13,3 +13,17 @@  DPDK_2.0 {
 
 	local: *;
 };
+
+DPDK_17.05 {
+	global:
+
+	rte_distributor_clear_returns;
+	rte_distributor_create;
+	rte_distributor_flush;
+	rte_distributor_get_pkt;
+	rte_distributor_poll_pkt;
+	rte_distributor_process;
+	rte_distributor_request_pkt;
+	rte_distributor_return_pkt;
+	rte_distributor_returned_pkts;
+} DPDK_2.0;