NetBSD Problem Report #49967

From www@NetBSD.org  Thu Jun 11 23:48:53 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(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 F25F2A5674
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 11 Jun 2015 23:48:52 +0000 (UTC)
Message-Id: <20150611234851.A6148A65B7@mollari.NetBSD.org>
Date: Thu, 11 Jun 2015 23:48:51 +0000 (UTC)
From: tnn@NetBSD.org
Reply-To: tnn@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: awge(4) should declare VLAN capability
X-Send-Pr-Version: www-1.0

>Number:         49967
>Category:       port-evbarm
>Synopsis:       awge(4) should declare VLAN capability
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-evbarm-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 11 23:50:00 +0000 2015
>Closed-Date:    Fri Jun 12 11:57:25 +0000 2015
>Last-Modified:  Fri Jun 12 11:57:25 +0000 2015
>Originator:     Tobias Nygren
>Release:        7.99.18
>Organization:
>Environment:
Banana Pi M1
>Description:
vlan(4) on Allwinner SoCs does not work because the interface is not marked as VLAN MTU capable.
>How-To-Repeat:
Attempted to configure vlan(4) on a Banana Pi, resulted in vlan interfaces with mtu 1496 instead of 1500 and errors:
vlan1: discarding oversize frame (len=1514)

>Fix:
It seems to work fine to just add ETHERCAP_VLAN_MTU. Probably the hardware can do ETHERCAP_VLAN_HWTAGGING as well but that can be added later.

Index: dwc_gmac.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/dwc_gmac.c,v
retrieving revision 1.32
diff -u -r1.32 dwc_gmac.c
--- dwc_gmac.c	23 Feb 2015 19:05:17 -0000	1.32
+++ dwc_gmac.c	11 Jun 2015 23:43:38 -0000
@@ -238,6 +238,11 @@
         }

 	/*
+	 * We can support 802.1Q VLAN-sized frames.
+	 */
+	sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_MTU;
+
+	/*
 	 * Ready, attach interface
 	 */
 	if_attach(ifp);

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/49967: awge(4) should declare VLAN capability
Date: Fri, 12 Jun 2015 08:27:52 +0200

 > It seems to work fine to just add ETHERCAP_VLAN_MTU. Probably the hardware
 > can do ETHERCAP_VLAN_HWTAGGING as well but that can be added later.

 Yes - I plan to enhance the driver more as soon as I find some time,
 it also needs support for checksum offloading.

 The patch looks good, please commit.

 Martin

From: "Tobias Nygren" <tnn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49967 CVS commit: src/sys/dev/ic
Date: Fri, 12 Jun 2015 11:54:39 +0000

 Module Name:	src
 Committed By:	tnn
 Date:		Fri Jun 12 11:54:39 UTC 2015

 Modified Files:
 	src/sys/dev/ic: dwc_gmac.c

 Log Message:
 Supports ETHERCAP_VLAN_MTU. ok martin@ PR#49967


 To generate a diff of this commit:
 cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ic/dwc_gmac.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->closed
State-Changed-By: tnn@NetBSD.org
State-Changed-When: Fri, 12 Jun 2015 11:57:25 +0000
State-Changed-Why:
Works now.


>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.