Page MenuHomeFreeBSD

intel ethernet: Use ether_gen_addr
ClosedPublic

Authored by kbowling on Aug 20 2021, 2:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 4:06 AM
Unknown Object (File)
Thu, Oct 24, 2:56 AM
Unknown Object (File)
Sep 22 2024, 5:25 AM
Unknown Object (File)
Sep 18 2024, 7:05 PM
Unknown Object (File)
Sep 18 2024, 5:37 AM
Unknown Object (File)
Sep 17 2024, 11:27 PM
Unknown Object (File)
Sep 17 2024, 2:20 AM
Unknown Object (File)
Sep 15 2024, 3:23 PM
Subscribers

Diff Detail

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

Event Timeline

@jrtc27 is there any issue to CHERI with the ether_addr cast like this? It is __packed.

@jrtc27 is there any issue to CHERI with the ether_addr cast like this? It is __packed.

No, that should be fine, the only time packed causes issues is when it's on structs that contain pointers (including intptr_t). I don't know why ether_addr is packed though, it just contains a byte array, packed is redundant.

imp added inline comments.
sys/dev/e1000/if_em.c
1080

I think this type punning is OK and well defined. The ether_addr structure is just an array of 6 bytes for the array, and hw->mac.addr provides 6 bytes of storage. __packed on the ether_addr structure should keep this well defined.

I don't know why ether_addr is packed though, it just contains a byte array, packed is redundant.

I think it may date from the pre-EABI days of ARM where it did really weird things with structure padding. I suspect it can be dropped, but conservatism and the fact there will be little gain from dropping it has kept people from doing so...

This revision is now accepted and ready to land.Aug 20 2021, 7:11 PM