Page MenuHomeFreeBSD

mxge(4) should pass unhandled ioctls to ether_ioctl()
ClosedPublic

Authored by rpokala on Feb 15 2018, 3:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 4:06 AM
Unknown Object (File)
Dec 12 2023, 6:05 PM
Unknown Object (File)
Nov 12 2023, 6:35 PM
Unknown Object (File)
Nov 7 2023, 5:43 PM
Unknown Object (File)
Nov 5 2023, 10:20 AM
Unknown Object (File)
Nov 5 2023, 7:32 AM
Unknown Object (File)
Nov 3 2023, 4:45 AM
Unknown Object (File)
Oct 31 2023, 4:34 PM
Subscribers

Details

Summary

Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when
the NIC is not a member of a lagg. This came as a surprise, because the
SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the
laggX interface, rather than a physical port) or EINVAL (if run against a
non-member physical port). This behavior was not seen with other drivers,
such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl
handlers, I found that they all called ether_ioctl() for the default (i.e.
unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two
specific cases, and returns ENOTTY for the default case.

Remove the two cases which explicitly call ether_ioctl(), and let the
default case call it instead. This matches what the vast majority of the NIC
drivers do.

Test Plan

Call ioctl(SIOCGLAGGPORT) against mxge interfaces which are and are not part
of a lagg. In the former case, it should be successful. In the latter case,
it should return EINVAL.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 15 2018, 3:16 AM
This revision was automatically updated to reflect the committed changes.

Well thats embarrassing. Thanks for the fix.

Well thats embarrassing. Thanks for the fix.

Eh, it happens to the best of us from time to time. :-)