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 79CEEA057D; Wed, 18 Mar 2020 21:51:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 307571BF82; Wed, 18 Mar 2020 21:51:18 +0100 (CET) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id E91A5FEB for ; Wed, 18 Mar 2020 21:51:14 +0100 (CET) Received: by mail-pf1-f195.google.com with SMTP id f206so110638pfa.10 for ; Wed, 18 Mar 2020 13:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hzVAm9u+dULJ7B3oegwe+jNbuEADxU2ov+7HVG8Vajk=; b=dfSGfQj8tEyG1dSYTqLxED5bSbmAP7DwiAUbucsM2Yv5LadarjZtP1LFFk5KsXDbBY U61gEtyH7NBFr5k4BGV1bfg41Lswk43FYDRw7UoOZC6EYd7LvYaVWvCylafDiz82tFuL JRr5jhK6U/avewr65Ta76PPc/JdCgdgqoODpBWfSmsOliLpPkijBAarT52er3E3T3FnR /Cg+6GOLtrephGcPMrLE3D1xY9egHPkabMVYD7R0LG9DMt2DQtFCTF3SAwUzdCIu8Ymv /wEmD/W7RhIumynFiVEsj4y6J6zCeY1hmDffzdNcNlcc9bN2IB6htoDVWIcLuwNN6L/2 t3GQ== 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=hzVAm9u+dULJ7B3oegwe+jNbuEADxU2ov+7HVG8Vajk=; b=jVY1qwKKBwu3OS26ZC52rUsRyoMUMsBk8ewEiMKfSvPoeFea9+iJ5Id/J+b7IYTxGl 9lgWWaz92eytALhXXi1miGuHgwLOqVJMP5BbC5Hbkwh8tLgsMX1WXAo8jAjDC6SzT52V mL8NqpnuGUxJ1BuEd3vkojDNYzA66+ZUv8k/DxoS8S9Mwtu5stqTC2KYnXuIBcq8ZMIS X8lv9Wm2/FYqsbFTsjRPTKYO6ZR28mDhgUoLxZ4nEwv2GwO1/gLq8ye4G68U9cC9v2+y Mn8eflOPOjQUi9/V1hle/w5vxkXoflwkLigRud11mcCmdw2/ymMJ/JO2EBd6qchmc3yt xE5A== X-Gm-Message-State: ANhLgQ3NqNpgfaSRVupiElhxLzVLJ69BgqkLzg/JjgzYGbkmNJMc2nTs +RP3u1s5O1jqhg+UaSX3880n49JVPho= X-Google-Smtp-Source: ADFU+vsJbdAgTMF/IzMh76FI2o9ajD8vEGpPypdSsyLt3hoTOTt6kit4UY4CS2w+JRS0FE/Hhy5h9g== X-Received: by 2002:a62:4e57:: with SMTP id c84mr180617pfb.156.1584564673636; Wed, 18 Mar 2020 13:51:13 -0700 (PDT) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id e80sm7800150pfh.117.2020.03.18.13.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 13:51:12 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org Date: Wed, 18 Mar 2020 13:51:01 -0700 Message-Id: <20200318205104.22486-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200318205104.22486-1-stephen@networkplumber.org> References: <20200316235612.29854-1-stephen@networkplumber.org> <20200318205104.22486-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 1/4] net/netvsc: propagate descriptor limits from VF to netvsc 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" If application cares about descriptor limits, the netvsc device values should reflect those of the VF as well. Fixes: dc7680e8597c ("net/netvsc: support integrated VF") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_vf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index 7a3734cadfa4..1261b2e2ef85 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -167,6 +167,17 @@ hn_nvs_handle_vfassoc(struct rte_eth_dev *dev, hn_vf_remove(hv); } +static void +hn_vf_merge_desc_lim(struct rte_eth_desc_lim *lim, + const struct rte_eth_desc_lim *vf_lim) +{ + lim->nb_max = RTE_MIN(vf_lim->nb_max, lim->nb_max); + lim->nb_min = RTE_MAX(vf_lim->nb_min, lim->nb_min); + lim->nb_align = RTE_MAX(vf_lim->nb_align, lim->nb_align); + lim->nb_seg_max = RTE_MIN(vf_lim->nb_seg_max, lim->nb_seg_max); + lim->nb_mtu_seg_max = RTE_MIN(vf_lim->nb_seg_max, lim->nb_seg_max); +} + /* * Merge the info from the VF and synthetic path. * use the default config of the VF @@ -196,11 +207,13 @@ static int hn_vf_info_merge(struct rte_eth_dev *vf_dev, info->max_tx_queues); info->tx_offload_capa &= vf_info.tx_offload_capa; info->tx_queue_offload_capa &= vf_info.tx_queue_offload_capa; + hn_vf_merge_desc_lim(&info->tx_desc_lim, &vf_info.tx_desc_lim); info->min_rx_bufsize = RTE_MAX(vf_info.min_rx_bufsize, info->min_rx_bufsize); info->max_rx_pktlen = RTE_MAX(vf_info.max_rx_pktlen, info->max_rx_pktlen); + hn_vf_merge_desc_lim(&info->rx_desc_lim, &vf_info.rx_desc_lim); return 0; } -- 2.20.1