Ethernet devices have an RSS option to tell the driver to
authorNathan Binkert <binkertn@umich.edu>
Fri, 3 Mar 2006 19:17:48 +0000 (14:17 -0500)
committerNathan Binkert <binkertn@umich.edu>
Fri, 3 Mar 2006 19:17:48 +0000 (14:17 -0500)
use Receive side scaling

dev/ns_gige.cc:
dev/ns_gige.hh:
dev/ns_gige_reg.h:
dev/sinic.cc:
dev/sinic.hh:
dev/sinicreg.hh:
    add support for setting the RSS flag to notify the driver
    to use RSS

--HG--
extra : convert_revision : 5f0c11668ae976634b3bf0caad669a9464a4c041

dev/ns_gige.cc
dev/ns_gige.hh
dev/ns_gige_reg.h
dev/sinic.cc
dev/sinic.hh
dev/sinicreg.hh
python/m5/objects/Ethernet.py

index d6df347bc50dec0ec20696511526bad0726bd3b5..ed8c794f951e716a74abe0d97e6cd29addfc7b95 100644 (file)
@@ -767,6 +767,8 @@ NSGigE::read(MemReqPtr &req, uint8_t *data)
                     reg |= M5REG_RX_THREAD;
                 if (params()->tx_thread)
                     reg |= M5REG_TX_THREAD;
+                if (params()->rss)
+                    reg |= M5REG_RSS;
                 break;
 
               default:
@@ -3009,6 +3011,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(NSGigE)
     Param<string> hardware_address;
     Param<bool> rx_thread;
     Param<bool> tx_thread;
+    Param<bool> rss;
 
 END_DECLARE_SIM_OBJECT_PARAMS(NSGigE)
 
@@ -3048,7 +3051,8 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(NSGigE)
     INIT_PARAM(rx_filter, "Enable Receive Filter"),
     INIT_PARAM(hardware_address, "Ethernet Hardware Address"),
     INIT_PARAM(rx_thread, ""),
-    INIT_PARAM(tx_thread, "")
+    INIT_PARAM(tx_thread, ""),
+    INIT_PARAM(rss, "")
 
 END_INIT_SIM_OBJECT_PARAMS(NSGigE)
 
@@ -3093,6 +3097,7 @@ CREATE_SIM_OBJECT(NSGigE)
     params->eaddr = hardware_address;
     params->rx_thread = rx_thread;
     params->tx_thread = tx_thread;
+    params->rss = rss;
 
     return new NSGigE(params);
 }
index cdd8e4b9e9faa08a280c80bda828ef9cce1f5182..59c55056e323e4a4bfee54fed7d077253ca913e0 100644 (file)
@@ -385,6 +385,7 @@ class NSGigE : public PciDev
         uint32_t rx_fifo_size;
         bool rx_thread;
         bool tx_thread;
+        bool rss;
         bool dma_no_allocate;
     };
 
index eadc60d0331670bbc055123a837110e015b35eba..5f6fa2cc5faacef6dbd9ef528bf86f32dd04cdfa 100644 (file)
 
 /* M5 control register */
 #define M5REG_RESERVED         0xfffffffc
+#define M5REG_RSS              0x00000004
 #define M5REG_RX_THREAD                0x00000002
 #define M5REG_TX_THREAD                0x00000001
 
index 34b4213e0bb4ab96166e5b7caa363e473d41949e..363994919c8c95da50393ec05402ca90505c9b7c 100644 (file)
@@ -761,6 +761,8 @@ Device::reset()
         regs.Config |= Config_RxThread;
     if (params()->tx_thread)
         regs.Config |= Config_TxThread;
+    if (params()->rss)
+        regs.Config |= Config_RSS;
     regs.IntrMask = Intr_Soft | Intr_RxHigh | Intr_RxPacket | Intr_TxLow;
     regs.RxMaxCopy = params()->rx_max_copy;
     regs.TxMaxCopy = params()->tx_max_copy;
@@ -1624,6 +1626,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(Device)
     Param<string> hardware_address;
     Param<bool> rx_thread;
     Param<bool> tx_thread;
+    Param<bool> rss;
 
 END_DECLARE_SIM_OBJECT_PARAMS(Device)
 
@@ -1666,7 +1669,8 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(Device)
     INIT_PARAM(rx_filter, "Enable Receive Filter"),
     INIT_PARAM(hardware_address, "Ethernet Hardware Address"),
     INIT_PARAM(rx_thread, ""),
-    INIT_PARAM(tx_thread, "")
+    INIT_PARAM(tx_thread, ""),
+    INIT_PARAM(rss, "")
 
 END_INIT_SIM_OBJECT_PARAMS(Device)
 
@@ -1714,6 +1718,7 @@ CREATE_SIM_OBJECT(Device)
     params->eaddr = hardware_address;
     params->rx_thread = rx_thread;
     params->tx_thread = tx_thread;
+    params->rss = rss;
 
     return new Device(params);
 }
index c4027be864689357db75603dde2b134b0076b44f..25172fa459c875328a5a5e702b968d43123a03a5 100644 (file)
@@ -355,6 +355,7 @@ class Device : public Base
         bool dma_no_allocate;
         bool rx_thread;
         bool tx_thread;
+        bool rss;
     };
 
   protected:
index fc1f4c06b24807250d6438e8c9018651e8b202d0..f9043239800280257d8fee826d5d22baa7e548c9 100644 (file)
@@ -81,6 +81,7 @@ __SINIC_REG32(HwAddr,      0x60); // 64: mac address
 __SINIC_REG32(Size,        0x68); // register addres space size
 
 // Config register bits
+__SINIC_VAL32(Config_RSS,      10, 1); // enable receive side scaling
 __SINIC_VAL32(Config_RxThread,  9, 1); // enable receive threads
 __SINIC_VAL32(Config_TxThread,  8, 1); // enable transmit thread
 __SINIC_VAL32(Config_Filter,    7, 1); // enable receive filter
index 3a7f88d040aca88cebf9af85a68147d8392962d3..6113e656f9f1208964a0bd837729a94a39d27d0f 100644 (file)
@@ -86,6 +86,7 @@ class EtherDevBase(PciDevice):
     intr_delay = Param.Latency('10us', "Interrupt propagation delay")
     rx_thread = Param.Bool(False, "dedicated kernel thread for transmit")
     tx_thread = Param.Bool(False, "dedicated kernel threads for receive")
+    rss = Param.Bool(False, "Receive Side Scaling")
 
 class NSGigE(EtherDevBase):
     type = 'NSGigE'