From: "Zhang,Alvin" <alvinx.zhang@intel.com>
To: jia.guo@intel.com, haiyue.wang@intel.com
Cc: dev@dpdk.org, Alvin Zhang <alvinx.zhang@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ixgbe: check the result of setting VF MTU
Date: Wed, 2 Dec 2020 17:48:06 +0800 [thread overview]
Message-ID: <20201202094806.11464-1-alvinx.zhang@intel.com> (raw)
From: Alvin Zhang <alvinx.zhang@intel.com>
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 <alvinx.zhang@intel.com>
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
next reply other threads:[~2020-12-02 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 9:48 Zhang,Alvin [this message]
2020-12-02 10:54 ` Wang, Haiyue
2020-12-11 2:32 ` Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201202094806.11464-1-alvinx.zhang@intel.com \
--to=alvinx.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=haiyue.wang@intel.com \
--cc=jia.guo@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).