From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 7C9AB5424 for ; Wed, 31 May 2017 15:18:22 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id b84so118894052wmh.0 for ; Wed, 31 May 2017 06:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=lTQcfMhnt5HkjRLouZRUcjp80uaGMg2z46cbRhT/pOk=; b=Q9rK9mU6GNZjW7w1S6/F/Lg92eKHoHfCfT5i5gPcAld3lttg2EfYFlyBPicEMNugsL y2UozBCqi80mMqnzERqeGeIozU10KRtXJYmtuNHzT4+beSNWOav/bpmivmtKmU0sPjeG ZD/JXWtEpuATIPfP3rntgMAFdiUeQLENhdyOZYuIqcbXnkFfwERWRH4I0M8bqIXQlbt2 gNjbbg6BKW6Pm3F9pXvlmAJ7evsugSXrjuliVPeCUEcOBX6k/3Co8RiYO17JKi/fzSUY fn82bv07HMmzI+2PIuokmBhgXt937UfCr/z4X9y6nT+vGJW9M1kq2SRNq0oQf40Mlpz5 05NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=lTQcfMhnt5HkjRLouZRUcjp80uaGMg2z46cbRhT/pOk=; b=Rvx5cHyAKq6BfEHOf34YBZmCXUT8U8OgBjZVxBv/lPOeKPM4tqIYq/pqOzm4i045NC esmutvDfMzf9r0X1kPj9jN7ulFnYrsgHT+0O50X4sf9poJbmjnLMW5dOHG1cnI+FcVFw q3Lycy+vY/oFoi1qQu0ntX4MewMljh7ape42DnrvY2dDNQ/6w4rXA36goCVp2OuxGRVV AuLUX9tSHhH6A13xpYNdBj7PoUFVKzKz3zQGSU/WGS8K2tWlij/ut7TwGoVBCRlHad6r U6ykYjZj+M/HkZVas4pVabpXHjqzNo8BjBoSDlm8qq/adMfy9ZFf3RYekej//qkPFUqU A+6g== X-Gm-Message-State: AODbwcDj0UH5B8/3Lh84yFrbh7kEJ622xIpdwOGqpr0ppdXFSp3BBqIW kPEQhwNtB6kc1yTro8U= X-Received: by 10.28.126.198 with SMTP id z189mr5159476wmc.67.1496236701817; Wed, 31 May 2017 06:18:21 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id g77sm10045744wmd.19.2017.05.31.06.18.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 06:18:21 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet , stable@dpdk.org, Bruce Richardson Date: Wed, 31 May 2017 15:17:56 +0200 Message-Id: <3162b325eecd194d947f7e6290e54ca6ed388936.1496235017.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 11/11] net/ring: fix dev handle in eth_dev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 May 2017 13:18:23 -0000 The ring PMD uses special eth_dev allocators, which cannot be updated to accept an rte_vdev_device. Circumvent the limitation and store the rte_device handle in the rte_eth_dev structure. Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for vdev") Cc: stable@dpdk.org Signed-off-by: Gaetan Rivet Cc: Bruce Richardson --- drivers/net/ring/rte_eth_ring.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 87d2258..9ebc60e 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -515,6 +515,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) RTE_LOG(INFO, PMD, "Initializing pmd_ring for %s\n", name); if (params == NULL || params[0] == '\0') { + struct rte_eth_dev *eth_dev; + ret = eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE); if (ret == -1) { RTE_LOG(INFO, PMD, @@ -522,6 +524,11 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) ret = eth_dev_ring_create(name, rte_socket_id(), DEV_ATTACH); } + /* find an ethdev entry */ + eth_dev = rte_eth_dev_allocated(name); + if (eth_dev == NULL) + return -ENODEV; + eth_dev->device = &dev->device; } else { kvlist = rte_kvargs_parse(params, valid_arguments); -- 2.1.4