- pstrcpy(req.nr_name, sizeof(req.nr_name), me->ifname);
- req.nr_ringid = NETMAP_NO_TX_POLL;
- req.nr_version = NETMAP_API;
- err = ioctl(fd, NIOCREGIF, &req);
- if (err) {
- error_report("Unable to register %s: %s", me->ifname, strerror(errno));
- goto error;
- }
- l = me->memsize = req.nr_memsize;
-
- me->mem = mmap(0, l, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0);
- if (me->mem == MAP_FAILED) {
- error_report("Unable to mmap netmap shared memory: %s",
- strerror(errno));
- me->mem = NULL;
- goto error;
- }