netmap : about update single ring

From: <root_at_9du.org>
Date: Thu, 31 May 2012 22:11:03 +0800
i want to update single ring use the ringid

like code:
struct netmap_ring *ring = NETMAP_TXRING(me->nifp, ringid);
i can't find a way to do this.
so i try to change the netmap core.

add code sys/net/netmap.h
    struct node {
	    int		ringid;
	    int		update;
    };
#define NIOCTXNODE	_IOWR('i', 150, struct node)

add code in sys/dev/netmap/netmap.c
	case NIOCTXNODE:
		if (priv == NULL) {
			error = ENXIO;
			break;
		}
		ifp = priv->np_ifp;
		na = NA(ifp);
		node->ringid += priv->np_qfirst;
		na->nm_txsync(ifp, node->ringid, 1 /* do lock */);
		break;
in my case.
    struct node node;
    node.ringid = s;
    node.update = 0;
    ioctl(me->fd, NIOCTXNODE, &node);

but her can't work. 
have some error in somewhere, i can't found it.
can your help me ? luigi.
Received on Thu May 31 2012 - 12:11:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:27 UTC