e10k: driver working using legacy descriptors
authorRoni Häcki <roni.haecki@inf.ethz.ch>
Thu, 20 Apr 2017 08:05:58 +0000 (10:05 +0200)
committerRoni Häcki <roni.haecki@inf.ethz.ch>
Thu, 20 Apr 2017 08:05:58 +0000 (10:05 +0200)
Signed-off-by: Roni Häcki <roni.haecki@inf.ethz.ch>

lib/devif/backends/net/e10k/devif_backend_e10k.c
lib/devif/backends/net/e10k/e10k_queue.h
lib/lwip-2.0.2/src/include/lwipopts.h
lib/net/net.c
usr/drivers/e10k/e10k_cdriver.c
usr/pci/pci.c

index c812861..02f9d6e 100644 (file)
 #define IPHDR_LEN 20
 #define UDPHDR_LEN 8
 
+
+// for debugging
+static e10k_t* d;
+
+/*
+static void queue_debug(const char* fmt, ...)
+{
+    va_list va;
+    va_start(va, fmt);
+    printf("e10k.queue_handle%d: ", 0);
+    vprintf(fmt, va);
+    va_end(va);
+}
+
+#define prnonz(x) uint32_t x = e10k_##x##_rd(d); if (x) snprintf(str[cnt++], 32, #x "=%x", x)
+#define prnonzary(x, n)                              \
+  for(int i = 0; i < n; i++) {               \
+    uint32_t reg = e10k_##x##_rd(d, i);              \
+    if (reg) snprintf(str[cnt++], 32, #x ".%d=%x", i, reg);    \
+  }
+static void stats_dump(void)
+{
+  char str[256][32];
+  int cnt = 0;
+  memset(str, 0, 256 * 32);
+
+  prnonzary(pfvfte, 2);
+  prnonz(picause);
+  prnonz(rttdcs);
+
+  prnonz(fwsm);
+  prnonz(eicr);
+
+  prnonz(dmatxctl);
+  prnonzary(tdbal, 128);
+  prnonzary(tdbah, 128);
+  prnonzary(tdlen, 128);
+  prnonzary(tdh, 128);
+  prnonzary(tdt, 128);
+  prnonzary(txdctl, 128);
+  prnonzary(tdwbal, 128);
+  prnonzary(tdwbah, 128);
+  prnonz(mtqc);
+
+    prnonz(crcerrs);
+    prnonz(illerrc);
+    prnonz(errbc);
+    prnonzary(rxmpc, 8);
+    prnonz(mlfc);
+    prnonz(mrfc);
+    prnonz(rlec);
+    prnonz(ssvpc);
+    // ...
+    prnonz(gprc);
+    prnonz(gorcl);
+    prnonz(gorch);
+    prnonz(rxnfgpc);
+    // ...
+    prnonz(rxdgpc);
+    // ...
+    prnonz(gptc);
+    prnonz(gotcl);
+    prnonz(gotch);
+    prnonz(txdgpc);
+    // ...
+    prnonz(ruc);
+    prnonz(rfc);
+    prnonz(roc);
+    prnonz(rjc);
+    prnonz(mngprc);
+    prnonz(mngpdc);
+    prnonz(torl);
+    prnonz(torh);
+    prnonz(tpr);
+    prnonz(tpt);
+    // ...
+    prnonz(mspdc);
+    // ...
+    prnonzary(qprc, 16);
+    prnonzary(qprdc, 16);
+    // ...
+
+    if(cnt > 0) {
+      queue_debug("");
+      for(int i = 0; i < cnt; i++) {
+       printf("%s ", str[i]);
+      }
+      printf("\n");
+    }
+}
+*/
 /******************************************************************************/
 /* Misc functions */
 
@@ -95,6 +186,20 @@ static struct region_entry* get_region(struct e10k_queue* q, regionid_t rid)
     return NULL;
 }
 
