From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by dpdk.org (Postfix) with ESMTP id B23B5594E for ; Mon, 1 Aug 2016 22:45:07 +0200 (CEST) Received: by mail-qk0-f193.google.com with SMTP id s186so6587747qkb.1 for ; Mon, 01 Aug 2016 13:45:07 -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:in-reply-to:references; bh=8Rp0+vd3AdZ4Cnt8eaSHRjuBrTVV0r632ZCZ7ku2G44=; b=Kly3YBgWSWNH42gvvMm+oxKji9I1Mrm394Dvtw2i4FNtundhK02sXtqVMSABP1FBLe pXnEewi7LQSHGho8FfZjezO7Lk4k+181KVdVo+Pf+G7ezaI+oySyxenIJuaXoYHBn4Ik k9K1Cf99LKB8zdez0FIOOIi36rA7O/9wsbs3aB/czfttpZi320IajMr8JX8NHJzWbZ78 OMC23QMQUQqDXh23i+go3UrJimdVpveA7QCMMKe9EGcw5mfz5txpSTanp2ef0Op5yUlC WtsMM5eSoz0wMhJzSbtqE+GA/iR7VQNsM+anJ3OD+Zr5sS9nKVczy1vhd06nKGn+ND44 tfDQ== 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:in-reply-to :references; bh=8Rp0+vd3AdZ4Cnt8eaSHRjuBrTVV0r632ZCZ7ku2G44=; b=gKfkMAW2h6Zc5+4Io/h5UKfkngTcpArYzMomsW2D518Rhu2r1UtI0C57IIRKh6DF6H oYCY0YsmbKYu+ptCM8jhllU6FPCT0p812WCQXDLZjSbd2wDWYP+ddqPLh3xdfoGN8kum +Now3H4Lm7zwRud65Wc/CM+4qExn2vmOprSc5WS2GyhPa+CDdQhNGnQiBZw9mMTNFmoh MI2I2X4b25hV02zNBE1/uL5Ran5bkH4gY2HZFguBSBS5yCxKGCQtn0xX0UsKcKvX7Wfy xZM2ewJ9BAdM8nrUbS7s6edAwG24jdCsMmypM3gMDhXbup381SzX9EI+thSB2PaY+Ipw F3sg== X-Gm-Message-State: AEkooutdDgRZGRiA6lGmafqh4vjJCrIc7WktFiRoB0JBjEJF+kQ4wh91UnNT4KtEQxu0jw== X-Received: by 10.55.65.71 with SMTP id o68mr67230225qka.163.1470084307053; Mon, 01 Aug 2016 13:45:07 -0700 (PDT) Received: from localhost.localdomain ([23.79.237.14]) by smtp.gmail.com with ESMTPSA id i65sm18534359qtb.18.2016.08.01.13.45.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Aug 2016 13:45:06 -0700 (PDT) From: Robert Sanford X-Google-Original-From: Robert Sanford To: dev@dpdk.org Cc: declan.doherty@intel.com, pablo.de.lara.guarch@intel.com, olivier.matz@6wind.com Date: Mon, 1 Aug 2016 16:42:56 -0400 Message-Id: <1470084176-79932-5-git-send-email-rsanford@akamai.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1470084176-79932-1-git-send-email-rsanford@akamai.com> References: <1470084176-79932-1-git-send-email-rsanford@akamai.com> Subject: [dpdk-dev] [PATCH 4/4] net/bonding: fix configuration of LACP slaves 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: Mon, 01 Aug 2016 20:45:08 -0000 Problem: When adding a slave or starting a bond device, the bond device configures slave devices via function slave_configure(). However, settings configured in the bond device's rte_eth_conf are not propagated to the slaves. For example, VLAN and CRC stripping are not working as expected. The problem is that we pass the wrong argument when we invoke rte_eth_dev_configure(). We pass the slave's currently configured rte_eth_conf (as a source arg!), when we should pass a copy of the (master) bond device's rte_eth_conf. Solution: Make a local copy of the bond device's rte_eth_conf, adjust the LSC flag based on the slave, and then pass that rte_eth_conf to rte_eth_dev_configure(). Also, remove code that directly pokes RSS data into the slave's rte_eth_conf, as that is also contained in the proper rte_eth_conf that we will pass to rte_eth_dev_configure(). Signed-off-by: Robert Sanford --- drivers/net/bonding/rte_eth_bond_pmd.c | 28 +++++++--------------------- 1 files changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index b20a272..486582f 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1302,6 +1302,7 @@ int slave_configure(struct rte_eth_dev *bonded_eth_dev, struct rte_eth_dev *slave_eth_dev) { + struct rte_eth_conf slave_eth_conf; struct bond_rx_queue *bd_rx_q; struct bond_tx_queue *bd_tx_q; @@ -1313,33 +1314,18 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, /* Stop slave */ rte_eth_dev_stop(slave_eth_dev->data->port_id); - /* 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; - - /* 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 (bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len - != 0) { - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = - bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = - bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key; - } else { - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; - } + /* Build slave rte_eth_conf, starting from bonded's conf */ + slave_eth_conf = bonded_eth_dev->data->dev_conf; - slave_eth_dev->data->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 = - bonded_eth_dev->data->dev_conf.rxmode.mq_mode; - } + /* Enable interrupts on slave device if supported */ + slave_eth_conf.intr_conf.lsc = + !!(slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC); /* Configure device */ errval = rte_eth_dev_configure(slave_eth_dev->data->port_id, bonded_eth_dev->data->nb_rx_queues, bonded_eth_dev->data->nb_tx_queues, - &(slave_eth_dev->data->dev_conf)); + &slave_eth_conf); if (errval != 0) { RTE_BOND_LOG(ERR, "Cannot configure slave device: port %u , err (%d)", slave_eth_dev->data->port_id, errval); -- 1.7.1