From patchwork Tue Mar 31 17:13:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 67509 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EA9D2A0562; Tue, 31 Mar 2020 19:14:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CAC531C0B3; Tue, 31 Mar 2020 19:14:20 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id E98761C0B1 for ; Tue, 31 Mar 2020 19:14:17 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id v23so8339054ply.10 for ; Tue, 31 Mar 2020 10:14:17 -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=U3ZZ3QAStCfHwZ4hSKa5/giNZ/+Idu3vRCckM+j/8fMDoGpUqzW4K+viX0FTT032Im 8adFS7staE7ivT2pzgWICZOkuVXiK55s/xYODOPUGEeOjB/VTTPHvEjn55pB4hDEfKJr goLPOyUxb2lze3h0Cgtk9R0SP1xX5PmEAoCgkIFNW6jcJMXrOGdzz9mbjL1QkDCkFVU0 JE1cIYMgBjU7KR4jEj7pVfC1BtZ9YwBrJ8Y/3zWI5/7mMJKxld/K4pQCWZPwiKUBs0sQ 0QlddD7tYNNHfz8ohy/Rp8wo+xQ+b25uFg3A/HwNSj+sh4M8Gq2S+ePI10TDlsBQw02l L34A== 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=ES9u45liZ9RkKer8YVRExEvO4oQvGpheKzsZA8kUYjYK2Vda1VFYMDd6mz3viUOMG5 7m4ak3d3YQQYQn1nxuseaBVolNINPpvj96zS4IeGj9jFoQvRK/naohIX82PY8yvfABzg ix7B5QSUV1JkzonQLHIlnfpFRgj64JzM+wjnDILcTyDuorf608WbfBGmwnbG3KxvuiKn l0tqDh4FRXvSE95/E8eZxT93I0v6Vqx92MfqF65wjtm1MqM9YdvLN95cR3HUnuqs99sr w/lZ1JmBljUZJ+Ty7xXTae7OH5Ey9ZIAn4Z9WW1Y+H/0Qi2Q/hlsAuG1u22MTU6X99Jh pZtw== X-Gm-Message-State: ANhLgQ3ALbsSydr5Rt1mV5IV0hCfUEPf2o33C4NPWK3ewAicLOX26m8R BzeiCH6KMR4IfpqicjXf3l8a1/W4UZDI4w== X-Google-Smtp-Source: ADFU+vvAqef61+DBerL1oh1flnX37SB0zGb0CMjEbNvrrrplm0S3QgzLmkUAyDckVP1RiF137ro8Aw== X-Received: by 2002:a17:902:562:: with SMTP id 89mr17977918plf.249.1585674855828; Tue, 31 Mar 2020 10:14:15 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id i124sm12869764pfg.14.2020.03.31.10.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 10:14:14 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org Date: Tue, 31 Mar 2020 10:13:57 -0700 Message-Id: <20200331171404.23596-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331171404.23596-1-stephen@networkplumber.org> References: <20200316235612.29854-1-stephen@networkplumber.org> <20200331171404.23596-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 1/8] 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; }