Page MenuHomeFreeBSD

Mechanically convert if_cxgb(4) and if_cxgbe(4) to IfAPI
ClosedPublic

Authored by jhibbits on Feb 14 2023, 10:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 2 2024, 3:43 AM
Unknown Object (File)
Jan 14 2024, 6:49 AM
Unknown Object (File)
Jan 10 2024, 2:02 AM
Unknown Object (File)
Nov 15 2023, 10:08 AM
Unknown Object (File)
Nov 10 2023, 5:47 AM
Unknown Object (File)
Oct 27 2023, 12:35 PM
Unknown Object (File)
Oct 9 2023, 4:39 AM
Unknown Object (File)
Sep 20 2023, 6:39 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 50084
Build 46976: arc lint + arc unit

Event Timeline

zlei added inline comments.
sys/dev/cxgbe/t4_main.c
6394

Mark this in my review backlog

6426

Missing getter for if_flags

jhibbits added inline comments.
sys/dev/cxgbe/t4_main.c
6394

This one was a little tricky. I had to grep around to see when if_get_counter gets set to vi_get_counter, and just use the same conditions.

6426

Oops.

Was this done with some coccinelle type script or something similar? I have a bunch of code that is not upstream yet and it is not ifAPI style. If there's a script I could run pre-commit to make sure any new code is ifAPI clean it would be quite useful.

Not coccinelle, but there's a script that'll get "most of the way" at tools/ifnet/convert_ifapi.sh . Coccinelle would probably be better, less error-prone, but I don't know enough, and the script has been in the tree since 2014 (as convert_drvapi.sh)

I'm done looking at the cxgb part, will look at cxgbe next.

cxgb is missing some 'struct ifnet *' to 'if_t' substitutions
2 in cxgb/common/cxgb_ctl_defs.h.
3 in cxgb/cxgb_adapter.h

And I've added some inline comments with minor stuff.

sys/dev/cxgb/cxgb_main.c
1051–1054

Unneeded parantheses around the 3rd argument in both of these.

1735–1736

This pair can be combined into one call?

if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);

1830–1831

Excessive parentheses here too.

1963

Extra parentheses.

1975

Extra parentheses.

sys/dev/cxgbe/adapter.h
606

Do the comments line up vertically with the rest after this conversion? I can't always tell while looking at phab. Please fix if needed. This applies to other similar changes too.

1464–1465

This is gone. Please rebase to latest main.

sys/dev/cxgbe/t4_main.c
2861

Extra parentheses.

2873

Extra parentheses.

6394

I'll add an inline function for this in the driver otherwise the test here and in in the location it was copied from might diverge. This is my action item.

This revision is now accepted and ready to land.Mar 7 2023, 7:07 PM