From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f68.google.com (mail-pa0-f68.google.com [209.85.220.68]) by dpdk.org (Postfix) with ESMTP id 82A2329D2 for ; Thu, 24 Mar 2016 23:00:28 +0100 (CET) Received: by mail-pa0-f68.google.com with SMTP id fl4so4712580pad.2 for ; Thu, 24 Mar 2016 15:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=8gagQZgZs8fd5i9e3rStdDyfj2EXReEsT9AA0G5r9Hw=; b=vG3DxnWmYV3tCfCVWBuJT1dIPiHoC9URV9Xm4qE451R7UWGPGbnTXb0uPK1X4fNmIo +8P7XywSXVhqXE9oMkyqbzmVqpfmrKeczvko5snTpePvHmvKVWDq2m7Pu4OpbWakvXrq GhcDxMRAm4TGGgDNmynSSbH/OqWFZ8hn9TcsD4Mkbmhc2k5fcIEvQ2i/SpsvcZIC/Cts AZha4wSWFaxwWcSGR5zrU6XDe/OAJOq0sHu5hXXgKN9iEcSFVl9wLvlLdnq6EO+JMgO2 K4OAVOVEtznqEssdL/KZyKhmUXwgXEw2ArETPNOF/znhR7BFwt7yskwnum6CQHr8wBOi CzSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8gagQZgZs8fd5i9e3rStdDyfj2EXReEsT9AA0G5r9Hw=; b=O93kTQl6eE8iUSoud3UtQZ1Kd+a6r8Q/U9+1bY9B0TV0LDutdkIn5TAmCeyxmKXKCi dfbyseTShGRdPne7fUTOL5g+u9aZAfoCFSYOPwziMqkyjVgnZTgUlfZEo+u8h0pNyzl0 Mx3jqZe7iB8CWq9r+IY9QvaZxXcJ+loUyOCpkCm11ikDTN/Z9wRiG+En/nqh+ijZIW5M X1tuKtwhYtj+uc5gPcnJ+xQybEPYBNmAJ4o+5k4O2qBDn/ZyqiGJZyjSAL9cmcZC/XSB gPU2v/cvkMntdJnMxzwow2QzBrTVXI55Rr1hU+bndibvdVZlCy8vLb4kD0RhbB3OQI86 NH8A== X-Gm-Message-State: AD7BkJLF7hVO1HKtK4jQU7PWgvvglr6uccpC8yIrKbMHMjhL4c09cMowbjbg5URVjlMMlA== X-Received: by 10.66.124.226 with SMTP id ml2mr15900656pab.90.1458856827785; Thu, 24 Mar 2016 15:00:27 -0700 (PDT) Received: from buildhost2.vyatta.com. ([144.49.132.22]) by smtp.gmail.com with ESMTPSA id h85sm12191920pfj.52.2016.03.24.15.00.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 15:00:26 -0700 (PDT) From: Eric Kinzie To: dev@dpdk.org Cc: tkiely@brocade.com, declan.doherty@intel.com, bernard.iremonger@intel.com, ekinzie@brocade.com Date: Thu, 24 Mar 2016 14:59:58 -0700 Message-Id: <1458856798-13036-1-git-send-email-ehkinzie@gmail.com> X-Mailer: git-send-email 1.7.10.4 Subject: [dpdk-dev] [PATCH] bond: use existing enslaved device queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 22:00:28 -0000 This solves issues when an active device is added to a bond. If a device to be enslaved already has transmit and/or receive queues allocated, use those and then create any additional queues that are necessary. Fixes: 2efb58cbab6e ("bond: new link bonding library") Signed-off-by: Eric Kinzie --- drivers/net/bonding/rte_eth_bond_pmd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 011150a..7472e9d 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1305,6 +1305,8 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, struct bond_rx_queue *bd_rx_q; struct bond_tx_queue *bd_tx_q; + uint16_t old_nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + uint16_t old_nb_rx_queues = slave_eth_dev->data->nb_rx_queues; int errval; uint16_t q_id; @@ -1345,7 +1347,9 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, } /* Setup Rx Queues */ - for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) { + /* Use existing queues, if any */ + for (q_id = old_nb_rx_queues; + q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) { bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id]; errval = rte_eth_rx_queue_setup(slave_eth_dev->data->port_id, q_id, @@ -1361,7 +1365,9 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, } /* Setup Tx Queues */ - for (q_id = 0; q_id < bonded_eth_dev->data->nb_tx_queues; q_id++) { + /* Use existing queues, if any */ + for (q_id = old_nb_tx_queues; + q_id < bonded_eth_dev->data->nb_tx_queues; q_id++) { bd_tx_q = (struct bond_tx_queue *)bonded_eth_dev->data->tx_queues[q_id]; errval = rte_eth_tx_queue_setup(slave_eth_dev->data->port_id, q_id, -- 1.7.10.4