From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id C348C567F for ; Mon, 6 Mar 2017 11:01:00 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id n11so12814994wma.0 for ; Mon, 06 Mar 2017 02:01:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=dWrC1ViRZuhvLjoP7PdjZC/30l+23jfG1O6D+8JgVU8=; b=fcBnVuHHiQFZmw/PkGp+wd8PE6jCyFUQnSKPo7HM9iVkfK2shNvT36S46mcF0kyQZT xlTQjuboFaSSPRFfYr7WK36z/WyhEvMw5LOvuZ2cfGbKhuFSWNDxKnJmcEH5ve8kxFhL rjLJGm6B3b5nIj8Q8xOYhdRckXhdiYEpLe7olwUYE9KazijLxU2mWDAubt+if8P+Xj9N q2W59cx8qTynbpgfc2DlAQuZmnIpFaa44agAia6M65EI4KB+g7RBAhMJ9Olq5nTpWTxW lda8iKBWPepnzGAomPqysu1PkTgi6DpQYpmMPArg2ansFMkKj98cuZ7JODpPtI8xwvth N22g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=dWrC1ViRZuhvLjoP7PdjZC/30l+23jfG1O6D+8JgVU8=; b=cBbyb4AMDX0EXCAzMs3LOx0LJ/Q22fUAI1rGbVC+q7kN0zLWh9dV9svb3f9vzgnhyv 7Gkez/LgtTJCjIqZ1PaC7QLCVKEqm88GFrkRxW2GWulnRC98+2DKd5pcyUFwjpwO8B14 v9AypcHm7Xs380v9322aDPL1ZjktMRTPi7NYQ5+wwpCsUDw0rO2T2EHJeitBre9x5Jow 5oVpRkveDpjz5E5vArs418HStv/jhsqVS9vMHxmw67fZ+Lcl279mkfNcT33hxu1FnHSM IWhRu/cD3LaKCwhxIDq9iquYbIiAQX0yKBiYNJ8L50k6AHqXFwadoB660e/Dr5S8iMFk 3OXA== X-Gm-Message-State: AMke39n34Pzx0alKcIplGZnwO/DcZWFJL4KOA6s2C7HPQtT5OdrMUdeDE6J0i5RqY+bcrw== X-Received: by 10.28.107.14 with SMTP id g14mr13686924wmc.106.1488794460417; Mon, 06 Mar 2017 02:01:00 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id u145sm3829237wmu.1.2017.03.06.02.00.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:00:59 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:06 +0100 Message-Id: <1488794430-25179-15-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488794430-25179-1-git-send-email-jblunck@infradead.org> References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH 14/38] 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: Mon, 06 Mar 2017 10:01:00 -0000 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 c0d08a8..3c80ff5 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 @@ -2243,31 +2244,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; @@ -2281,10 +2271,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.7.4