+/*
+static void print_packet(lvaddr_t addr, genoffset_t length)
+{
+    uint8_t* buf = (uint8_t*) addr;
+    for (int i = 0; i < length; i++) {
+        
+        if ((i % 8) == 0) {
+            printf(" \n");
+        }
+        printf("%2X ", buf[i]);
+    }
+    printf(" \n");
+}
+*/
 
 static errval_t enqueue_tx_buf(struct e10k_queue* q, regionid_t rid,
                                genoffset_t offset,
@@ -127,6 +232,7 @@ static errval_t enqueue_tx_buf(struct e10k_queue* q, regionid_t rid,
             l4t = e10k_q_udp;
             l4len = UDPHDR_LEN;
         }
+
         e10k_queue_add_txcontext(q, 0, ETHHDR_LEN, IPHDR_LEN, l4len, l4t);
 
            if (q->use_vtd) {
@@ -138,7 +244,7 @@ static errval_t enqueue_tx_buf(struct e10k_queue* q, regionid_t rid,
             addr = (lpaddr_t) entry->virt + offset + valid_data;
             e10k_queue_add_txbuf_ctx(q, addr, rid, offset, length,
                                      valid_data, valid_length, flags,
-                                     first, last, length, 0, true, l4len !=0);
+                                     first, last, valid_length, 0, true, l4len !=0);
            } else {
 
             // get virtual address of buffer
@@ -149,7 +255,7 @@ static errval_t enqueue_tx_buf(struct e10k_queue* q, regionid_t rid,
             addr = (lpaddr_t) entry->phys + offset + valid_data;
             e10k_queue_add_txbuf_ctx(q, addr, rid, offset, length,
                                      valid_data, valid_length, flags,
-                                     first, last, length, 0, true, l4len != 0);
+                                     first, last, valid_length, 0, true, l4len != 0);
         }
     } else {
         if (q->use_vtd) {
@@ -161,15 +267,15 @@ static errval_t enqueue_tx_buf(struct e10k_queue* q, regionid_t rid,
             addr = (lpaddr_t) entry->virt + offset + valid_data;
             e10k_queue_add_txbuf(q, addr, rid, offset, length, valid_data,
                                  valid_length, flags,
-                                 first, last, length);
+                                 first, last, valid_length);
         } else {
             struct region_entry* entry = get_region(q, rid);
             assert(entry != NULL);
 
-            lpaddr_t addr = 0;
+            lpaddr_t addr;
             addr = (lpaddr_t) entry->phys + offset + valid_data;
             e10k_queue_add_txbuf(q, addr, rid, offset, length, valid_data,
-                                 valid_length, flags, first, last, length);
+                                 valid_length, flags, first, last, valid_length);
         }
     }
     e10k_queue_bump_txtail(q);
