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 C8D91A04DC for ; Wed, 2 Dec 2020 10:48:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 95FD0C9C4; Wed, 2 Dec 2020 10:48:20 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 0F709C954; Wed, 2 Dec 2020 10:48:16 +0100 (CET) IronPort-SDR: E1NTkowylYsum0RfUjiR26sMAiqDSqnEo+6vaeGPgl0hwvph0ZXlsmauIXvZ9k85LM+9GvL6IK n/hFzGXx89ZA== X-IronPort-AV: E=McAfee;i="6000,8403,9822"; a="152817071" X-IronPort-AV: E=Sophos;i="5.78,386,1599548400"; d="scan'208";a="152817071" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 01:48:15 -0800 IronPort-SDR: 3dbR6240mC/BuOuDr1CKqAhGlphUzFgAYDI0O1o22NQ5vu8ScV0Z9/yknHKBWR/un9r17JsVUP SvgxjXXSrtJQ== X-IronPort-AV: E=Sophos;i="5.78,386,1599548400"; d="scan'208";a="539606724" Received: from shwdenpg235.ccr.corp.intel.com ([10.240.182.60]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 01:48:13 -0800 From: "Zhang,Alvin" To: jia.guo@intel.com, haiyue.wang@intel.com Cc: dev@dpdk.org, Alvin Zhang , stable@dpdk.org Date: Wed, 2 Dec 2020 17:48:06 +0800 Message-Id: <20201202094806.11464-1-alvinx.zhang@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] net/ixgbe: check the result of setting VF MTU 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" From: Alvin Zhang If a VF request to set a invalid maximum packet length value, The PF kernel driver may disable its reception. This patch add codes to output information and return the error status. Signed-off-by: Alvin Zhang Fixes: 12cd0cccc3db ("ixgbevf: allow to set MTU") Cc: stable@dpdk.org --- drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 9a47a8b..d7a1806 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -6555,7 +6555,8 @@ static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on) * prior to 3.11.33 which contains the following change: * "ixgbe: Enable jumbo frames support w/ SR-IOV" */ - ixgbevf_rlpml_set_vf(hw, max_frame); + if (ixgbevf_rlpml_set_vf(hw, max_frame)) + return -EINVAL; /* update max frame size */ dev->data->dev_conf.rxmode.max_rx_pkt_len = max_frame; diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 6cfbb58..7bb8460 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -5634,8 +5634,12 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev) * ixgbevf_rlpml_set_vf even if jumbo frames are not used. This way, * VF packets received can work in all cases. */ - ixgbevf_rlpml_set_vf(hw, - (uint16_t)dev->data->dev_conf.rxmode.max_rx_pkt_len); + if (ixgbevf_rlpml_set_vf(hw, + (uint16_t)dev->data->dev_conf.rxmode.max_rx_pkt_len)) { + PMD_INIT_LOG(ERR, "Set max packet length to %d failed.", + dev->data->dev_conf.rxmode.max_rx_pkt_len); + return -EINVAL; + } /* * Assume no header split and no VLAN strip support -- 1.8.3.1