From owner-freebsd-net@FreeBSD.ORG Fri Apr 27 07:04:11 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C06C106564A; Fri, 27 Apr 2012 07:04:11 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id E6F2A8FC12; Fri, 27 Apr 2012 07:04:10 +0000 (UTC) Received: by pbcwz17 with SMTP id wz17so654122pbc.13 for ; Fri, 27 Apr 2012 00:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=uCZGYWRFqeEk91najYOwbP8KtmQeuW3DCbZQ2TJXjUw=; b=WFpxIYSiCUM2oIz+TgsGMLaAJtOe1idrA+nCngObL4QYRSj1zVD2aDqgjf5gownPbp BIpAalxl+Jv9nSCfiWsMwUjfYMr8eaU6nOMSKmSI8GEBQN6YVFtWBaaqwG66nUQB2rQH epsZqbjCGhHAhhriJx6fuEQMqJ8XQ48ypO/KzM8blVCaVybt6s3UswFI3FsojtcFEQtL VwIGCsmjx73qFcdIobtkaJXN3zQfoKFQEEHgWJj1GDl44HawJfuIb0aq2hSxBD34WWk0 008DwHOPgQ214CBCIUo+DMCWK6iiUllJiizcQ4qV5ni9KwQG5fXfvYEARtXSE0bQ8xEn 4oZg== Received: by 10.68.195.164 with SMTP id if4mr7151554pbc.87.1335510250784; Fri, 27 Apr 2012 00:04:10 -0700 (PDT) Received: from pyunyh@gmail.com ([114.111.62.249]) by mx.google.com with ESMTPS id q1sm5615093pbp.62.2012.04.27.00.04.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Apr 2012 00:04:09 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 27 Apr 2012 16:04:00 -0700 From: YongHyeon PYUN Date: Fri, 27 Apr 2012 16:04:00 -0700 To: Andrey Zonov Message-ID: <20120427230400.GB17009@michelle.cdnetworks.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="9zSXsLTf0vkW971A" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org, davidch@freebsd.org Subject: Re: bce: jumbo not working since r218423 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2012 07:04:11 -0000 --9zSXsLTf0vkW971A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 26, 2012 at 03:23:19PM +0400, Andrey Zonov wrote: > Hi, > > I found that jumbo frames don't work after r218423 with bce driver. > This happens because controller doesn't do reinitialization when MTU > is changed. Attached patch solves this problem. > Could you verify whether attached diff addresses the issue? Sorry, I couldn't setup my box yet due to some other reasons so the diff was not tested. > I also don't understand why sysctl hw.bce.loose_rx_mtu doesn't respect > with tunnable hw.bce.strict_rx_mtu. Is there any reason to give them > different names? > It may be an oversight. Personally I don't see any reason except debugging purpose to limit RX frame size to interface MTU. It makes sense when controller send frames but it should be able to receive any sized RX frames(if controller allows it). Dropping RX frames that are bigger than interface MTU would break path MTU discovery of remote host that uses bigger MTU. --9zSXsLTf0vkW971A Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="bce.mtu.diff" Index: sys/dev/bce/if_bce.c =================================================================== --- sys/dev/bce/if_bce.c (revision 234725) +++ sys/dev/bce/if_bce.c (working copy) @@ -6842,6 +6842,8 @@ bcopy(IF_LLADDR(sc->bce_ifp), sc->eaddr, ETHER_ADDR_LEN); bce_set_mac_addr(sc); + if (bce_hdr_split == FALSE) + bce_get_rx_buffer_sizes(sc, ifp->if_mtu); /* * Calculate and program the hardware Ethernet MTU * size. Be generous on the receive if we have room @@ -7436,22 +7438,10 @@ BCE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - - if (bce_hdr_split == FALSE) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - /* - * Because allocation size is used in RX - * buffer allocation, stop controller if - * it is already running. - */ - bce_stop(sc); - } - - bce_get_rx_buffer_sizes(sc, ifp->if_mtu); - + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bce_init_locked(sc); } - BCE_UNLOCK(sc); break; --9zSXsLTf0vkW971A--