From: Mateusz Palczewski <mateusz.palczewski@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: Michal Jaron <michalx.jaron@intel.com>
Subject: [Intel-wired-lan] [PATCH net v1 1/2] iavf: Fix vf set max mtu size with port vlan and jumbo frames
Date: Tue, 6 Sep 2022 11:14:10 +0200 [thread overview]
Message-ID: <20220906091411.910107-2-mateusz.palczewski@intel.com> (raw)
In-Reply-To: <20220906091411.910107-1-mateusz.palczewski@intel.com>
From: Michal Jaron <michalx.jaron@intel.com>
After setting port vlan and mtu 9000 on vf with ice driver there
was an iavf error
"PF returned error -5 (IAVF_ERR_PARAM) to our request 6".
It was caused by that during queues configuration vf's max packet
size was set to IAVF_MAX_RXBUFFER but on ice max frame size was
smaller by VLAN_HLEN due to making some space for port vlan as VF
is not aware whether it's in a port VLAN. This mismatch in sizes
caused that ice rejects queues configuration with ERR_PARAM error.
Proper max_mtu is send from ice pf to vf with GET_VF_RESOURCES msg
but vf does not look at this.
In iavf change max_frame from IAVF_MAX_RXBUFFER to max_mtu
received from pf with GET_VF_RESOURCES msg to make vf's
max_frame_size dependent from pf. Add check if received max_mtu is
not in eligible range then set it to IAVF_MAX_RXBUFFER.
Fixes: dab86afdbbd1 ("i40e/i40evf: Change the way we limit the maximum frame size for Rx")
Signed-off-by: Michal Jaron <michalx.jaron@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index 15ee85dc33bd..e468f1324541 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -269,11 +269,14 @@ int iavf_get_vf_vlan_v2_caps(struct iavf_adapter *adapter)
void iavf_configure_queues(struct iavf_adapter *adapter)
{
struct virtchnl_vsi_queue_config_info *vqci;
- struct virtchnl_queue_pair_info *vqpi;
+ int i, max_frame = adapter->vf_res->max_mtu;
int pairs = adapter->num_active_queues;
- int i, max_frame = IAVF_MAX_RXBUFFER;
+ struct virtchnl_queue_pair_info *vqpi;
size_t len;
+ if (max_frame > IAVF_MAX_RXBUFFER || max_frame < 64)
+ max_frame = IAVF_MAX_RXBUFFER;
+
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) {
/* bail because we already have a command pending */
dev_err(&adapter->pdev->dev, "Cannot configure queues, command %d pending\n",
--
2.27.0
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2022-09-06 9:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 9:14 [Intel-wired-lan] [PATCH net v1 0/2] Fix vf set max mtu size with port vlan and jumbo frames Mateusz Palczewski
2022-09-06 9:14 ` Mateusz Palczewski [this message]
2022-09-06 9:14 ` [Intel-wired-lan] [PATCH net v1 2/2] i40e: Fix vf set max mtu size Mateusz Palczewski
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=20220906091411.910107-2-mateusz.palczewski@intel.com \
--to=mateusz.palczewski@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=michalx.jaron@intel.com \
/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