From owner-freebsd-net@FreeBSD.ORG Sat Aug 24 02:57:12 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 29D2B9FC for ; Sat, 24 Aug 2013 02:57:12 +0000 (UTC) (envelope-from htandra@gloriad.org) Received: from mail.gloriad.org (mail.gloriad.org [160.36.208.244]) by mx1.freebsd.org (Postfix) with ESMTP id DA9DC24BF for ; Sat, 24 Aug 2013 02:57:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.gloriad.org (Postfix) with ESMTP id EE72217919F7; Fri, 23 Aug 2013 22:57:04 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.gloriad.org Received: from mail.gloriad.org ([127.0.0.1]) by localhost (mail.gloriad.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iJR4yMMQl2wD; Fri, 23 Aug 2013 22:57:04 -0400 (EDT) Received: from [192.168.0.100] (user-24-236-68-12.knology.net [24.236.68.12]) by mail.gloriad.org (Postfix) with ESMTPSA id 6655F17919E6; Fri, 23 Aug 2013 22:57:04 -0400 (EDT) Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: Netmap ixgbe stripping Vlan tags From: Harika Tandra In-Reply-To: Date: Fri, 23 Aug 2013 22:57:03 -0400 Message-Id: <15C5C18A-9EA9-41CE-9547-C630E15CB247@gloriad.org> References: To: Luigi Rizzo X-Mailer: Apple Mail (2.1503) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Aug 2013 02:57:12 -0000 Hi Luigi, Thank you so much for the reply. It makes it clear that Netmap=20 doesn't change vlanhwfilter option or any other option set on the card. It is very good news for my application !! Currently I have the "vlanhwfilter" option disabled on the NIC. But not = seeing=20 the vlan tags when opened in netmap mode. This is from my /etc/rc.conf = file : ifconfig_ix0=3D"inet 192.168.10.10 netmask 255.255.255.0 -vlanhwfilter "=20= Perhaps I am making a mistake when opening the device in netmap mode. Do I need to set the flags separately via ioctl call when opening = interface in netmap=20 mode ? I would appreciate any pointers on this.=20 I am following the pkt-gen example and this is the code I am using to = open=20 the interface : int fd =3D open("/dev/netmap", O_RDWR); if( fd =3D=3D -1) { ArgusLog(LOG_ERR,"Error : Cannot open netmap device"); =20 } else { struct nmreq tnmr; void *mmap_addr; struct netmap_if *tnifp; struct NetMapArgs *targs =3D NULL; bzero(&tnmr, sizeof(tnmr)); tnmr.nr_version =3D NETMAP_API; strncpy(tnmr.nr_name, device->name, sizeof(tnmr.nr_name)); if ((ioctl(fd, NIOCGINFO, &tnmr)) =3D=3D -1) { ArgusDebug(4,"Unable to get if info for %s", = device->name); }else{ mmap_addr =3D (struct netmap_d *) mmap(0, = tnmr.nr_memsize, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0); if (mmap_addr !=3D MAP_FAILED) { if (ioctl(fd, NIOCREGIF, &tnmr) =3D=3D -1) { ArgusDebug(4,"Unable to register = interface %s", tnmr.nr_name); } else { tnifp =3D NETMAP_IF(mmap_addr, tnmr.nr_offset); targs =3D (struct NetMapArgs *)ArgusCalloc(1, = sizeof(*targs)); targs->nmr =3D tnmr; targs->fd =3D fd; targs->nifp =3D tnifp; inf->nmargs =3D targs; } } Thanks, Harika. On Aug 23, 2013, at 9:11 PM, Luigi Rizzo wrote: > responding to the first email in the thread: >=20 > netmap by design does not modify the setting of the card > (vlan, hwcsum, tso/lro, promisc, ...). >=20 > The main practical reasons behind this choice are that > i) in many cases both settings make sense when in netmap mode, > ii) we can use existing OS tools/ioctl to modify the settings > without having to replicate them within the netmap code. >=20 > vlan tag insertion/removal is probably the one feature which > should be always disabled in netmap mode. For others, the case > is not so clear. >=20 > As an example, having tso and hwcsum enabled is useful > to postpone those expensive ops to the very last moment; > the upcoming version of netmap supports scatter-gather I/O, > and when used to interconnect virtual machines through > the VALE switch you don't even need to do the segmentation > or checksumming. >=20 > cheers > luigi >=20 >=20 >=20 > On Fri, Aug 23, 2013 at 12:36 AM, Harika Tandra = wrote: > Hi all, >=20 > I am running Netmap with "intel 10G 82598EB" card in promiscuous mode. > While capturing packets via Netmap the driver is stripping off Vlan = tags. > I tested my setup, I am able to see Vlan tags when the same card is in = promiscuous > mode without Netmap. >=20 > This maybe due to the netmap related changes to the device driver = code. > But I don't know much about drivers. I would appreciate any help or = pointer > regarding this. >=20 > Thanks, > Htandra. >=20 >=20 >=20 >=20 > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >=20 >=20 >=20 > --=20 > = -----------------------------------------+------------------------------- > Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. = dell'Informazione > http://www.iet.unipi.it/~luigi/ . Universita` di Pisa > TEL +39-050-2211611 . via Diotisalvi 2 > Mobile +39-338-6809875 . 56122 PISA (Italy) > = -----------------------------------------+-------------------------------