]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Fix ixgbe(4) to compile - with RSS; with ix+ixv in the kernel.
authoradrian <adrian@FreeBSD.org>
Wed, 18 Mar 2015 05:05:30 +0000 (05:05 +0000)
committeradrian <adrian@FreeBSD.org>
Wed, 18 Mar 2015 05:05:30 +0000 (05:05 +0000)
* Fix the multiple same-named devclasses; the duplicate name
  trips up the linker.

* Re-do the taskqueue stuff to use the new cpuset API, not the old
  pinned API.

* Add includes for the new location of the RSS configuration routines.

This allows ixgbe to compile as a module /and/ linked into the kernel,
along with RSS working.

Sponsored by: Norse Corp, Inc.

sys/dev/ixgbe/if_ix.c
sys/dev/ixgbe/if_ixv.c
sys/dev/ixgbe/ix_txrx.c

index 3c16330e6f88e85540b175d82da9d7905e17a20d..a77a3ef71f571e4608fd0de0f7b95bf891e4286c 100644 (file)
@@ -42,6 +42,7 @@
 #include "ixgbe.h"
 
 #ifdef RSS
+#include <net/rss_config.h>
 #include <netinet/in_rss.h>
 #endif
 
@@ -191,7 +192,7 @@ extern void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw);
  *  FreeBSD Device Interface Entry Points
  *********************************************************************/
 
-static device_method_t ixgbe_methods[] = {
+static device_method_t ix_methods[] = {
        /* Device interface */
        DEVMETHOD(device_probe, ixgbe_probe),
        DEVMETHOD(device_attach, ixgbe_attach),
@@ -200,15 +201,15 @@ static device_method_t ixgbe_methods[] = {
        DEVMETHOD_END
 };
 
-static driver_t ixgbe_driver = {
-       "ix", ixgbe_methods, sizeof(struct adapter),
+static driver_t ix_driver = {
+       "ix", ix_methods, sizeof(struct adapter),
 };
 
-devclass_t ixgbe_devclass;
-DRIVER_MODULE(ixgbe, pci, ixgbe_driver, ixgbe_devclass, 0, 0);
+devclass_t ix_devclass;
+DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0);
 
-MODULE_DEPEND(ixgbe, pci, 1, 1, 1);
-MODULE_DEPEND(ixgbe, ether, 1, 1, 1);
+MODULE_DEPEND(ix, pci, 1, 1, 1);
+MODULE_DEPEND(ix, ether, 1, 1, 1);
 
 /*
 ** TUNEABLE PARAMETERS:
@@ -2110,6 +2111,9 @@ ixgbe_allocate_msix(struct adapter *adapter)
        struct          tx_ring *txr = adapter->tx_rings;
        int             error, rid, vector = 0;
        int             cpu_id = 0;
+#ifdef RSS
+       cpuset_t        cpu_mask;
+#endif
 
 #ifdef RSS
        /*
@@ -2199,8 +2203,9 @@ ixgbe_allocate_msix(struct adapter *adapter)
                que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,
                    taskqueue_thread_enqueue, &que->tq);
 #ifdef RSS
-               taskqueue_start_threads_pinned(&que->tq, 1, PI_NET,
-                   cpu_id,
+               CPU_SETOF(cpu_id, &cpu_mask);
+               taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET,
+                   &cpu_mask,
                    "%s (bucket %d)",
                    device_get_nameunit(adapter->dev),
                    cpu_id);
index ed1cbae132e3623f62d6fad9d3e39df3e72fe38c..f1b759eab1ac566ad15026a6f8b89d51eb368542 100644 (file)
@@ -142,10 +142,11 @@ static driver_t ixv_driver = {
        "ixv", ixv_methods, sizeof(struct adapter),
 };
 
-devclass_t ixgbe_devclass;
-DRIVER_MODULE(ixv, pci, ixv_driver, ixgbe_devclass, 0, 0);
+devclass_t ixv_devclass;
+DRIVER_MODULE(ixv, pci, ixv_driver, ixv_devclass, 0, 0);
 MODULE_DEPEND(ixv, pci, 1, 1, 1);
 MODULE_DEPEND(ixv, ether, 1, 1, 1);
+/* XXX depend on 'ix' ? */
 
 /*
 ** TUNEABLE PARAMETERS:
index e5f895c0160126b92dceb6c60cf7f7990b6ee96b..88cd5b4dbe3829c0a8c5030d19f3ab9445aa448a 100644 (file)
@@ -42,6 +42,7 @@
 #include "ixgbe.h"
 
 #ifdef RSS
+#include <net/rss_config.h>
 #include <netinet/in_rss.h>
 #endif