net/cxgbe: enable RSS for VF
[dpdk.git] / drivers / net / cxgbe / cxgbe_main.c
index feb494b..138e1c1 100644 (file)
@@ -346,14 +346,17 @@ static void setup_memwin(struct adapter *adap)
                                        MEMWIN_NIC));
 }
 
-static int init_rss(struct adapter *adap)
+int init_rss(struct adapter *adap)
 {
        unsigned int i;
-       int err;
 
-       err = t4_init_rss_mode(adap, adap->mbox);
-       if (err)
-               return err;
+       if (is_pf4(adap)) {
+               int err;
+
+               err = t4_init_rss_mode(adap, adap->mbox);
+               if (err)
+                       return err;
+       }
 
        for_each_port(adap, i) {
                struct port_info *pi = adap2pinfo(adap, i);
@@ -1068,7 +1071,8 @@ int setup_rss(struct port_info *pi)
 static void enable_rx(struct adapter *adap, struct sge_rspq *q)
 {
        /* 0-increment GTS to start the timer and enable interrupts */
-       t4_write_reg(adap, MYPF_REG(A_SGE_PF_GTS),
+       t4_write_reg(adap, is_pf4(adap) ? MYPF_REG(A_SGE_PF_GTS) :
+                                         T4VF_SGE_BASE_ADDR + A_SGE_VF_GTS,
                     V_SEINTARM(q->intr_params) |
                     V_INGRESSQID(q->cntxt_id));
 }