diff mbox series

[net,2/4] i40e: Report MFS in decimal base instead of hex

Message ID 20240423182723.740401-3-anthony.l.nguyen@intel.com (mailing list archive)
State Accepted
Commit ef3c313119ea448c22da10366faa26b5b4b1a18e
Delegated to: Netdev Maintainers
Headers show
Series Intel Wired LAN Driver Updates 2024-04-23 (i40e, iavf, ice) | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 937 this patch: 937
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 209 this patch: 209
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-24--15-00 (tests: 995)

Commit Message

Tony Nguyen April 23, 2024, 6:27 p.m. UTC
From: Erwan Velu <e.velu@criteo.com>

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>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tony Nguyen April 23, 2024, 6:46 p.m. UTC | #1
On 4/23/2024 11:27 AM, Tony Nguyen wrote:
> From: Erwan Velu <e.velu@criteo.com>
> 
> 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)
> 

Sorry, I forgot to add the Fixes in.

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

Let me know if this is ok or if you'd like me to re-send with this added.

Thanks,
Tony

> 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>
> ---
>   drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 1792491d8d2d..ffb9f9f15c52 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -16107,8 +16107,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>   	val = FIELD_GET(I40E_PRTGL_SAH_MFS_MASK,
>   			rd32(&pf->hw, I40E_PRTGL_SAH));
>   	if (val < MAX_FRAME_SIZE_DEFAULT)
> -		dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n",
> -			 pf->hw.port, val);
> +		dev_warn(&pdev->dev, "MFS for port %x (%d) has been set below the default (%d)\n",
> +			 pf->hw.port, val, MAX_FRAME_SIZE_DEFAULT);
>   
>   	/* 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
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 1792491d8d2d..ffb9f9f15c52 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -16107,8 +16107,8 @@  static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	val = FIELD_GET(I40E_PRTGL_SAH_MFS_MASK,
 			rd32(&pf->hw, I40E_PRTGL_SAH));
 	if (val < MAX_FRAME_SIZE_DEFAULT)
-		dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n",
-			 pf->hw.port, val);
+		dev_warn(&pdev->dev, "MFS for port %x (%d) has been set below the default (%d)\n",
+			 pf->hw.port, val, MAX_FRAME_SIZE_DEFAULT);
 
 	/* 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