Page MenuHomeFreeBSD

Fix rxcsum issue introduced in r338838
ClosedPublic

Authored by shurd on Nov 7 2018, 5:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 4:27 PM
Unknown Object (File)
Wed, Apr 17, 4:18 PM
Unknown Object (File)
Fri, Mar 29, 9:58 AM
Unknown Object (File)
Feb 20 2024, 9:27 AM
Unknown Object (File)
Feb 19 2024, 10:07 PM
Unknown Object (File)
Jan 28 2024, 2:09 PM
Unknown Object (File)
Jan 26 2024, 8:06 AM
Unknown Object (File)
Jan 24 2024, 4:15 AM

Details

Summary

r338838 attempted to fix issues with rxcsum and rxcsum6.
However, the rxcsum bits were set as though if_setcapenablebit() was
being called, not if_togglecapenable() which is in use. As a result,
it was not possible to disable rxcsum when rxcsum6 was supported.

See PR233004

Test Plan

Texted with my ix and em NICs. Have lev confirm the fix

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20673
Build 20088: arc lint + arc unit

Event Timeline

It fix ix0 for me.

I concern about one thing (theoretical for me, though): iflib is (and will be) used not only by Intel's chips. Is this code right for all consumers of iflib?

This revision is now accepted and ready to land.Nov 7 2018, 10:24 AM
In D17881#382102, @lev wrote:

It fix ix0 for me.

Great... I'll commit it then.

I concern about one thing (theoretical for me, though): iflib is (and will be) used not only by Intel's chips. Is this code right for all consumers of iflib?

Yes, while NICs won't be able to separately support RX checksum offload for IPv4 and IPv6, this seems to be true for almost all cards. In the future, we may add a capability flag to control this, but it's not needed yet.

This revision was automatically updated to reflect the committed changes.

@shurd - Turns out you've been faster. We've been working one this bug too. Our plan was to do it this way:

			if ((setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) !=
			    (oldmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)))
				setmask |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6;

But it's too late for me today to figure out which has more sense ;)

@shurd - Turns out you've been faster. We've been working one this bug too. Our plan was to do it this way:

			if ((setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) !=
			    (oldmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)))
				setmask |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6;

But it's too late for me today to figure out which has more sense ;)

I think the patch here in this review makes more obvious sense to me based on the problem description.

head/sys/net/iflib.c
4260 ↗(On Diff #50134)

This removes the comment about the assumption that they are all enabled.

Can we add back a comment something like "This assumes that the supported flags are always set to the same state"?

I guess maybe it's not a big deal since we control the toggle code, and thus they should never get in this inconsistent state...

@krzysztof.galazka_intel.com I think @shurd's version here is better in that it masks isc_capabilities before togging RXCSUM/RXCSUM_IPV6. Though I think if you had added that, they might be roughly similar.