From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D5CE9A0353; Tue, 19 Nov 2019 10:04:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D3001BE0C; Tue, 19 Nov 2019 10:03:53 +0100 (CET) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id DD93B1B948; Tue, 19 Nov 2019 10:03:51 +0100 (CET) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id EC7A1780077; Tue, 19 Nov 2019 09:03:50 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 19 Nov 2019 01:03:45 -0800 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 19 Nov 2019 01:03:45 -0800 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id xAJ93i4p009986; Tue, 19 Nov 2019 09:03:44 GMT Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id EFCE8161648; Tue, 19 Nov 2019 09:03:43 +0000 (GMT) From: Andrew Rybchenko To: Chas Williams CC: , Date: Tue, 19 Nov 2019 09:03:40 +0000 Message-ID: <1574154221-8628-1-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-25050.005 X-TM-AS-Result: No-0.628500-4.000000-10 X-TMASE-MatchedRID: odajS0ZtFtN2m+j+coBLPkrM69p7lDSsyiKgKtIyB4oZwGrh4y4izDgK 6rBjXxyibcBMEk4p7PRTvVffeIwvQyHhSBQfglfsA9lly13c/gGPOV9J7oRhr9EsTITobgNEZYz ZgiJFzgrrM52FHhwFti3hzvwk6+T2e1B/YjumHvlPs79gcmEg0FIOc8QjxyVtc1dFlLjGwIwS99 dUV0LYki2nrX9l2SNYT98ku4mVuOcfE8yM4pjsDwtuKBGekqUpm+MB6kaZ2g5f358baqQuq/7EM uACkLIXofBBWj2x8g7Nw1guN6h+xhm1vpG9/e1MNSF732rO9s8Lvk91lPBJnY+TK+4vHlwtsN6S DtPeFDLkA8OrYHdwDGfYlY/yoV/0Up6EHOb2+c7kHZDO53QSwjflzkGcoK72 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.628500-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-25050.005 X-MDID: 1574154231-d3xM__cQky_e Subject: [dpdk-dev] [PATCH] net/bonding: do not inherit slave device configuration 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Bonding device should control bonded devices configuration. Also avoid usage of slave's data->dev_conf. Fixes: 2efb58cbab6e ("bond: new link bonding library") Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko --- drivers/net/bonding/rte_eth_bond_pmd.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 707a0f3cdd..4f0e83205d 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1679,6 +1679,7 @@ int slave_configure(struct rte_eth_dev *bonded_eth_dev, struct rte_eth_dev *slave_eth_dev) { + struct rte_eth_conf dev_conf; struct bond_rx_queue *bd_rx_q; struct bond_tx_queue *bd_tx_q; uint16_t nb_rx_queues; @@ -1693,34 +1694,34 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, /* Stop slave */ rte_eth_dev_stop(slave_eth_dev->data->port_id); + memset(&dev_conf, 0, sizeof(dev_conf)); + /* Enable interrupts on slave device if supported */ if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) - slave_eth_dev->data->dev_conf.intr_conf.lsc = 1; + dev_conf.intr_conf.lsc = 1; /* If RSS is enabled for bonding, try to enable it for slaves */ if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) { if (internals->rss_key_len != 0) { - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = + dev_conf.rx_adv_conf.rss_conf.rss_key_len = internals->rss_key_len; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = + dev_conf.rx_adv_conf.rss_conf.rss_key = internals->rss_key; } else { - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; + dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; } - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + dev_conf.rx_adv_conf.rss_conf.rss_hf = bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; - slave_eth_dev->data->dev_conf.rxmode.mq_mode = + dev_conf.rxmode.mq_mode = bonded_eth_dev->data->dev_conf.rxmode.mq_mode; } if (bonded_eth_dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_VLAN_FILTER) - slave_eth_dev->data->dev_conf.rxmode.offloads |= - DEV_RX_OFFLOAD_VLAN_FILTER; + dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; else - slave_eth_dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_VLAN_FILTER; + dev_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; nb_rx_queues = bonded_eth_dev->data->nb_rx_queues; nb_tx_queues = bonded_eth_dev->data->nb_tx_queues; @@ -1742,8 +1743,7 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, /* Configure device */ errval = rte_eth_dev_configure(slave_eth_dev->data->port_id, - nb_rx_queues, nb_tx_queues, - &(slave_eth_dev->data->dev_conf)); + nb_rx_queues, nb_tx_queues, &dev_conf); if (errval != 0) { RTE_BOND_LOG(ERR, "Cannot configure slave device: port %u, err (%d)", slave_eth_dev->data->port_id, errval); -- 2.17.1