[dpdk-dev] net/ring: fix ring eth dev creation via devargs

Message ID 1472662271-21880-1-git-send-email-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Ferruh Yigit Aug. 31, 2016, 4:51 p.m. UTC
  Using nodeaction devarg lets creating multiple ring eth devices:
"eth_ring0,nodeaction=R0:0:CREATE,nodeaction=R1:0:CREATE"

Trying to create all devices with same name fails. Since first part of
the nodeaction devarg is name (in above sample R0,R1), this name field
can be used as eth dev name.

Fixes: 61934c0956d4 ("ring: convert to use of PMD_REGISTER_DRIVER and fix linking")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/ring/rte_eth_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson Oct. 13, 2016, 10:21 a.m. UTC | #1
On Wed, Aug 31, 2016 at 05:51:11PM +0100, Ferruh Yigit wrote:
> Using nodeaction devarg lets creating multiple ring eth devices:
> "eth_ring0,nodeaction=R0:0:CREATE,nodeaction=R1:0:CREATE"
> 
> Trying to create all devices with same name fails. Since first part of
> the nodeaction devarg is name (in above sample R0,R1), this name field
> can be used as eth dev name.
> 
> Fixes: 61934c0956d4 ("ring: convert to use of PMD_REGISTER_DRIVER and fix linking")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Bruce Richardson Oct. 13, 2016, 1:42 p.m. UTC | #2
On Thu, Oct 13, 2016 at 11:21:57AM +0100, Bruce Richardson wrote:
> On Wed, Aug 31, 2016 at 05:51:11PM +0100, Ferruh Yigit wrote:
> > Using nodeaction devarg lets creating multiple ring eth devices:
> > "eth_ring0,nodeaction=R0:0:CREATE,nodeaction=R1:0:CREATE"
> > 
> > Trying to create all devices with same name fails. Since first part of
> > the nodeaction devarg is name (in above sample R0,R1), this name field
> > can be used as eth dev name.
> > 
> > Fixes: 61934c0956d4 ("ring: convert to use of PMD_REGISTER_DRIVER and fix linking")
> > 
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
Applied to dpdk-next-net/rel_16_11

/Bruce
  

Patch

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index a7048c7..5551e18 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -557,7 +557,7 @@  rte_pmd_ring_devinit(const char *name, const char *params)
 				goto out_free;
 
 			for (info->count = 0; info->count < info->total; info->count++) {
-				ret = eth_dev_ring_create(name,
+				ret = eth_dev_ring_create(info->list[info->count].name,
 							  info->list[info->count].node,
 							  info->list[info->count].action);
 				if ((ret == -1) &&