Date: Fri, 23 Aug 2013 22:57:03 -0400 From: Harika Tandra <htandra@gloriad.org> To: Luigi Rizzo <rizzo@iet.unipi.it> Cc: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Subject: Re: Netmap ixgbe stripping Vlan tags Message-ID: <15C5C18A-9EA9-41CE-9547-C630E15CB247@gloriad.org> In-Reply-To: <CA%2BhQ2%2BhVOhoQQFG5MOYa%2B0kSEet7qk1FRmqqiWU%2B7t22CtKa7A@mail.gmail.com> References: <FC9BCAD9-5D16-4E70-A9C5-FA9D9A22B84C@gloriad.org> <CA%2BhQ2%2BhVOhoQQFG5MOYa%2B0kSEet7qk1FRmqqiWU%2B7t22CtKa7A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <rizzo@iet.unipi.it> 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 <htandra@gloriad.org> = 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) > = -----------------------------------------+-------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15C5C18A-9EA9-41CE-9547-C630E15CB247>