@@ -243,7 +349,10 @@ static errval_t e10k_enqueue(struct devq* q, regionid_t rid, genoffset_t offset,
 
         assert(length <= 2048);
         
-        DEBUG_QUEUE("Enqueuing offset=%lu valid_data=%lu \n", offset, valid_data);
+        DEBUG_QUEUE("Enqueuing offset=%lu valid_data=%lu txhwb=%d tx_tail=%zu tx_head=%zu \n", 
+               offset, valid_data, *((uint32_t*)queue->tx_hwb), queue->tx_tail,
+               queue->tx_head);
+
         err = enqueue_tx_buf(queue, rid, offset, length, valid_data,
                              valid_length, flags);
         if (err_is_fail(err)) {
@@ -264,6 +373,14 @@ static errval_t e10k_dequeue(struct devq* q, regionid_t* rid,
     int last;
     errval_t err = SYS_ERR_OK;
 
+    if (!e10k_queue_get_txbuf(que, rid, offset, length, valid_data,
+                              valid_length, flags)) {
+        err = DEVQ_ERR_QUEUE_EMPTY;
+    }  else {
+        DEBUG_QUEUE("Sent offset=%lu valid_data=%lu \n", *offset, *valid_data);
+        return SYS_ERR_OK;
+    }
+
     if (!e10k_queue_get_rxbuf(que, rid, offset, length, valid_data,
                              valid_length, flags, &last)) {
         err = DEVQ_ERR_QUEUE_EMPTY;
@@ -272,13 +389,6 @@ static errval_t e10k_dequeue(struct devq* q, regionid_t* rid,
         return SYS_ERR_OK;
     }
      
-    if (!e10k_queue_get_txbuf(que, rid, offset, length, valid_data,
-                              valid_length, flags)) {
-        err = DEVQ_ERR_QUEUE_EMPTY;
-    }  else {
-        DEBUG_QUEUE("Sent offset=%lu valid_data=%lu \n", *offset, *valid_data);
-        return SYS_ERR_OK;
-    }
 
     return err;
 }
@@ -307,7 +417,7 @@ static errval_t e10k_register(struct devq* q, struct capref cap, regionid_t rid)
 
     void* va;
     err = vspace_map_one_frame_attr(&va, id.bytes, cr,
-                                    VREGION_FLAGS_READ_WRITE_NOCACHE,
+                                    VREGION_FLAGS_READ_WRITE,
                                     NULL, NULL);
     if (err_is_fail(err)) {
         return err;
@@ -438,6 +548,7 @@ static errval_t map_device_memory(struct e10k_queue* q,
     q->d = malloc(sizeof(e10k_t));
     assert(q->d != NULL);
     e10k_initialize(q->d, va);
+    d = q->d;
     return SYS_ERR_OK;
 }
 // TODO mostly cleanup when fail
@@ -452,6 +563,9 @@ errval_t e10k_queue_create(struct e10k_queue** queue, e10k_event_cb_t cb,
     q = malloc(sizeof(struct e10k_queue));
     q->pci_function = 0; // TODO allow also function 1
 
+    // txhwb
+    q->use_txhwb = true;
+
     if (use_vf) {
         USER_PANIC("NOT YET WORKING \n");
         // Start VF
@@ -470,7 +584,6 @@ errval_t e10k_queue_create(struct e10k_queue** queue, e10k_event_cb_t cb,
             }
         }
 
-        // TODO: VF queues only work with VT-d enabled?
         err = skb_client_connect();
         assert(err_is_ok(err));
         err = skb_execute_query("vtd_enabled(0,_).");
@@ -490,15 +603,14 @@ errval_t e10k_queue_create(struct e10k_queue** queue, e10k_event_cb_t cb,
 
     // allocate memory for RX/TX rings
     struct capref tx_frame;
-    size_t tx_size = e10k_q_tdesc_adv_ctx_size*NUM_TX_DESC;
+    size_t tx_size = e10k_q_tdesc_adv_wb_size*NUM_TX_DESC;
     void* tx_virt = alloc_map_frame(VREGION_FLAGS_READ_WRITE, tx_size, &tx_frame);
     if (tx_virt == NULL) {
         return DEVQ_ERR_INIT_QUEUE;
     }
 
-
     struct capref rx_frame;
-    size_t rx_size = e10k_q_tdesc_adv_ctx_size*NUM_RX_DESC;
+    size_t rx_size = e10k_q_rdesc_adv_wb_size*NUM_RX_DESC;
     void* rx_virt = alloc_map_frame(VREGION_FLAGS_READ_WRITE, rx_size, &rx_frame);
     if (rx_virt == NULL) {
         return DEVQ_ERR_INIT_QUEUE;
@@ -509,18 +621,18 @@ errval_t e10k_queue_create(struct e10k_queue** queue, e10k_event_cb_t cb,
         .update_rxtail = update_rxtail,
     };
 
-    struct capref txhwb_frame = NULL_CAP;
+    struct capref txhwb_frame;
     void* txhwb_virt = NULL;
-#if 0
-    if (use_txhwb) {
+
+    if (q->use_txhwb) {
         txhwb_virt = alloc_map_frame(VREGION_FLAGS_READ_WRITE, BASE_PAGE_SIZE,
         &txhwb_frame);
-        if (txhwb_virt == NULL) {
+        if (txhwb_virt == NULL) {   
             return DEVQ_ERR_INIT_QUEUE;
         }
         memset(txhwb_virt, 0, sizeof(uint32_t));
     }
-#endif
+
     e10k_queue_init(q, tx_virt, NUM_TX_DESC, txhwb_virt,
                     rx_virt, NUM_RX_DESC, &ops);
 
@@ -533,7 +645,6 @@ errval_t e10k_queue_create(struct e10k_queue** queue, e10k_event_cb_t cb,
     q->use_irq = interrupts;
 
     // XXX:disable by default for now
-    q->use_txhwb = false;
     q->use_rsc = false;
 
     if (q->use_vf) {
@@ -580,6 +691,10 @@ errval_t e10k_queue_create(struct e10k_queue** queue, e10k_event_cb_t cb,
             DEBUG_QUEUE("e10k map device error\n");
             return err;
         }
+            
+        update_txtail(q, 0);
+        update_rxtail(q, 0);
+        
     }
 
     err = devq_init(&q->q, false);
index 9bf5a49..cab7231 100644 (file)
@@ -19,6 +19,7 @@
 #include "../../../queue_interface_internal.h"
 #include <dev/e10k_q_dev.h>
 
+#define LEGACY_DESC 1
 
 struct e10k_queue_ops {
     errval_t (*update_txtail)(struct e10k_queue*, size_t);
@@ -56,7 +57,7 @@ struct e10k_queue {
     bool use_rsc; // Receive Side Coalescing
     bool use_vtd; // Virtual addressing (required for VF)
     bool use_rxctx; // 
-    bool use_txhwb; 
+    bool use_txhwb; //
     size_t rxbufsz;
     uint8_t pci_function; 
     uint64_t mac;
@@ -94,6 +95,7 @@ struct e10k_queue {
     void*                           tx_hwb;
 
     e10k_q_rdesc_adv_wb_array_t*    rx_ring;
+    struct devq_buf*                rx_bufs;
     struct e10k_queue_rxctx*        rx_context;
     size_t                          rx_head;
     size_t                          rx_tail;
@@ -120,6 +122,7 @@ static inline void e10k_queue_init(struct e10k_queue* q, void* tx, size_t tx_siz
     q->tx_hwb = tx_hwb;
 
     q->rx_ring = rx;
+    q->rx_bufs = calloc(rx_size, sizeof(struct devq_buf));
     q->rx_context = calloc(rx_size, sizeof(*q->rx_context));
     q->rx_head = 0;
     q->rx_tail = 0;
@@ -215,6 +218,42 @@ static inline int e10k_queue_add_txbuf_ctx(e10k_queue_t* q, lpaddr_t phys,
 
 }
 
+
+static inline int e10k_queue_add_txbuf_legacy(e10k_queue_t* q, lpaddr_t phys,
+                                       regionid_t rid,
+                                       genoffset_t offset,
+                                       genoffset_t length,      
+                                       genoffset_t valid_data,
+                                       genoffset_t valid_length,
+                                       uint64_t flags,
+                                       bool first, bool last,
+                                       size_t len)
+{
+    e10k_q_tdesc_legacy_t d;
+    size_t tail = q->tx_tail;
+
+
+    struct devq_buf* buf = &q->tx_bufs[tail];
+    buf->rid = rid;
+    buf->offset = offset;
+    buf->length = length;
+    buf->valid_data = valid_data;
+    buf->valid_length = valid_length;
+    buf->flags = flags;  
+
+    d = q->tx_ring[tail];
+
+    e10k_q_tdesc_legacy_buffer_insert(d, phys);
+    e10k_q_tdesc_legacy_length_insert(d, len);
+    // OPTIMIZATION: Maybe only set rs on last packet?
+    e10k_q_tdesc_legacy_rs_insert(d, (last == 1));
+    e10k_q_tdesc_legacy_ifcs_insert(d,  1);
+    e10k_q_tdesc_legacy_eop_insert(d, last);
+
+    q->tx_tail = (tail + 1) % q->tx_size;
+    return 0;
+}
+
 static inline int e10k_queue_add_txbuf(e10k_queue_t* q, lpaddr_t phys,
                                        regionid_t rid,
                                        genoffset_t offset,
@@ -225,10 +264,17 @@ static inline int e10k_queue_add_txbuf(e10k_queue_t* q, lpaddr_t phys,
                                        bool first, bool last,
                                        size_t len)
 {
-    return e10k_queue_add_txbuf_ctx(q, phys, rid, offset, length,
+#ifdef LEGACY_DESC
+        return e10k_queue_add_txbuf_legacy(q, phys, rid, offset, length,
+                                    valid_data, valid_length, 
+                                    flags, first, last, 
+                                    len);
+#else
+        return e10k_queue_add_txbuf_ctx(q, phys, rid, offset, length,
                                     valid_data, valid_length, 
                                     flags, first, last, 
                                     len, -1, false, false);
+#endif
 }
 
 /*
@@ -240,7 +286,7 @@ static inline int e10k_queue_add_txbuf(e10k_queue_t* q, lpaddr_t phys,
  *
  * \return true if packet can be reclaimed otherwise false
  */
-static inline bool e10k_queue_get_txbuf(e10k_queue_t* q, regionid_t* rid,   
+static inline bool e10k_queue_get_txbuf_avd(e10k_queue_t* q, regionid_t* rid,   
                                         genoffset_t* offset,
                                         genoffset_t* length,
                                         genoffset_t* valid_data,
@@ -288,6 +334,69 @@ static inline bool e10k_queue_get_txbuf(e10k_queue_t* q, regionid_t* rid,
     return result;
 }
 
+static inline bool e10k_queue_get_txbuf_legacy(e10k_queue_t* q, regionid_t* rid,   
+                                        genoffset_t* offset,
+                                        genoffset_t* length,
+                                        genoffset_t* valid_data,
+                                        genoffset_t* valid_length,
+                                        uint64_t* flags)
+{
+
+    e10k_q_tdesc_legacy_t d;
+    size_t head = q->tx_head;
+
+    d = q->tx_ring[head];
+    if (e10k_q_tdesc_legacy_dd_extract(d)) {
+
+        *rid = q->tx_bufs[head].rid;
+        *offset = q->tx_bufs[head].offset;
+        *length = q->tx_bufs[head].length;
+        *valid_data = q->tx_bufs[head].valid_data;
+        *valid_length = q->tx_bufs[head].valid_length;
+        *flags = q->tx_bufs[head].flags;
+        memset(d, 0, e10k_q_tdesc_legacy_size);
+
+        q->tx_head = (head + 1) % q->tx_size;
+        return true;
+    } 
+
+    if (q->tx_hwb) {
+        head = *((uint32_t*) q->tx_hwb);
+        if (q->tx_head == head) {
+            return false;
+        } else {
+            *rid = q->tx_bufs[q->tx_head].rid;
+            *offset = q->tx_bufs[q->tx_head].offset;
+            *length = q->tx_bufs[q->tx_head].length;
+            *valid_data = q->tx_bufs[q->tx_head].valid_data;
+            *valid_length = q->tx_bufs[q->tx_head].valid_length;
+            *flags = q->tx_bufs[q->tx_head].flags;
+            memset(d, 0, e10k_q_tdesc_legacy_size);
+
+            q->tx_head = (q->tx_head + 1) % q->tx_size;
+            return true;
+        }
+    }
+
+    return false;
+}
+
+static inline bool e10k_queue_get_txbuf(e10k_queue_t* q, regionid_t* rid,   
+                                        genoffset_t* offset,
+                                        genoffset_t* length,
+                                        genoffset_t* valid_data,
+                                        genoffset_t* valid_length,
+                                        uint64_t* flags)
+{
+#ifdef LEGACY_DESC
+        return e10k_queue_get_txbuf_legacy(q, rid, offset, length, valid_data, 
+                                           valid_length, flags);
+#else
+        return e10k_queue_get_txbuf_avd(q, rid, offset, length, valid_data, 
+                                        valid_length, flags);
+#endif
+}
+
 static inline errval_t e10k_queue_bump_txtail(e10k_queue_t* q)
 {
     return q->ops.update_txtail(q, q->tx_tail);
@@ -307,7 +416,7 @@ static inline size_t e10k_queue_free_txslots(e10k_queue_t* q)
 
 }
 
-static inline int e10k_queue_add_rxbuf(e10k_queue_t* q,
+static inline int e10k_queue_add_rxbuf_adv(e10k_queue_t* q,
                                        lpaddr_t phys,
                                        regionid_t rid,
                                        genoffset_t offset,
@@ -345,6 +454,54 @@ static inline int e10k_queue_add_rxbuf(e10k_queue_t* q,
     return 0;
 }
 
+static inline int e10k_queue_add_rxbuf_legacy(e10k_queue_t* q,
+                                       lpaddr_t phys,
+                                       regionid_t rid,
+                                       genoffset_t offset,
+                                       genoffset_t length,
+                                       genoffset_t valid_data,
+                                       genoffset_t valid_length,
+                                       uint64_t flags)
+{
+    e10k_q_rdesc_legacy_t d;
+    size_t tail = q->rx_tail;
+
+
+    struct devq_buf* buf = &q->rx_bufs[tail];
+    buf->rid = rid;
+    buf->offset = offset;
+    buf->length = length;
+    buf->valid_data = valid_data;
+    buf->valid_length = valid_length;
+    buf->flags = flags;  
+    
+    d = q->rx_ring[tail];
+
+    e10k_q_rdesc_legacy_buffer_insert(d, phys);
+
+    q->rx_tail = (tail + 1) % q->rx_size;
+
+    return 0;
+}
+
+
+static inline int e10k_queue_add_rxbuf(e10k_queue_t* q,
+                                       lpaddr_t phys,
+                                       regionid_t rid,
+                                       genoffset_t offset,
+                                       genoffset_t length,
+                                       genoffset_t valid_data,
+                                       genoffset_t valid_length,
+                                       uint64_t flags)
+{
+#ifdef LEGACY_DESC
+    return e10k_queue_add_rxbuf_legacy(q, phys, rid, offset, length, valid_data,
+                                       valid_length, flags);
+#else
+    return e10k_queue_add_rxbuf_adv(q, phys, rid, offset, length, valid_data,
+                                    valid_length, flags);
+#endif
+}
 static inline uint64_t e10k_queue_convert_rxflags(e10k_q_rdesc_adv_wb_t d)
 {
     uint64_t flags = 0;
@@ -379,7 +536,7 @@ static inline uint64_t e10k_queue_convert_rxflags(e10k_q_rdesc_adv_wb_t d)
     return flags;
 }
 
-static inline bool e10k_queue_get_rxbuf(e10k_queue_t* q, regionid_t* rid,
+static inline bool e10k_queue_get_rxbuf_avd(e10k_queue_t* q, regionid_t* rid,
                                         genoffset_t* offset,
                                         genoffset_t* length,
                                         genoffset_t* valid_data,
@@ -426,6 +583,58 @@ static inline bool e10k_queue_get_rxbuf(e10k_queue_t* q, regionid_t* rid,
     return true;
 }
 
+
+static inline bool e10k_queue_get_rxbuf_legacy(e10k_queue_t* q, regionid_t* rid,
+                                        genoffset_t* offset,
+                                        genoffset_t* length,
+                                        genoffset_t* valid_data,
+                                        genoffset_t* valid_length,
+                                        uint64_t* flags,
+                                        int* last)
+{
+
+    e10k_q_rdesc_legacy_t d;
+    size_t head = q->rx_head;
+    struct devq_buf* buf = &q->rx_bufs[head];
+
+    d = q->rx_ring[head];
+    if (e10k_q_rdesc_legacy_dd_extract(d)) {
+        *last = e10k_q_rdesc_legacy_eop_extract(d);
+        *valid_length = e10k_q_rdesc_legacy_length_extract(d);
+
+        *rid = buf->rid;
+        *offset = buf->offset;
+        *length = buf->length;
+        *valid_data = buf->valid_data;
+        *flags = buf->flags;
+
+        memset(d, 0, e10k_q_rdesc_legacy_size);
+
+        q->rx_head = (head + 1) % q->rx_size;
+        return true;
+    } else {
+        return false;
+    }
+}
+
+
+static inline bool e10k_queue_get_rxbuf(e10k_queue_t* q, regionid_t* rid,
+                                        genoffset_t* offset,
+                                        genoffset_t* length,
+                                        genoffset_t* valid_data,
+                                        genoffset_t* valid_length,
+                                        uint64_t* flags,
+                                        int* last)
+{
+#ifdef LEGACY_DESC
+       return e10k_queue_get_rxbuf_legacy(q, rid, offset, length, valid_data, valid_length,
+                                    flags, last);
+#else 
+       return e10k_queue_get_rxbuf_avd(q, rid, offset, length, valid_data, valid_length,
+                                       flags, last);
+#endif
+}
+
 static inline errval_t e10k_queue_bump_rxtail(e10k_queue_t* q)
 {
     return q->ops.update_rxtail(q, q->rx_tail);
index 402468c..fa0826b 100644 (file)
@@ -480,7 +480,7 @@ extern unsigned char debug_flags;
 
 
 
-#if 0
+#if 1
 #ifndef CHECKSUM_GEN_IP
 #define CHECKSUM_GEN_IP                 1
 #endif
index 1b98792..b01d3ce 100644 (file)
@@ -94,8 +94,7 @@ static errval_t create_e10k_queue (struct net_state *st, uint64_t* queueid,
     err = e10k_queue_create((struct e10k_queue**)retqueue, int_handler,
                             false /*virtual functions*/,
                             !(st->flags & NET_FLAGS_POLLING) /* user interrupts*/);
-    *queueid = 0;
-    //*queueid = e10k_queue_get_id((struct e10k_queue*)*retqueue);
+    *queueid = e10k_queue_get_id((struct e10k_queue*)*retqueue);
     return err;
 }
 
index 9034722..6eba3c2 100644 (file)
@@ -985,7 +985,8 @@ static void queue_hw_init(uint8_t n, bool set_tail)
         e10k_psrtype_split_ip6_wrf(d, n, 1);
         e10k_psrtype_split_l2_wrf(d, n, 1);
     } else {
-        e10k_srrctl_1_desctype_wrf(d, n, e10k_adv_1buf);
+        //e10k_srrctl_1_desctype_wrf(d, n, e10k_adv_1buf);
+        e10k_srrctl_1_desctype_wrf(d, n, e10k_legacy);
     }
     e10k_srrctl_1_bsz_hdr_wrf(d, n, 128 / 64); // TODO: Do 128 bytes suffice in
                                                //       all cases?
index 4453050..ea0f51a 100644 (file)
@@ -824,13 +824,20 @@ static void assign_bus_numbers(struct pci_address parentaddr,
                                  *      I350 network card (device id 0x152x),
                                  *      the configuration fails when VF are
                                  *      enabled: Legacy descriptors are ignored
-                                 *      when VF are enabled.
+                                 *      when VF are enabled. Same goes for e10k
                                  */
                                 if (vendor == 0x8086 && (device_id & 0xFFF0) == 0x1520) {
                                     debug_printf("skipping SR IOV initialization"
                                                     "for e1000 card.\n");
                                     break;
                                 }
+                
+                                if (vendor == 0x8086 && (device_id  == 0x10FB)) {
+                                    debug_printf("skipping SR IOV initialization"
+                                                    "for e10k card.\n");
+                                    break;
+                                }
+
                                 pci_sr_iov_cap_t sr_iov_cap;
                                 pci_sr_iov_cap_initialize(&sr_iov_cap,
                                      (mackerel_addr_t) (ad + (cap_ptr / 4)));