NetBSD Problem Report #51132

From www@NetBSD.org  Thu May 12 13:05:38 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6844F7A46B
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 12 May 2016 13:05:38 +0000 (UTC)
Message-Id: <20160512130537.35EB47AA95@mollari.NetBSD.org>
Date: Thu, 12 May 2016 13:05:37 +0000 (UTC)
From: baremetal.bear@gmail.com
Reply-To: baremetal.bear@gmail.com
To: gnats-bugs@NetBSD.org
Subject: virtio net device stuck for UDP burst transmission
X-Send-Pr-Version: www-1.0

>Number:         51132
>Category:       kern
>Synopsis:       virtio net device stuck for UDP burst transmission
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 12 13:10:00 +0000 2016
>Closed-Date:    Thu May 25 05:45:57 +0000 2017
>Last-Modified:  Thu May 25 05:45:57 +0000 2017
>Originator:     Kenichi Yasukata
>Release:        NetBSD 7.99.29
>Organization:
>Environment:
NetBSD 7.99.29

HOST Machine: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz

GUEST < NetBSD >

% uname -a
NetBSD  7.99.29 NetBSD 7.99.29 (MYKERNEL) #6: Tue May 10 10:14:30 JST
2016  root@:/usr/src/sys/arch/amd64/compile/MYKERNEL amd64

** MYKERNEL is just a copy of GENERIC

HOST < Ubuntu >
% uname -a
Linux N-1183 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC
2016 x86_64 x86_64 x86_64 GNU/Linux

VMM < QEMU/KVM >
QEMU version v2.6.0-rc0

( Command )
qemu-system-x86_64
    -enable-kvm \
    -curses \
    -m 4096 \
    -drive file=./nbsdvd.img \
    -net nic,model=virtio -net
tap,ifname=tap0,script=qemu-ifup,downscript=qemu-ifdown

% cat qemu-ifup
#!/bin/bash
echo "Bringing up $1 for bridged mode..."
ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to virbr0..."
brctl addif virbr0 $1
exit 0

% cat qemu-ifdown
#!/bin/bash
echo "Removing $1 to virbr0..."
brctl delif virbr0 $1
echo "Shutting down $1..."
ifconfig $1 down
exit 0
>Description:
When I try UDP burst transmission with vioif driver on KVM,
all network connections stuck.

If I change the driver model to e1000 at QEMU setting, this issue doesn't appear.

( I have posted this issue at tech-net mailing list http://mail-index.netbsd.org/tech-net/2016/05/11/msg005855.html )
>How-To-Repeat:
Burst UDP transmission with vioif driver on KVM.

Example program is here ( https://gist.github.com/jmmlmendes/aaea56a8b7044487595ef7a6782fc018 ).
>Fix:

>Release-Note:

>Audit-Trail:
From: "Valeriy E. Ushakov" <uwe@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51132 CVS commit: src/sys/dev/pci
Date: Tue, 29 Nov 2016 21:54:11 +0000

 Module Name:	src
 Committed By:	uwe
 Date:		Tue Nov 29 21:54:11 UTC 2016

 Modified Files:
 	src/sys/dev/pci: if_vioif.c

 Log Message:
 vioif_start() - do not call virtio_enqueue_abort() after error from
 virtio_enqueue_reserve(), as it's already done by the latter, so we
 ended up with a kind of "double free" that messed up out free list of
 vq_entry's.

 This is even documented in a "typical usage" comment in virtio.c (and
 those quotes are not intended to be sarcastic).

 PR 51132 - virtio net device stuck for UDP burst transmission


 To generate a diff of this commit:
 cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/if_vioif.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: uwe@NetBSD.org
State-Changed-When: Tue, 29 Nov 2016 22:30:28 +0000
State-Changed-Why:
Fix committed.  Since the bug is not on any branches, no pullups necessary.


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Thu, 25 May 2017 05:45:57 +0000
State-Changed-Why:
no feedback is good feedback


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.