From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com [209.85.128.173]) by dpdk.org (Postfix) with ESMTP id 1C6CD3798 for ; Thu, 8 Jun 2017 01:53:50 +0200 (CEST) Received: by mail-wr0-f173.google.com with SMTP id g76so11968142wrd.1 for ; Wed, 07 Jun 2017 16:53:50 -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=Uq02ft65JzGQmGpW9I7XvrWUjZsK0rlE1JyP4eFMO6I=; b=JhbkbKGwsdL7cIAIHmkJRjzUS76dtjWQOR5j4Bgjqabve7uSeX3Btr5jaRvjX+6KVk 7KYnz0I0zZCZvQPgvcl09nIvxRWlqZULAidZdEgdKy0MdkM9QPJ960ahTvx33DHqnLCk Zwix8Y4rCKQZlmWpZwGNEfEOW6uMsIojXk02YlbqiUhMdUOrx2yF2t/ZaqF7edR1Yajq 87jnA18UjGZhKCvU2kOdu0AoibpQ4P1cO87RVU3PJnLeb6btUa+7uTYQIXzzoZtUU4d2 F9tpvXK9UwvJ8t9kM+YTTq24IcZXdkIzc596AslP/7fIy/aDW2iwCRP4QZ3kzF1AaBWi wgmA== 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=Uq02ft65JzGQmGpW9I7XvrWUjZsK0rlE1JyP4eFMO6I=; b=kZww42LRbDi7uyLrHPUBgL/3Qi1N4hfKvkUcQmpoiy6CtTOa3NLxvhAOwRWneejBms 1Sc3QX/0H2KMW+mhV6CQUrbJHOYzlu405K8CR6KOZsDm6HF8Dq5do2yMxLlR+zEZu9Yf cMzOFm3J/Qoq5SgysTfqkvf48sgQIo7CRAU6IDdq6ysx59EZhgKGudKZdDmV5I6me8D4 gM9GhyyGoSPEAxEGZS0Y8VdaGeiELjrP1V6gbMWj9jdKcFBNBpalFfyqVhD/ezGwTpIG LAXGumVKAsBYN3Lvw1MGwixcKkBw8lSs7YVMMtdC8Olt43NW+D9ED/QnYd9REBMwNItx lt9g== X-Gm-Message-State: AODbwcAoF3Dvh04fAs5hi+SEGci+a+2fUJ0Tyx2JaQmGj76eHDhEgv/L AifQx847Ji8Mc96hpk4= X-Received: by 10.223.134.161 with SMTP id 30mr15620656wrx.20.1496879629492; Wed, 07 Jun 2017 16:53:49 -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 z23sm4589942wrz.0.2017.06.07.16.53.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jun 2017 16:53:48 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet , stable@dpdk.org Date: Thu, 8 Jun 2017 01:53:24 +0200 Message-Id: <2864d0bb005bab72dcddafa692a79e13826cbec8.1496876710.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 v3 10/10] 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, 07 Jun 2017 23:53:50 -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 --- 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 d4dce95..2cd32a9 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