[Click] click netmap(20120813) patch

sandeep sandeep048 at gmail.com
Wed Oct 17 10:55:39 EDT 2012


Hi,

netmap_if structure is changed in netmap v3 (20120813). I am attaching a
patch to fix netmap's integration. This assumes that updated netmap.h and
netmap_user.h files are copied to /usr/include/net directory.

----------------------------------

--- /home/pathivas/click/elements/userlevel/netmapinfo.cc       2012-06-25
13:09:29.375014693 +0100
+++ ../elements/userlevel/netmapinfo.cc 2012-10-17 17:18:11.216540166 +0100
@@ -16,8 +16,6 @@
  * legally binding.
  */

-#include <iostream>
-
 #include <click/config.h>
 #include <click/glue.hh>
 #include "netmapinfo.hh"
@@ -94,7 +91,7 @@ NetmapInfo::ring::initialize_rings_rx(in
 {
     ring_begin = 0;
     // 0 means "same count as the converse direction"
-    ring_end = nifp->ni_rx_queues ? nifp->ni_rx_queues :
nifp->ni_tx_queues;
+    ring_end = nifp->ni_rx_rings ? nifp->ni_rx_rings : nifp->ni_tx_rings;
     if (timestamp >= 0) {
        int flags = (timestamp > 0 ? NR_TIMESTAMP : 0);
        for (unsigned i = ring_begin; i != ring_end; ++i)
@@ -106,7 +103,7 @@ void
 NetmapInfo::ring::initialize_rings_tx()
 {
     ring_begin = 0;
-    ring_end = nifp->ni_tx_queues ? nifp->ni_tx_queues :
nifp->ni_rx_queues;
+    ring_end = nifp->ni_tx_rings ? nifp->ni_tx_rings : nifp->ni_rx_rings;
 }

----------------------------------

Kind Regards,
Sandeep,
PhD Student,
CTVR <http://ctvr.ie/> - Trinity College Dublin


More information about the click mailing list