Skip to contentSkip to conversation

i40e: Fix unexpected MFS warning message

PATCH In review Ivan Vecera 2 participants 2 messages Nov 10, 2023 – Nov 11, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40e: Fix unexpected MFS warning message

Commit 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set") added a warning message that reports unexpected size of port's MFS (max frame size) value. This message use for the port number local variable 'i' that is wrong.
In i40e_probe() this 'i' variable is used only to iterate VSIs to find FDIR VSI:

<code>
...
/* if FDIR VSI was set up, start it now */

        for (i = 0; i < pf->num_alloc_vsi; i++) {
                if (pf->vsi[i] && pf->vsi[i]->type == I40E_VSI_FDIR) {
                        i40e_vsi_open(pf->vsi[i]);
                        break;
                }
        }

...
</code>

So the warning message use for the port number indext of FDIR VSI if this exists or pf->num_alloc_vsi if not.

Fix the message by using 'pf->hw.port' for the port number.

Fixes 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set")
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index e870afa0e401..c36535145a41 100644
@@ -16225,7 +16225,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	       I40E_PRTGL_SAH_MFS_MASK) >> I40E_PRTGL_SAH_MFS_SHIFT;
 	if (val < MAX_FRAME_SIZE_DEFAULT)
 		dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n",
-			 i, val);
+			 pf->hw.port, val);
 
 	/* Add a filter to drop all Flow control frames from any VSI from being
 	 * transmitted. By doing so we stop a malicious VF from sending out
Signature · 1 line
2.41.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Ivan Vecera

Commit 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set") added a warning message that reports unexpected size of port's MFS (max frame size) value. This message use for the port number local variable 'i' that is wrong.
In i40e_probe() this 'i' variable is used only to iterate VSIs to find FDIR VSI:

<code>
...
/* if FDIR VSI was set up, start it now */

        for (i = 0; i < pf->num_alloc_vsi; i++) {
                if (pf->vsi[i] && pf->vsi[i]->type == I40E_VSI_FDIR) {
                        i40e_vsi_open(pf->vsi[i]);
                        break;
                }
        }

...
</code>

Quoted 7 lines

So the warning message use for the port number indext of FDIR VSI if this exists or pf->num_alloc_vsi if not.

Fix the message by using 'pf->hw.port' for the port number.

Fixes 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set")

Thanks Ivan,

I agree with your analysis that this change corrects the port number printed. And that the problem is introduced in the cited commit.