Bug 233022 - [em][netmap] 12-BETA2 can not finish netmap transmission
Summary: [em][netmap] 12-BETA2 can not finish netmap transmission
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Stephen Hurd
URL:
Keywords: IntelNetworking, regression
Depends on:
Blocks:
 
Reported: 2018-11-06 12:12 UTC by Lev A. Serebryakov
Modified: 2018-11-30 03:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lev A. Serebryakov freebsd_committer 2018-11-06 12:12:19 UTC
netmap's pkt-gen can not finish transmission of configured number of packaets on I219-V (em0) at 12-BETA2. It stucks with non-flushed queue forever:

236.545902 main_thread [2605] 0 pps (0 pkts 0 bps in 1031501 usec) 0.00 avg_batch 99999 min_space
237.000000 sender_body [1687] pending tx tail 446 head 448 on ring 0
237.000007 sender_body [1687] pending tx tail 446 head 448 on ring 0
237.000011 sender_body [1687] pending tx tail 446 head 448 on ring 0
237.000016 sender_body [1687] pending tx tail 446 head 448 on ring 0
237.000020 sender_body [1687] pending tx tail 446 head 448 on ring 0
237.607508 main_thread [2605] 0 pps (0 pkts 0 bps in 1061606 usec) 0.00 avg_batch 99999 min_space
238.000000 sender_body [1687] pending tx tail 446 head 448 on ring 0
238.000005 sender_body [1687] pending tx tail 446 head 448 on ring 0
238.000009 sender_body [1687] pending tx tail 446 head 448 on ring 0
238.000013 sender_body [1687] pending tx tail 446 head 448 on ring 0
238.000017 sender_body [1687] pending tx tail 446 head 448 on ring 0
Comment 1 Lev A. Serebryakov freebsd_committer 2018-11-06 20:37:28 UTC
Exactly same hardware doesn't have this problem with 11.2-RELEASE.
So, it is regression.
Comment 2 Stephen Hurd freebsd_committer 2018-11-08 18:00:47 UTC
I'll take this.
Comment 3 Stephen Hurd freebsd_committer 2018-11-08 20:48:48 UTC
Please test the patch at https://reviews.freebsd.org/D17913

I'm not sure this will fix the issue since I expect the timer code to work even if TX interrupts are in use, but if this does fix it, it's an easy win.
Comment 4 Lev A. Serebryakov freebsd_committer 2018-11-08 22:58:13 UTC
(In reply to Stephen Hurd from comment #3)
Nope, it doesn't help at all.

BTW, difference between tail and head is always exactly 2, no matter how much packets have been transmitted (ok, I didn't tried to transmit only one packet).
Comment 5 Stephen Hurd freebsd_committer 2018-11-09 19:37:29 UTC
Please confirm that https://reviews.freebsd.org/D17931 fixes the issue for you.
Comment 6 commit-hook freebsd_committer 2018-11-09 22:19:13 UTC
A commit references this bug:

Author: shurd
Date: Fri Nov  9 22:18:43 UTC 2018
New revision: 340310
URL: https://svnweb.freebsd.org/changeset/base/340310

Log:
  Fix first-packet completion

  The first packet after the ring is initialized was never
  completed as isc_txd_credits_update() would not include it in the
  count of completed packets. This caused netmap to never complete
  a batch. See PR 233022 for more details.

  PR:		233022
  Reported by:	lev
  Reviewed by:	lev
  MFC after:	3 days
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D17931

Changes:
  head/sys/dev/e1000/em_txrx.c
  head/sys/dev/e1000/igb_txrx.c
Comment 7 commit-hook freebsd_committer 2018-11-12 16:28:26 UTC
A commit references this bug:

Author: shurd
Date: Mon Nov 12 16:28:08 UTC 2018
New revision: 340366
URL: https://svnweb.freebsd.org/changeset/base/340366

Log:
  MFC r340310:

  Fix first-packet completion

  The first packet after the ring is initialized was never
  completed as isc_txd_credits_update() would not include it in the
  count of completed packets. This caused netmap to never complete
  a batch. See PR 233022 for more details.

  PR:		233022
  Reported by:	lev
  Reviewed by:	lev
  Approved by:	re (kib)
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D17931

Changes:
_U  stable/12/
  stable/12/sys/dev/e1000/em_txrx.c
  stable/12/sys/dev/e1000/igb_txrx.c