Project

General

Profile

Actions

Bug #14597

closed

i40e debug code prints MAC addresses oddly

Added by Dan McDonald 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

I saw an error of this form in my messages:

2022-03-27T18:43:40.089098+00:00 shemp i40e: [ID 517869 kern.warning] WARNING: i40e1: failed to remove mac address  1: 0:5e: 0: 0: 1 from multicast filter: 0

It really should've read as "01:00:5e:00:00:01". It's because the format strings there use "%2x" instead of "%02x".

kebe(io/i40e)[0]% git grep %2x
i40e_gld.c:                 "%2x:%2x:%2x:%2x:%2x:%2x from unicast filter: %d",
i40e_gld.c:                 "%2x:%2x:%2x:%2x:%2x:%2x to unicast filter: %d",
i40e_gld.c:                 "%2x:%2x:%2x:%2x:%2x:%2x to multicast filter: %d",
i40e_gld.c:                         "%2x:%2x:%2x:%2x:%2x:%2x from multicast " 
kebe(io/i40e)[0]% 

It's a simple enough fix: replace the "%2x" with "%02x".

Actions #1

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 2084
Actions #2

Updated by Dan McDonald 6 months ago

I haven't formally tested a fixed i40e yet because inducing filter-errors is annoying. I do know ixgbe(4D) and cxgbe(4D) use %02x, however:

kebe(io/i40e)[1]% cd ../ixgbe/
kebe(io/ixgbe)[0]% git grep %02x
ixgbe_debug.c:  (void) sprintf(form, "%02x:%02x:%02x:%02x:%02x:%02x",
kebe(io/ixgbe)[0]% cd ../cxgbe
kebe(io/cxgbe)[0]% git grep %02x
t4nex/t4_mac.c:             "%02x:%02x:%02x:%02x:%02x:%02x %s %d", mcaddr[0],
kebe(io/cxgbe)[0]% 
Actions #3

Updated by Dan McDonald 6 months ago

I also wrote a toy C program to compare %2x vs. %02x. I have this actual i40e fix running (along with WIP 13230) on an i40e-equipped Compute Node in my home test Triton deployment, but have not encountered i40e printing in any add-or-remove multicast group failures.

Actions #4

Updated by Electric Monk 6 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 6158afa44672def05b584840435f36f75f5a291f

commit  6158afa44672def05b584840435f36f75f5a291f
Author: Dan McDonald <danmcd@joyent.com>
Date:   2022-03-29T13:41:10.000Z

    14597 i40e debug code prints MAC addresses oddly
    Reviewed by: Yuri Pankov <ypankov@tintri.com>
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions #5

Updated by Dan McDonald 6 months ago

Electric Monk wrote in #note-4:

git commit 6158afa44672def05b584840435f36f75f5a291f
[...]

Aha! I was shutting down my i40e machine today, and got this:

2022-03-31T21:03:5.498223+00:00 shemp i40e: [ID 517869 kern.warning] WARNING: i40e1: failed to remove mac address 01:00:5e:00:00:01 from multicast filter: 0

Much better.

Actions

Also available in: Atom PDF