netmap: Does netmap support linux kernel 2.6.32 ?

ChenXiaodong ch.xd at live.cn
Wed Apr 29 09:52:00 UTC 2015


Hi, 

I cannot receive packets using netmap complied for linux kernel 2.6.32.xxx. I tried on CentOS 6.5, Redhat and Debian, both of which are based on linux kernel 2.6.32.xxx. None of them works. Is Linux 2.6.32 too old to netmap ?


This is the test code I used . It is copied from netmap's man page. The program stops at the call to 'poll' and never return.

int main(int argc, char **argv)
{
    (void) argc;
    (void) argv;

    struct nm_desc *d;
    struct pollfd fds;
    u_char *buf;
    struct nm_pkthdr h;
    d = nm_open("netmap:eth0", NULL, 0, 0);
    fds.fd = NETMAP_FD(d);
    fds.events = POLLIN;
    for (;;) {
        poll(&fds, 1, -1);
        while ( (buf = nm_nextpkt(d, &h)) ) {
            printf("packet %d\n", h.len);
            printf("  dmac: %02x:%02x:%02x:%02x:%02x:%02x",
                    buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
            buf += 6;
            printf(" <- smac: %02x:%02x:%02x:%02x:%02x:%02x\n",
                    buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
        }
    }
    nm_close(d);
    return 0;
}

Thanks! I do appreciate your reply!

/ChenXiaodong
 		 	   		  


More information about the freebsd-net mailing list