Bug 231797 - [hyper-v] hn driver drops UDP traffic with EIO error when TXCSUM_IPV6 flag on
Summary: [hyper-v] hn driver drops UDP traffic with EIO error when TXCSUM_IPV6 flag on
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-virtualization (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-29 07:36 UTC by matt_
Modified: 2019-01-21 22:15 UTC (History)
6 users (show)

See Also:


Attachments
Patch to not discard UDPv6 (475 bytes, patch)
2018-10-05 08:30 UTC, Kevin
no flags Details | Diff
Updated patch to not discard UDPv6 (357 bytes, patch)
2018-10-18 22:00 UTC, Kevin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description matt_ 2018-09-29 07:36:14 UTC
In https://reviews.freebsd.org/D12417, if_hn.c is changed at lines 5590 and 5886, which should allow UDPv6 packets to enter hn_set_hlen at line 780.  However, at line 813, traffic not matching TCPv6 (UDPv6) would error.  Thusly, it seems when IPv6 transmit checksum offloading is on, UDPv6 traffic is dropped in the hn driver.

I first noticed this in practice with dhcp6c, where the first UDPv6 solicit would fail with the error,

transmit failed: Input/output error

due to the kernel returning EIO for the UDPv6 packet.  As expected, the output error count rises correspondingly, with no kernel output messages in the syslogs.

I was able to determine that disabling TXCSUM_IPV6 via,

ifconfig hn0 -txcsum6

Stops the EIO from propogating from the driver, which led me to this area in the source.
Comment 1 Kevin 2018-09-30 17:44:49 UTC
I was seeing the same "transmit failed: Input/output error" which resulted in no IPv6 connectivity for me.

I can confirm that disabling checksum offloading prevents the error and brings back my IPv6 connectivity.
Comment 2 Kevin 2018-10-05 08:30:26 UTC
Created attachment 197807 [details]
Patch to not discard UDPv6
Comment 3 Dexuan Cui 2018-10-05 19:58:41 UTC
(In reply to Kevin from comment #2)
Thanks Kevin for the patch!  At a glance, it looks good to me (sorry, I don't have a setup to test this right away).

@matt_ : can you please also test the patch?
Comment 4 Franco Fichtner 2018-10-18 07:27:01 UTC
Thanks for this patch! When will it land?

FWIW, the bitwise & should be changed to && and the inner parenthesis are not strictly needed.  :)


Cheers,
Franco
Comment 5 Kevin 2018-10-18 22:00:24 UTC
Created attachment 198333 [details]
Updated patch to not discard UDPv6

Hi Franco,

Thanks for the review. I believe the team from Microsoft is reviewing the patch right now since they emailed me about the bitwise &.

It was actually a typo which I have fixed in this patch. Functionally the & worked but switching to && should be faster since && can "short-circuit".

Kevin
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-10-22 11:24:15 UTC
A commit references this bug:

Author: whu
Date: Mon Oct 22 11:23:51 UTC 2018
New revision: 339585
URL: https://svnweb.freebsd.org/changeset/base/339585

Log:
  Do not trop UDP traffic when TXCSUM_IPV6 flag is on

  PR:		231797
  Submitted by:	whu
  Reviewed by:	dexuan
  Obtained from:	Kevin Morse
  MFC after:	3 days
  Sponsored by:	Microsoft
  Differential Revision:	https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333&action=diff

Changes:
  head/sys/dev/hyperv/netvsc/if_hn.c
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-10-29 15:12:55 UTC
A commit references this bug:

Author: whu
Date: Mon Oct 29 15:12:16 UTC 2018
New revision: 339863
URL: https://svnweb.freebsd.org/changeset/base/339863

Log:
  MFC: 339585

      r339585:
          Do not drop UDP traffic when TXCSUM_IPV6 flag is on

          PR:             231797
          Submitted by:   whu
          Reviewed by:    dexuan
          Obtained from:  Kevin Morse
          Sponsored by:   Microsoft
          Differential Revision:  https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333&action=diff

Changes:
_U  stable/11/
  stable/11/sys/dev/hyperv/netvsc/if_hn.c
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-10-31 06:24:31 UTC
A commit references this bug:

Author: whu
Date: Wed Oct 31 06:24:08 UTC 2018
New revision: 339942
URL: https://svnweb.freebsd.org/changeset/base/339942

Log:
  MFC: 339585

      r339585:
  	Do not drop UDP traffic when TXCSUM_IPV6 flag is on

  	PR:		231797
  	Submitted by:	whu
  	Reviewed by:	dexuan
  	Obtained from:	Kevin Morse
  	Sponsored by:	Microsoft

Changes:
_U  stable/10/
  stable/10/sys/dev/hyperv/netvsc/if_hn.c
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-11-01 08:08:56 UTC
A commit references this bug:

Author: whu
Date: Thu Nov  1 08:08:08 UTC 2018
New revision: 339984
URL: https://svnweb.freebsd.org/changeset/base/339984

Log:
  MFC r339585:
   Do not drop UDP traffic when TXCSUM_IPV6 flag is on.

  PR:		231797
  Submitted by:	whu
  Reviewed by:	dexuan
  Obtained from:	Kevin Morse
  Approved by:	re (rgrimes)
  Sponsored by:	Microsoft

Changes:
_U  stable/12/
  stable/12/sys/dev/hyperv/netvsc/if_hn.c
Comment 10 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 22:15:12 UTC
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved.

Thanks