From owner-freebsd-net@FreeBSD.ORG Thu May 15 16:21:31 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A2F61065672 for ; Thu, 15 May 2008 16:21:31 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 315B58FC1E for ; Thu, 15 May 2008 16:21:31 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from Macintosh-3.local (039sub223.uottawa.ca [137.122.39.151]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m4FGLT2F077986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 15 May 2008 09:21:30 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <482C6303.9000904@freebsd.org> Date: Thu, 15 May 2008 12:21:23 -0400 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: freebsd-net@freebsd.org References: <20080515152607.GA36663@roof1.dnepro.net> In-Reply-To: <20080515152607.GA36663@roof1.dnepro.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Subject: Re: How to inject fullsize 802.1q-tagged frame through BPF? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2008 16:21:31 -0000 Eugene Perevyazko wrote: > Hello, > I have an ethernet interface with several vlans on it (FreeBSD 6.2-RELEASE #0). > My program opens BPF on the parent device, receives tagged frames and responds > by writing tagged frame to the BPF fd. > It all works good, until size of response frame w/o tag becomes larger than > 1496 bytes (1500 with tag inserted) - mtu of parent device.i > I'm a bit confused as mtu is 1500 on both vlanN and it's parent fxp0. > I've tried to "ifconfig fxp0 mtu 1504" to make room for vlan tag, but > the response is > ifconfig: ioctl (set mtu): Invalid argument > > Trying "ifconfig fxp0 -vlanmtu" also makes no difference. > > Is there a way to inject full-mtu vlan-tagged frame through BPF on parent > device? > I'd like not to open several tenths of BPFs for each vlanN if it's possible. > > I've tried on bge also with same results, so that is not connected with fxp > driver. bpf write code in the kernel calculates header size when packets are injected. This is likely based on the frames being stock 802.3 so would require mods to the bpf code to handle the additional space for the tag. Sam