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 EA6E3A034C; Tue, 21 Dec 2021 20:58:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D95241101; Tue, 21 Dec 2021 20:58:08 +0100 (CET) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) by mails.dpdk.org (Postfix) with ESMTP id 7C9454003C for ; Tue, 21 Dec 2021 20:58:05 +0100 (CET) Received: by mail-qt1-f171.google.com with SMTP id t11so13949925qtw.3 for ; Tue, 21 Dec 2021 11:58:05 -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=4wHsRwq95ZrXDb40QSqc4h0hEj5ymKpB9KPN2TKm8f4=; b=PzFWlgiB0ZH2Xwkt7y94ba0QRbR0V5lQZk0eMPa54eiS582Ie2WGE9NJmbFElgzKyW JyHjoPTmsw3k7n0kIH5CqfRfKDIOOYQskMGlTjsBA3mSn2X7xWZyt1rfKB1b/4vKZvdE JBoOmT/r9UPZbJsYx5kbsi43Nsqsu2RFeEAbczEBrkSGT+7trGnqCmZQ35xU2/OLONd8 czCZTXaxJNLdQCivUUqcAUidegHAPhRkxOqhC7JAciGwL+6HXFza1rp7LbOc7NFehDtV 82IKPyOe1Axy1L0kpd+Tb28oBja6oVSg7Nm8kURcva5McKvTf7Nwgws0vUUf2aYdsVi5 6Z9g== 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=4wHsRwq95ZrXDb40QSqc4h0hEj5ymKpB9KPN2TKm8f4=; b=WqUAp2bARYl5nOUoQiu6sJgoExmeH9JM4yS40x2mXoVbA1LghEqA1E8tE4Rq+cd9FV wxQcm7P9Jx4gZ8sQcKElZWib46kQ9TBayXUgTprbNOzfpmL2NrY6SRolMiRYzZe3gf5p AP4QeBpTgxkZIHU6hHixurfiteIIq9tC6vK0Tj9+yv4VNdgtZyZqLyvu+QzEsnmh0mXb xMy4cH7G+CDYw/8rg5VT5Y9n7uu33K/+RhnzHG43WIqwP6CKyTah0kJm/CzKrIy4C96b g0NgyGWJ8ODqSye9o9+5lSofrhERE6krxX/N8ge3APqVZHQd5EdwwzX0SIqbfFX3YseG 6qvA== X-Gm-Message-State: AOAM5314xNjeMRG5cZqPsrlNkO6kWajITt+duXFmKQbKBG4gm90uxg+V HGFzXSCbh7zahAXmrcgbwr2Hebex+bxpsQ== X-Google-Smtp-Source: ABdhPJynfZAek2t+dCNee8TBpS0CUJQTqrpitJaLgMPcO7IdwZRIoQrBAWa1lP8eIIWpm1MIkxYClA== X-Received: by 2002:a05:622a:1194:: with SMTP id m20mr3616974qtk.65.1640116684891; Tue, 21 Dec 2021 11:58:04 -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 h3sm14684401qko.78.2021.12.21.11.58.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Dec 2021 11:58:04 -0800 (PST) From: Robert Sanford X-Google-Original-From: Robert Sanford To: dev@dpdk.org Cc: chas3@att.com, humin29@huawei.com, bruce.richardson@intel.com Subject: [PATCH v2 2/8] net/bonding: fix bonded dev configuring slave dev Date: Tue, 21 Dec 2021 14:57:24 -0500 Message-Id: <1640116650-3475-3-git-send-email-rsanford@akamai.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1640116650-3475-1-git-send-email-rsanford@akamai.com> References: <1639592401-56845-2-git-send-email-rsanford@akamai.com> <1640116650-3475-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..b9e7439 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