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 2909DA0518 for ; Fri, 24 Jul 2020 14:01:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 203E61BFE7; Fri, 24 Jul 2020 14:01:01 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id ADF881C02A for ; Fri, 24 Jul 2020 14:00:57 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id r4so5106549wrx.9 for ; Fri, 24 Jul 2020 05:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hg+mSav4KzseSawVMlW6TpA/4VblVujNbUYh36FYstE=; b=fIByzfeXX84o4EGbwFYXqtoBUPQEhkdku5GuoaGc7DQtb4vvllR82tc3hGLiSW7onk 1m1CLIfCR8gFXj2fMaa2J3dRHC3eGZys2xOtTh/oG7YlqfFfBcrOalp/xAbFk8130jil tQ2UoyYl7HICcPVY9G5k8XrMJd52BR1cg0hEcrCfIR786/vCwmhqJDo0m35cXlGyDpLP fcqS2qBEOStohmG0YGAqX43p4oVKaEE3nef9Og4E6XtV+HhP36his5u3xl+uL0Pb5lFH WeobRccF7hpwMtl4NjN+9SLaKk0xXFr8QdjZmkcSozz2+2YZq8lK9swZjUJKF9XGCDh+ WxIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hg+mSav4KzseSawVMlW6TpA/4VblVujNbUYh36FYstE=; b=JIQI4zRt5g9JZHpTZHKttBN5AIZOxpym563nkVBaKjr5cruD+NLO/RFJZ/horVdmvr CuJjahlXDLcu4+1I13irF28p0yobw+vXpyGbqIT05fmkJenEmfNywsAJ5FCjD3wv9kvn ZyBsSe3/WaagNsL+YpHiF9015g0Y+siYxFf6kLEurGk8iFWW0R0f74ek3XaymID5d9MV JPDa+mZDXj3cRfLjdZRl/Lk67n2APrBHPAcgRAtVV1h2qqDDmUYOdn7KJOlYaSZMbcLn EtR4GidDKCscY73uaeRTGv8uoVefGMOvdRCWuFVTmqWZAo17gt+KCah706+cJPTr1UDH xnhQ== X-Gm-Message-State: AOAM532CRNQVAF0v8hUYLGfN5a9YQ7USNbPv5O49PaPjIxsAdKMD7mxB jQYEV5tKYz3mToNwS7OFTJFCYUGj0aA= X-Google-Smtp-Source: ABdhPJy5FmqFNpWToA9DYsxWX6YrcpCwaL07nJjvrxveMsrxxF6kJeuslTXHyQPTFhUDJDQfET6NbA== X-Received: by 2002:adf:c386:: with SMTP id p6mr8289851wrf.344.1595592057400; Fri, 24 Jul 2020 05:00:57 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id f124sm131403wmf.7.2020.07.24.05.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:00:56 -0700 (PDT) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: dpdk stable Date: Fri, 24 Jul 2020 12:57:27 +0100 Message-Id: <20200724120030.1863487-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/netvsc: do not query VF link state' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From bbcbaf834f0ef6e42c17fb47745953747b370e3d Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 19 May 2020 09:52:28 -0700 Subject: [PATCH] net/netvsc: do not query VF link state [ upstream commit a4f53bec7c0a8eebeb8ccff0afa46bfedf932916 ] When the primary device link state is queried, there is no need to query the VF state as well. The application only sees the state of the synthetic device. Fixes: dc7680e8597c ("net/netvsc: support integrated VF") Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 4 +- drivers/net/netvsc/hn_var.h | 3 -- drivers/net/netvsc/hn_vf.c | 99 +++++----------------------------- 3 files changed, 15 insertions(+), 91 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 6950682a9..20cf1cc90 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -201,7 +201,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev) */ int hn_dev_link_update(struct rte_eth_dev *dev, - int wait_to_complete) + int wait_to_complete __rte_unused) { struct hn_data *hv = dev->data->dev_private; struct rte_eth_link link, old; @@ -215,8 +215,6 @@ hn_dev_link_update(struct rte_eth_dev *dev, hn_rndis_get_linkspeed(hv); - hn_vf_link_update(dev, wait_to_complete); - link = (struct rte_eth_link) { .link_duplex = ETH_LINK_FULL_DUPLEX, .link_autoneg = ETH_LINK_SPEED_FIXED, diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index b4c617173..4c1e6b8c3 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -140,7 +140,6 @@ struct hn_data { uint16_t rss_ind[128]; struct rte_eth_dev_owner owner; - struct rte_intr_handle vf_intr; struct vmbus_channel *channels[HN_MAX_CHANNELS]; }; @@ -222,8 +221,6 @@ int hn_vf_mc_addr_list(struct rte_eth_dev *dev, struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); -int hn_vf_link_update(struct rte_eth_dev *dev, - int wait_to_complete); int hn_vf_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index 97333b502..4e774d9d9 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -100,16 +100,8 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) rte_spinlock_lock(&hv->vf_lock); err = hn_vf_attach(hv, port); - - if (err == 0) { - dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; - hv->vf_intr = (struct rte_intr_handle) { - .fd = -1, - .type = RTE_INTR_HANDLE_EXT, - }; - dev->intr_handle = &hv->vf_intr; + if (err == 0) hn_nvs_set_datapath(hv, NVS_DATAPATH_VF); - } rte_spinlock_unlock(&hv->vf_lock); return err; @@ -231,80 +223,6 @@ int hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info) return ret; } -int hn_vf_link_update(struct rte_eth_dev *dev, - int wait_to_complete) -{ - struct hn_data *hv = dev->data->dev_private; - struct rte_eth_dev *vf_dev; - int ret = 0; - - rte_spinlock_lock(&hv->vf_lock); - vf_dev = hn_get_vf_dev(hv); - if (vf_dev && vf_dev->dev_ops->link_update) - ret = (*vf_dev->dev_ops->link_update)(vf_dev, wait_to_complete); - rte_spinlock_unlock(&hv->vf_lock); - - return ret; -} - -/* called when VF has link state interrupts enabled */ -static int hn_vf_lsc_event(uint16_t port_id __rte_unused, - enum rte_eth_event_type event, - void *cb_arg, void *out __rte_unused) -{ - struct rte_eth_dev *dev = cb_arg; - - if (event != RTE_ETH_EVENT_INTR_LSC) - return 0; - - /* if link state has changed pass on */ - if (hn_dev_link_update(dev, 0) == 0) - return 0; /* no change */ - - return _rte_eth_dev_callback_process(dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); -} - -static int _hn_vf_configure(struct rte_eth_dev *dev, - uint16_t vf_port, - const struct rte_eth_conf *dev_conf) -{ - struct rte_eth_conf vf_conf = *dev_conf; - struct rte_eth_dev *vf_dev; - int ret; - - vf_dev = &rte_eth_devices[vf_port]; - if (dev_conf->intr_conf.lsc && - (vf_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) { - PMD_DRV_LOG(DEBUG, "enabling LSC for VF %u", - vf_port); - vf_conf.intr_conf.lsc = 1; - } else { - PMD_DRV_LOG(DEBUG, "disabling LSC for VF %u", - vf_port); - vf_conf.intr_conf.lsc = 0; - } - - ret = rte_eth_dev_configure(vf_port, - dev->data->nb_rx_queues, - dev->data->nb_tx_queues, - &vf_conf); - if (ret) { - PMD_DRV_LOG(ERR, - "VF configuration failed: %d", ret); - } else if (vf_conf.intr_conf.lsc) { - ret = rte_eth_dev_callback_register(vf_port, - RTE_ETH_DEV_INTR_LSC, - hn_vf_lsc_event, dev); - if (ret) - PMD_DRV_LOG(ERR, - "Failed to register LSC callback for VF %u", - vf_port); - } - return ret; -} - /* * Configure VF if present. * Force VF to have same number of queues as synthetic device @@ -313,11 +231,22 @@ int hn_vf_configure(struct rte_eth_dev *dev, const struct rte_eth_conf *dev_conf) { struct hn_data *hv = dev->data->dev_private; + struct rte_eth_conf vf_conf = *dev_conf; int ret = 0; + /* link state interrupt does not matter here. */ + vf_conf.intr_conf.lsc = 0; + rte_spinlock_lock(&hv->vf_lock); - if (hv->vf_port != HN_INVALID_PORT) - ret = _hn_vf_configure(dev, hv->vf_port, dev_conf); + if (hv->vf_port != HN_INVALID_PORT) { + ret = rte_eth_dev_configure(hv->vf_port, + dev->data->nb_rx_queues, + dev->data->nb_tx_queues, + &vf_conf); + if (ret != 0) + PMD_DRV_LOG(ERR, + "VF configuration failed: %d", ret); + } rte_spinlock_unlock(&hv->vf_lock); return ret; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:48.946131528 +0100 +++ 0009-net-netvsc-do-not-query-VF-link-state.patch 2020-07-24 12:53:48.159004075 +0100 @@ -1,27 +1,28 @@ -From a4f53bec7c0a8eebeb8ccff0afa46bfedf932916 Mon Sep 17 00:00:00 2001 +From bbcbaf834f0ef6e42c17fb47745953747b370e3d Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 19 May 2020 09:52:28 -0700 Subject: [PATCH] net/netvsc: do not query VF link state +[ upstream commit a4f53bec7c0a8eebeb8ccff0afa46bfedf932916 ] + When the primary device link state is queried, there is no need to query the VF state as well. The application only sees the state of the synthetic device. Fixes: dc7680e8597c ("net/netvsc: support integrated VF") -Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 4 +- drivers/net/netvsc/hn_var.h | 3 -- - drivers/net/netvsc/hn_vf.c | 98 +++++----------------------------- - 3 files changed, 15 insertions(+), 90 deletions(-) + drivers/net/netvsc/hn_vf.c | 99 +++++----------------------------- + 3 files changed, 15 insertions(+), 91 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c -index 0f4827c54..ac182a548 100644 +index 6950682a9..20cf1cc90 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c -@@ -202,7 +202,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev) +@@ -201,7 +201,7 @@ static int hn_parse_args(const struct rte_eth_dev *dev) */ int hn_dev_link_update(struct rte_eth_dev *dev, @@ -30,7 +31,7 @@ { struct hn_data *hv = dev->data->dev_private; struct rte_eth_link link, old; -@@ -216,8 +216,6 @@ hn_dev_link_update(struct rte_eth_dev *dev, +@@ -215,8 +215,6 @@ hn_dev_link_update(struct rte_eth_dev *dev, hn_rndis_get_linkspeed(hv); @@ -40,10 +41,10 @@ .link_duplex = ETH_LINK_FULL_DUPLEX, .link_autoneg = ETH_LINK_SPEED_FIXED, diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h -index 20363389a..881832d85 100644 +index b4c617173..4c1e6b8c3 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h -@@ -141,7 +141,6 @@ struct hn_data { +@@ -140,7 +140,6 @@ struct hn_data { uint16_t rss_ind[128]; struct rte_eth_dev_owner owner; @@ -51,7 +52,7 @@ struct vmbus_channel *channels[HN_MAX_CHANNELS]; }; -@@ -228,8 +227,6 @@ int hn_vf_mc_addr_list(struct rte_eth_dev *dev, +@@ -222,8 +221,6 @@ int hn_vf_mc_addr_list(struct rte_eth_dev *dev, struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); @@ -61,13 +62,14 @@ uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c -index a745c7c36..f5f15c046 100644 +index 97333b502..4e774d9d9 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c -@@ -97,15 +97,8 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) - } +@@ -100,16 +100,8 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) + rte_spinlock_lock(&hv->vf_lock); err = hn_vf_attach(hv, port); +- - if (err == 0) { - dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; - hv->vf_intr = (struct rte_intr_handle) { @@ -78,10 +80,10 @@ + if (err == 0) hn_nvs_set_datapath(hv, NVS_DATAPATH_VF); - } + rte_spinlock_unlock(&hv->vf_lock); return err; - } -@@ -223,80 +216,6 @@ int hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info) +@@ -231,80 +223,6 @@ int hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info) return ret; } @@ -92,11 +94,11 @@ - struct rte_eth_dev *vf_dev; - int ret = 0; - -- rte_rwlock_read_lock(&hv->vf_lock); +- rte_spinlock_lock(&hv->vf_lock); - vf_dev = hn_get_vf_dev(hv); - if (vf_dev && vf_dev->dev_ops->link_update) - ret = (*vf_dev->dev_ops->link_update)(vf_dev, wait_to_complete); -- rte_rwlock_read_unlock(&hv->vf_lock); +- rte_spinlock_unlock(&hv->vf_lock); - - return ret; -} @@ -162,7 +164,7 @@ /* * Configure VF if present. * Force VF to have same number of queues as synthetic device -@@ -305,11 +224,22 @@ int hn_vf_configure(struct rte_eth_dev *dev, +@@ -313,11 +231,22 @@ int hn_vf_configure(struct rte_eth_dev *dev, const struct rte_eth_conf *dev_conf) { struct hn_data *hv = dev->data->dev_private; @@ -172,7 +174,7 @@ + /* link state interrupt does not matter here. */ + vf_conf.intr_conf.lsc = 0; + - rte_rwlock_read_lock(&hv->vf_lock); + rte_spinlock_lock(&hv->vf_lock); - if (hv->vf_port != HN_INVALID_PORT) - ret = _hn_vf_configure(dev, hv->vf_port, dev_conf); + if (hv->vf_port != HN_INVALID_PORT) { @@ -184,7 +186,7 @@ + PMD_DRV_LOG(ERR, + "VF configuration failed: %d", ret); + } - rte_rwlock_read_unlock(&hv->vf_lock); + rte_spinlock_unlock(&hv->vf_lock); return ret; } --