From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AAA5FA00C3; Wed, 15 Dec 2021 19:20:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60DD54114B; Wed, 15 Dec 2021 19:20:28 +0100 (CET) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by mails.dpdk.org (Postfix) with ESMTP id EB24D4111B for ; Wed, 15 Dec 2021 19:20:26 +0100 (CET) Received: by mail-qv1-f52.google.com with SMTP id b11so21056803qvm.7 for ; Wed, 15 Dec 2021 10:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aoeCzn+NYKXCXBlb13T4hQKP5WxgXGwGsH2vZTpCZZM=; b=dFxKVQjr8bcUwR9R5qg+JN6i4hROhUHkC/6dHGbqD/KwNOSYea4pqwGagMOctZKgRB JBp3tbNA4bdf5fqgYZsYlbH/gZKqctjocxmxHY0L4/MkiUHyZBMXeIPrJBjPIwBnMZ9s d5pIpYNfPO5uc8ppylUDuh/QZpfmY6WSHJTsfJ1Y4oJTojuCg4lbTWxQyKRIevhEXtoY NDt63AXnGZQ4RKUyJd3nCILjtATJwp3Pd0+JTFTRBhKvkoZZAKHGzqckZzdphCh1ygRv zJW3tkQWru8RK6XjgBP+8Zo2tz9VIBvI7UaKVkpt3znVNAOxBqWx1c7untVw5vVmW3nb aTtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aoeCzn+NYKXCXBlb13T4hQKP5WxgXGwGsH2vZTpCZZM=; b=5Ev3SQrpkCWr2abTVdvcaAkcA0jpmNlMtWRTXpJ4sVDC2RyG7cRqepzzBk6yhSc8in vW9C48phHwVOllvaccAT13wsV64e4proHwqxo/kahqY+RUWk5LZNz6umrz27zhMfuRID dVxYNeHvWYvtHf9U6lrYkSLVTB5Fkyi3J9H99KcqaJcQ5SJBGcUl11U5GuY2HrlWmteD s0MVu71aMbG8Q6ui+3tJbSy/cwbvlKVN4M0pzjFYOPPz/765/a/+FcNU2J3VwOnRdy0y dbYu1XTTGjvpbDP17lWwvyw3NpiTms6TJ4Iaui+9x3MOKShhtr8Butct3NGSQUjYa4ZS F7Mw== X-Gm-Message-State: AOAM531D+kuRU8ZCJUpzsI2UAdn8U5H8N32XjdNqLRNiKWPlyPzSzcDe sJg4ZMdJR0Ks1eQ+3wALT+ErZyWu2lA= X-Google-Smtp-Source: ABdhPJzAARcgyIs5HsbJ5kl2BNDji8dhH+TrsotOx0pdR/ja13oUpxW859eMHFNf8YRtpQUqeJMpbw== X-Received: by 2002:ad4:5bc3:: with SMTP id t3mr3298224qvt.47.1639592426100; Wed, 15 Dec 2021 10:20:26 -0800 (PST) Received: from ubuntu.localdomain (99-153-167-175.lightspeed.ftldfl.sbcglobal.net. [99.153.167.175]) by smtp.gmail.com with ESMTPSA id 8sm2075978qtz.28.2021.12.15.10.20.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Dec 2021 10:20:25 -0800 (PST) From: Robert Sanford X-Google-Original-From: Robert Sanford To: dev@dpdk.org Cc: chas3@att.com, humin29@huawei.com Subject: [PATCH 2/7] net/bonding: fix bonded dev configuring slave dev Date: Wed, 15 Dec 2021 13:19:56 -0500 Message-Id: <1639592401-56845-3-git-send-email-rsanford@akamai.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1639592401-56845-1-git-send-email-rsanford@akamai.com> References: <1639592401-56845-1-git-send-email-rsanford@akamai.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org - Replace directly overwriting of slave port's private rte_eth_conf by copying it, and then updating it via rte_eth_dev_configure(). Signed-off-by: Robert Sanford --- drivers/net/bonding/rte_eth_bond_pmd.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index f6003b0..8cce0aa 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1691,6 +1691,7 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, struct rte_flow_error flow_error; struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; + struct rte_eth_conf dev_conf; /* Stop slave */ errval = rte_eth_dev_stop(slave_eth_dev->data->port_id); @@ -1698,34 +1699,36 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, RTE_BOND_LOG(ERR, "rte_eth_dev_stop: port %u, err (%d)", slave_eth_dev->data->port_id, errval); + /* Start with a copy of slave's current rte_eth_conf. */ + dev_conf = slave_eth_dev->data->dev_conf; + dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; + /* 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 = + (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) ? 1 : 0; /* If RSS is enabled for bonding, try to enable it for slaves */ if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) { /* rss_key won't be empty if RSS is configured in bonded dev */ - slave_eth_dev->data->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 = - internals->rss_key; + dev_conf.rx_adv_conf.rss_conf.rss_key_len = + internals->rss_key_len; + dev_conf.rx_adv_conf.rss_conf.rss_key = internals->rss_key; - 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 & RTE_ETH_RX_OFFLOAD_VLAN_FILTER) - slave_eth_dev->data->dev_conf.rxmode.offloads |= + dev_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_VLAN_FILTER; else - slave_eth_dev->data->dev_conf.rxmode.offloads &= + dev_conf.rxmode.offloads &= ~RTE_ETH_RX_OFFLOAD_VLAN_FILTER; - slave_eth_dev->data->dev_conf.rxmode.mtu = - bonded_eth_dev->data->dev_conf.rxmode.mtu; + dev_conf.rxmode.mtu = bonded_eth_dev->data->dev_conf.rxmode.mtu; nb_rx_queues = bonded_eth_dev->data->nb_rx_queues; nb_tx_queues = bonded_eth_dev->data->nb_tx_queues; @@ -1747,8 +1750,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.7.4