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 D27C8A057D; Wed, 18 Mar 2020 21:34:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D2DA31BF30; Wed, 18 Mar 2020 21:34:16 +0100 (CET) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id 3508225D9 for ; Wed, 18 Mar 2020 21:34:14 +0100 (CET) Received: by mail-pj1-f66.google.com with SMTP id ng8so1848899pjb.2 for ; Wed, 18 Mar 2020 13:34: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=ljfiiDQkyjfFj1polhsvWITMUn1c8UQtBwq52IKL3B5o1uj7fMN5JXFbg3o+5ZaTFV adJFQv/YgzucRPDeUjk5yrctythaLWjeNrL5JwKvXY62ELjqzdNc+9810F18nq7xsJ2X AmRkZNLRmAR7Ltp9w6gA35PV+rGZVKNN30ev5wsgHhuifAzOVQ61D0GJ/qUkxqKnYGMC lRBGPQxm7ol1nUEWGYia0ACmT9niHPEK7/zAwo4w3FnKTI2s5dBvQALX+K533k0ovoPn MSFa0cNh2S556tOto94JirkJuzYGDp+nGQvgXp9ObHKth8a5qZv3V/XY37oR2jHVFYjI V0Rw== 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=Z3ntAy276YVHMIGJX2KRSEbk3QhwzNalN5DqGaiPWxjv4W901QmssC8IwNH/ejhbZG dNwAYcrd0zuXyhnMUqIEAKAnAQkMQT64Lk5+uraEYuxeOho2lGF1jN28YHyLFDU8T8uJ KFqSwEq2rKmVQVTGe3xEU0cInULwk7hSAbGXvPfFl3kQK2YiwkAxtCc5yYmTScJ313wN bCgDhlVqECfoyClYcD0eYK1hXul/9yghKpV/SI235e8mc2ESjjSnAA88iFnPy4sbQKM1 HAIh4g0Wu9FKH7fXTb02/NY5DAq3VEEoY1TIu1TkZTrgmk1UgBexoAq63g3cTuiFxlEp RXOw== X-Gm-Message-State: ANhLgQ3U9CF4u5kxdv0nqq6VLOeU+Hat/RIVuPr+2VT2w/z6bX2CPMdY xTCmcLw88s19JiIO8mnTMEFp7j5GsM4= X-Google-Smtp-Source: ADFU+vsVP1W8mZ1A5oRhVquYjeuvZDBBZKMVdueTuhPqgsi8XutwQ9PhZuHhEyusT/oAygtL7LRt3Q== X-Received: by 2002:a17:90b:228e:: with SMTP id kx14mr6363673pjb.134.1584563652600; Wed, 18 Mar 2020 13:34:12 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id p2sm7627591pfb.41.2020.03.18.13.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 13:34:11 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org Date: Wed, 18 Mar 2020 13:29:54 -0700 Message-Id: <20200318202957.18121-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200318202957.18121-1-stephen@networkplumber.org> References: <20200316235612.29854-1-stephen@networkplumber.org> <20200318202957.18121-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 1/4] net/netvsc: propogate 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