net/ixgbe: check the result of setting VF MTU
PATCH 1/1 net/ixgbe: check the result of setting VF MTU
From: Alvin Zhang <[email protected]>
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.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -1
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +6 -2
@@ -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
Signature · 1 line
1.8.3.1
Quoted 14 lines
-----Original Message-----
From: Zhang,Alvin <[email protected]>
Sent: Wednesday, December 2, 2020 17:48
To: Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH] net/ixgbe: check the result of setting VF MTUFrom: Alvin Zhang <[email protected]>
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.
Quoted 9 lines
Signed-off-by Alvin Zhang <[email protected]>Fixes 12cd0cccc3db ("ixgbevf: allow to set MTU")--- drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
Quoted 2 lines
--
1.8.3.1
Zhang, Qi Z
AppliedQuoted 34 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Wang, Haiyue
Sent: Wednesday, December 2, 2020 6:55 PM
To: Zhang, AlvinX <[email protected]>; Guo, Jia <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: check the result of setting VF MTUQuoted 15 lines
-----Original Message-----
From: Zhang,Alvin <[email protected]>
Sent: Wednesday, December 2, 2020 17:48
To: Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH] net/ixgbe: check the result of setting VF MTUFrom: Alvin Zhang <[email protected]>
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.
Quoted 9 lines
Signed-off-by Alvin Zhang <[email protected]>Fixes 12cd0cccc3db ("ixgbevf: allow to set MTU")--- drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++- drivers/net/ixgbe/ixgbe_rxtx.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
Quoted 1 line
Acked-by Haiyue Wang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi
Quoted 3 lines
Quoted 3 lines
--
1.8.3.1