Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i40e: Report MFS in decimal base instead of hex

If the MFS is set below the default (0x2600), a warning message is
reported like the following :

MFS for port 1 has been set below the default: 600

This message is a bit confusing as the number shown here (600) is in
fact an hexa number: 0x600 = 1536

Without any explicit "0x" prefix, this message is read like the MFS is
set to 600 bytes.

MFS, as per MTUs, are usually expressed in decimal base.

This commit reports both current and default MFS values in decimal
so it's less confusing for end-users.

A typical warning message looks like the following :

MFS for port 1 (1536) has been set below the default (9728)

Signed-off-by: Erwan Velu <e.velu@criteo.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Fixes: 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set")
Link: https://lore.kernel.org/r/20240423182723.740401-3-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Erwan Velu and committed by
Jakub Kicinski
ef3c3131 2cc7d150

+2 -2
+2 -2
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 16107 16107 val = FIELD_GET(I40E_PRTGL_SAH_MFS_MASK, 16108 16108 rd32(&pf->hw, I40E_PRTGL_SAH)); 16109 16109 if (val < MAX_FRAME_SIZE_DEFAULT) 16110 - dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n", 16111 - pf->hw.port, val); 16110 + dev_warn(&pdev->dev, "MFS for port %x (%d) has been set below the default (%d)\n", 16111 + pf->hw.port, val, MAX_FRAME_SIZE_DEFAULT); 16112 16112 16113 16113 /* Add a filter to drop all Flow control frames from any VSI from being 16114 16114 * transmitted. By doing so we stop a malicious VF from sending out