NetBSD Problem Report #54297

From sc.dying@gmail.com  Sun Jun 16 08:23:46 2019
Return-Path: <sc.dying@gmail.com>
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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A1C147A16F
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 16 Jun 2019 08:23:46 +0000 (UTC)
Message-Id: <a3212a08-efbd-79c6-65ed-c987bad2f3dd@gmail.com>
Date: Sun, 16 Jun 2019 08:23:40 +0000
From: sc.dying@gmail.com
Reply-To:
To: gnats-bugs@NetBSD.org
Subject: opacket of ure(4) is always 0

>Number:         54297
>Category:       kern
>Synopsis:       opacket of ure(4) is always 0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 16 08:25:00 +0000 2019
>Closed-Date:    Tue Aug 06 18:50:05 +0000 2019
>Last-Modified:  Tue Aug 06 18:50:05 +0000 2019
>Originator:     sc.dying@gmail.com
>Release:        NetBSD/earmv7hf 8.99.42
>Organization:
>Environment:
System: NetBSD  8.99.42 NetBSD 8.99.42 (GENERIC) #0: Fri May 31 16:38:27 UTC 2019  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC evbarm earmv7hf
Architecture: earmv7hf
Machine: evbarm
>Description:
	Opkts field of netstat -i for ure(4) is always 0.
	Ipkts increases when it receives.
>How-To-Repeat:
	connect and configure ure and send some packets.
>Fix:
	ure_txeof should increment ifp->if_opackets.


--- sys/dev/usb/if_ure.c	Jun 13 2019 23:38:35 -0000
+++ sys/dev/usb/if_ure.c	Jun 14 2019 00:46:40 -0000
@@ -1516,6 +1516,7 @@ ure_txeof(struct usbd_xfer *xfer, void *
 		return;
 	}

+	ifp->if_opackets++;
 	ifp->if_flags &= ~IFF_OACTIVE;

 	if (IFQ_IS_EMPTY(&ifp->if_snd) == 0)

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54297 CVS commit: src/sys/dev/usb
Date: Sun, 16 Jun 2019 10:47:50 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Sun Jun 16 14:47:49 UTC 2019

 Modified Files:
 	src/sys/dev/usb: if_ure.c

 Log Message:
 PR/54297: sc dying: opacket of ure(4) is always 0


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_ure.c

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

From: sc.dying@gmail.com
To: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: PR/54297 CVS commit: src/sys/dev/usb
Date: Sun, 16 Jun 2019 20:54:53 +0000

 On 2019/06/16 14:50, Christos Zoulas wrote:
 > The following reply was made to PR kern/54297; it has been noted by GNATS.
 > 
 > From: "Christos Zoulas" <christos@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc: 
 > Subject: PR/54297 CVS commit: src/sys/dev/usb
 > Date: Sun, 16 Jun 2019 10:47:50 -0400
 > 
 >  Module Name:	src
 >  Committed By:	christos
 >  Date:		Sun Jun 16 14:47:49 UTC 2019
 >  
 >  Modified Files:
 >  	src/sys/dev/usb: if_ure.c
 >  
 >  Log Message:
 >  PR/54297: sc dying: opacket of ure(4) is always 0

 --- src/sys/dev/usb/if_ure.c	9 Jun 2019 13:35:47 -0000	1.8
 +++ src/sys/dev/usb/if_ure.c	16 Jun 2019 14:47:49 -0000	1.9
 @@ -1518,8 +1518,10 @@ ure_txeof(struct usbd_xfer *xfer, void *

  	ifp->if_flags &= ~IFF_OACTIVE;

 -	if (IFQ_IS_EMPTY(&ifp->if_snd) == 0)
 +	if (!IFQ_IS_EMPTY(&ifp->if_snd)) {
 +		ifp->if_opackets++;
  		ure_start(ifp);
 +	}

  	splx(s);
  }

 Doesn't opacket increament if the kernel sends one packet?
 The packet that is being sent must be IFQ_DEQUEUE'd in
 ure_start _before_ ure_txeof is called back.

From: Christos Zoulas <christos@zoulas.com>
To: sc.dying@gmail.com
Cc: gnats-bugs@netbsd.org,
 kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: PR/54297 CVS commit: src/sys/dev/usb
Date: Sun, 16 Jun 2019 17:04:30 -0400

 Yes, you are right, I fixed it.

 christos


State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 06 Aug 2019 16:21:48 +0000
State-Changed-Why:
Are there still issues? (in the meantime, mrg has introduced usbnet and converted ure(4)...)


State-Changed-From-To: feedback->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Tue, 06 Aug 2019 18:50:05 +0000
State-Changed-Why:
works now for me.  thanks for the report.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.