From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 5CCA5D287 for ; Tue, 11 Apr 2017 17:45:17 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id u2so4132285wmu.0 for ; Tue, 11 Apr 2017 08:45:17 -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=+W7MO9kC8vvqC4HGDcbMB8kQ+i39LwsLlwCd/35oD4U=; b=u+jxjm369iusuJM1ACH5Fk2sIUIao8sdRixSNGb9Mf/OlKnZ19HdB93cEDdIGyJ34W cpFBfFJ1aDJQ8xTv01w1iFAEFVZw2eKYLphaPd7UNnqctK8mg2GXBLuYlYrhyrmKuCVd ot/JeaiP6aNkWk7NUz8XBx2d5OjRWE6MEUk1nCkl+WgqzHVIMJzUzVEz2IXhCbOZGc9v VeV5ravp6Jj6Z9qNrO0IjyOjoHrkRuKL6JRpvW3+JKjAp25dH2gMfcPBvJFT2RDCbb11 Ew2nJPDCwE+Pq3J1AwOVpH0oc/nikFwAYK7AVVoVmxFcrxC+PH8QTTYGI0ICzS4o87Y5 N2GA== 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=+W7MO9kC8vvqC4HGDcbMB8kQ+i39LwsLlwCd/35oD4U=; b=oP7CkvetRYtYL6CV8JT2ElGxXhNhOM+5aWP1iV9RjvDvoUWyYh7igTCW0QWx+HktLL ocasB6WfQRKgIOnYOdmu0QDnBX5mfC3pfscB48n2BzIx19mkuvBD2zLGJDMwsIVHsiPZ WbfwlOlWLFRVvr2pddxubaC/Lw/5hh1DkUuovmiOWgdtpaoB6eBDLZwTDn26Nl2PLA3q Ff/g7yvlQIUj5dGSCVvrgTgVVa0arL1OWx2yamIiQ83F2t6zF9f+BkPVFwwmuP+C7Gp1 LesRYgi9+iXMF2UBM320NUdpQ0llZESuI2I3qcG2ZjbDRvKKg8UKwCNzwe8cVethh3BP Bf9A== X-Gm-Message-State: AN3rC/77jm+tNF1z73sRDhuwNqSBTERY08elwhYfV8gN4Z3i26MJKz8tPFf31Jb7MmL2of5u X-Received: by 10.28.206.195 with SMTP id e186mr10284774wmg.37.1491925517133; Tue, 11 Apr 2017 08:45:17 -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 u63sm2933738wmu.22.2017.04.11.08.45.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Apr 2017 08:45:16 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Tue, 11 Apr 2017 17:44:20 +0200 Message-Id: <21487a6a278c9a9c48b83f17fc15b3785a7f8c8a.1491924900.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 13/42] net/bonding: use ethdev allocation helper for virtual devices 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: Tue, 11 Apr 2017 15:45:18 -0000 From: Jan Blunck Signed-off-by: Jan Blunck --- drivers/net/bonding/rte_eth_bond_pmd.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 2b1db0b..2ddcd07 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -2253,31 +2254,20 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) * and internal (private) data */ - if (name == NULL) { - RTE_BOND_LOG(ERR, "Invalid name specified"); - goto err; - } - if (socket_id >= number_of_sockets()) { RTE_BOND_LOG(ERR, "Invalid socket id specified to create bonded device on."); goto err; } - internals = rte_zmalloc_socket(name, sizeof(*internals), 0, socket_id); - if (internals == NULL) { - RTE_BOND_LOG(ERR, "Unable to malloc internals on socket"); - goto err; - } - /* reserve an ethdev entry */ - eth_dev = rte_eth_dev_allocate(name); + eth_dev = rte_eth_vdev_allocate(dev, sizeof(*internals)); if (eth_dev == NULL) { RTE_BOND_LOG(ERR, "Unable to allocate rte_eth_dev"); goto err; } - eth_dev->data->dev_private = internals; + internals = eth_dev->data->dev_private; eth_dev->data->nb_rx_queues = (uint16_t)1; eth_dev->data->nb_tx_queues = (uint16_t)1; @@ -2291,10 +2281,6 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) eth_dev->dev_ops = &default_dev_ops; eth_dev->data->dev_flags = RTE_ETH_DEV_INTR_LSC | RTE_ETH_DEV_DETACHABLE; - eth_dev->driver = NULL; - eth_dev->data->kdrv = RTE_KDRV_NONE; - eth_dev->data->drv_name = pmd_bond_drv.driver.name; - eth_dev->data->numa_node = socket_id; rte_spinlock_init(&internals->lock); -- 2.1.4