Page MenuHomeFreeBSD

net: Remove unneeded NULL check for the allocated ifnet
ClosedPublic

Authored by zlei on Jun 26 2024, 8:58 AM.
Tags
None
Referenced Files
F102124217: D45740.diff
Thu, Nov 7, 10:13 PM
Unknown Object (File)
Thu, Oct 17, 5:52 PM
Unknown Object (File)
Wed, Oct 16, 12:00 PM
Unknown Object (File)
Tue, Oct 15, 1:08 PM
Unknown Object (File)
Tue, Oct 15, 1:08 PM
Unknown Object (File)
Mon, Oct 14, 3:10 AM
Unknown Object (File)
Sat, Oct 12, 1:40 PM
Unknown Object (File)
Wed, Oct 9, 9:52 PM

Details

Summary

Change 4787572d0580 made if_alloc_domain() never fail, then also does the
wrappers if_alloc(), if_alloc_dev() and if_gethandle().

No functional change intended.

MFC after: ???

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

zlei requested review of this revision.Jun 26 2024, 8:58 AM

The full diff is quite large ( about 7 megabytes ). See my dev branch https://github.com/gmshake/freebsd-src/tree/main_if_alloc instead, or I can upload the full diff if requested.

sys/dev/bxe/bxe.c
12988

if_gethandle() was introduced in change 62d76917b867 . In FreeBSD net stack it is just a thin wrapper around if_alloc(). Since 4787572d0580 is a behavior change, I doubt the net stack of Juniper Networks will follow.

Can @glebius comment on that ?

The full diff is quite large ( about 7 megabytes ). See my dev branch https://github.com/gmshake/freebsd-src/tree/main_if_alloc instead, or I can upload the full diff if requested.

I'm not from Juniper :) I would guess Juniper is fine with the proposed changes. They care about IfAPI hiding 'struct ifnet' better and better as time goes by, they don't have a requirement for the API to be never ever changing. I'll add Stephen to reviewers to correct me.

Looks good. I can't answer the wrapper question definitively, but I suspect it will be fine.

The full diff is quite large ( about 7 megabytes ). See my dev branch https://github.com/gmshake/freebsd-src/tree/main_if_alloc instead, or I can upload the full diff if requested.

I'm not from Juniper :) I would guess Juniper is fine with the proposed changes. They care about IfAPI hiding 'struct ifnet' better and better as time goes by, they don't have a requirement for the API to be never ever changing. I'll add Stephen to reviewers to correct me.

Yes, this change is fine.

Landed as aa3860851b9f but it seems Phabricator got fooled.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 1 2024, 5:01 PM
This revision was automatically updated to reflect the committed changes.