Netmap ixgbe stripping Vlan tags

Harika Tandra htandra at gloriad.org
Sat Aug 24 02:57:12 UTC 2013


Hi Luigi,

Thank you so much for the reply. It makes it clear that Netmap 
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 
the vlan tags when opened in netmap mode. This is from my /etc/rc.conf file :

ifconfig_ix0="inet 192.168.10.10 netmask 255.255.255.0 -vlanhwfilter " 

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 
mode ? I would appreciate any pointers on this. 

I am following the pkt-gen example and this is the code I am using to open 
the interface :

int fd = open("/dev/netmap", O_RDWR);
    if( fd == -1) {
        ArgusLog(LOG_ERR,"Error : Cannot open netmap device");
 
    } else {
        struct nmreq tnmr;
        void *mmap_addr;
        struct netmap_if *tnifp;
        struct NetMapArgs *targs = NULL;
        bzero(&tnmr, sizeof(tnmr));
        tnmr.nr_version = NETMAP_API;

        strncpy(tnmr.nr_name, device->name, sizeof(tnmr.nr_name));
        if ((ioctl(fd, NIOCGINFO, &tnmr)) == -1) {
          	ArgusDebug(4,"Unable to get if info for %s", device->name);
        }else{
                 mmap_addr = (struct netmap_d *) mmap(0, tnmr.nr_memsize,
                                            PROT_WRITE | PROT_READ,
                                            MAP_SHARED, fd, 0);
                if (mmap_addr != MAP_FAILED) {
                        if (ioctl(fd, NIOCREGIF, &tnmr) == -1) {
                                ArgusDebug(4,"Unable to register interface %s", tnmr.nr_name);
                } else {
                   tnifp = NETMAP_IF(mmap_addr, tnmr.nr_offset);
                   targs = (struct NetMapArgs *)ArgusCalloc(1, sizeof(*targs));
                   targs->nmr = tnmr;
                   targs->fd = fd;
                   targs->nifp = tnifp;
                   inf->nmargs = targs;
	}
}

Thanks,
Harika.

On Aug 23, 2013, at 9:11 PM, Luigi Rizzo <rizzo at iet.unipi.it> wrote:

> responding to the first email in the thread:
> 
> netmap by design does not modify the setting of the card
> (vlan, hwcsum, tso/lro, promisc, ...).
> 
> 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.
> 
> 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.
> 
> 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.
> 
> cheers
> luigi
> 
> 
> 
> On Fri, Aug 23, 2013 at 12:36 AM, Harika Tandra <htandra at gloriad.org> wrote:
> Hi all,
> 
> 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.
> 
> 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.
> 
> Thanks,
> Htandra.
> 
> 
> 
> 
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
> 
> 
> 
> -- 
> -----------------------------------------+-------------------------------
>  Prof. Luigi RIZZO, rizzo at 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)
> -----------------------------------------+-------------------------------



More information about the freebsd-net mailing list