Skip to content

ixl: fix big-endian hardware interface handling - #2408

Open
mchoo7 wants to merge 1 commit into
freebsd:mainfrom
mchoo7:ixl
Open

ixl: fix big-endian hardware interface handling#2408
mchoo7 wants to merge 1 commit into
freebsd:mainfrom
mchoo7:ixl

Conversation

@mchoo7

@mchoo7 mchoo7 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Correct the byte order at the driver interfaces that do not operate in
host order. Encode little-endian Admin Queue VSI and MAC/VLAN fields,
and decode firmware-provided queue handles, statistics indices, and
event parameters before using them.

Decode transmit descriptor writeback before examining it, and construct
VLAN descriptor fields in host order for the final descriptor
conversion. Store paged HMC descriptors in little-endian form and retain
the selected field bits when reading HMC contexts.

Keep MMIO values in host order for bus-space accessors and remove the
obsolete le16_to_cpu no-op macro. In particular, retain the atomic
bus_space_read_8() used for 64-bit registers.

On big-endian systems, the unconverted perfect-match filter flag is
presented to firmware as 0x0100 instead of 0x0001. Firmware rejects that
command with EINVAL, leaving receive traffic functional only in
promiscuous mode.

MFC after: 2 weeks
MFC to: stable/14, stable/15
Sponsored by: FreeBSD Foundation, Reliable Computer Systems Lab

Tested on: FreeBSD 15.1 ppc64

@kev009 kev009 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The majority of this looks fine but the rd64_osdep change is a hard blocker.

Comment thread sys/dev/ixl/i40e_osdep.h Outdated
@mchoo7 mchoo7 changed the title ixl: fix endianness issues ixl: fix big-endian hardware interface handling Sep 5, 2026
@mchoo7

mchoo7 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

I'll ping you when I'm done with testing although it should be okay since the only change is reverting the one mentioned above.

Correct the byte order at the driver interfaces that do not operate in
host order. Encode little-endian Admin Queue VSI and MAC/VLAN fields,
and decode firmware-provided queue handles, statistics indices, and
event parameters before using them.

Decode transmit descriptor writeback before examining it, and construct
VLAN descriptor fields in host order for the final descriptor
conversion. Store paged HMC descriptors in little-endian form and retain
the selected field bits when reading HMC contexts.

Keep MMIO values in host order for bus-space accessors and remove the
obsolete le16_to_cpu no-op macro. In particular, retain the atomic
bus_space_read_8() used for 64-bit registers.

On big-endian systems, the unconverted perfect-match filter flag is
presented to firmware as 0x0100 instead of 0x0001. Firmware rejects that
command with EINVAL, leaving receive traffic functional only in
promiscuous mode.

MFC after:	2 weeks
MFC to:	stable/14, stable/15
Sponsored by:	FreeBSD Foundation, Reliable Computer Systems Lab
@kev009
kev009 self-requested a review September 5, 2026 00:38

@kev009 kev009 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine now

ctxt.info.mapping_flags |= I40E_AQ_VSI_QUE_MAP_CONTIG;
ctxt.info.valid_sections =
htole16(I40E_AQ_VSI_PROP_QUEUE_MAP_VALID);
ctxt.info.mapping_flags = htole16(I40E_AQ_VSI_QUE_MAP_CONTIG);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This = is a behavior change but I think it is technically correct and an improvement.

@mchoo7

mchoo7 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Works on ppc64. Added Reliable Computer Systems Lab to Sponsored by: for providing ppc64 machine for building and testing.

ping @bsdjhb for mentor approval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants