libnet: queue creation small fix
authorRoni Häcki <roni.haecki@inf.ethz.ch>
Tue, 15 Aug 2017 15:21:05 +0000 (17:21 +0200)
committerRoni Häcki <roni.haecki@inf.ethz.ch>
Tue, 15 Aug 2017 15:21:05 +0000 (17:21 +0200)
Polling flag was not correctly set

Signed-off-by: Roni Häcki <roni.haecki@inf.ethz.ch>

lib/net/net.c
lib/net/net_queue.c

index 345f9e9..5237c93 100644 (file)
@@ -111,8 +111,10 @@ errval_t networking_create_queue(const char *cardname, uint64_t* queueid,
                                  struct devq **retqueue)
 {
     struct net_state *st = get_default_net_state();
-    return net_queue_internal_create(int_handler, cardname, queueid, st->flags & NET_FLAGS_DEFAULT_QUEUE,
-                                     st->flags & NET_FLAGS_POLLING, retqueue); 
+    bool poll = st->flags & NET_FLAGS_POLLING;
+    bool default_q = st->flags & NET_FLAGS_DEFAULT_QUEUE;
+    return net_queue_internal_create(int_handler, cardname, queueid, default_q,
+                                     poll, retqueue); 
 }
 
 
index 34d22f5..fe794cd 100644 (file)
@@ -56,9 +56,12 @@ static errval_t create_e10k_queue(const char* cardname, inthandler_t interrupt,
                                   bool default_q, bool poll, struct devq **retqueue)
 {
     errval_t err;
+
+    printf("Default Q %d Interrupt %d \n", default_q, !poll);
+
     err = e10k_queue_create((struct e10k_queue**)retqueue, interrupt,
                             false /*virtual functions*/,
-                            poll, /* user interrupts*/
+                            !poll, /* user interrupts*/
                             default_q);
     *queueid = e10k_queue_get_id((struct e10k_queue*)*retqueue);
     assert(retqueue != NULL);
@@ -71,7 +74,7 @@ static errval_t create_sfn5122f_queue(const char* cardname, inthandler_t interru
     errval_t err;
     err = sfn5122f_queue_create((struct sfn5122f_queue**)retqueue, interrupt,
                                 false /*userlevel network feature*/,
-                                poll /* user interrupts*/,
+                                !poll /* user interrupts*/,
                                 default_q);
     *queueid = sfn5122f_queue_get_id((struct sfn5122f_queue*)*retqueue);
     return err;