Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2012 22:11:03 +0800
From:      "root@9du.org" <root@9du.org>
To:        freebsd-current <freebsd-current@freebsd.org>
Cc:        rizzo <rizzo@iet.unipi.it>
Subject:   netmap : about update single ring
Message-ID:  <2012053122105776538217@9du.org>
References:  <20120530120027.2CDAF1065678@hub.freebsd.org>

index | next in thread | previous in thread | raw e-mail

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.
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2012053122105776538217>