ring: convert to use of PMD_REGISTER_DRIVER and fix linking
authorNeil Horman <nhorman@tuxdriver.com>
Mon, 21 Apr 2014 14:59:29 +0000 (10:59 -0400)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 20 May 2014 12:28:16 +0000 (14:28 +0200)
commit61934c0956d4816cf4bdb797f943264b9f476095
treef8a393ba7cc7b6da1b380d764e5f435d7d8406ac
parent3660cdf9904bba449d6acdb03dce6592917be2e1
ring: convert to use of PMD_REGISTER_DRIVER and fix linking

Convert the ring driver to use the PMD_REGISTER_DRIVER macro and fix up the
Makefile so that its linkage is only done if we are building static libraries.
This means that the test applications now have no reference to the ring library
when building DSO's and must specify its use on the command line with the -d
option.  Static linking will still initalize the driver automatically.

Note that the ring driver was also written in such a way that it violated some
general layering principles, several functions were contained in the pmd which
were being called by example from the test application in the app/test
directory.  Specifically it was calling eth_ring_pair_attach,
eth_ring_pair_create and rte_eth_ring_devinit, which should only be called
internally to the dpdk core library.  To correct this I've removed those
functions, and instead allowed them to be called indirectly at initalization
time using the vdev command line argument key nodeaction=<name>:<node>:<action>
where action is one of ATTACH or CREATE.  I've tested out the functionality of
the command line with the testpmd utility, with success, and have removed the
called functions from the test utility.  This will affect how the test utility
is invoked (the -d and --vdev option will need to be specified on the command
line now), but honestly, given the way it was coded, I think the testing of the
ring pmd was not the best example of how to code with dpdk to begin with.  I
have also left the two layer violating functions in place, so as not to break
existing applications, but added deprecation warnings to them so that apps can
migrate off them.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
app/test/test_pmd_ring.c
lib/librte_pmd_ring/Makefile
lib/librte_pmd_ring/rte_eth_ring.c
mk/rte.app.mk