net/i40e: extended list of operations for DDP processing
[dpdk.git] / drivers / net / cxgbe / cxgbe_main.c
index 2522354..eead7c0 100644 (file)
@@ -414,6 +414,36 @@ static void print_port_info(struct adapter *adap)
        }
 }
 
+static void configure_pcie_ext_tag(struct adapter *adapter)
+{
+       u16 v;
+       int pos = t4_os_find_pci_capability(adapter, PCI_CAP_ID_EXP);
+
+       if (!pos)
+               return;
+
+       if (pos > 0) {
+               t4_os_pci_read_cfg2(adapter, pos + PCI_EXP_DEVCTL, &v);
+               v |= PCI_EXP_DEVCTL_EXT_TAG;
+               t4_os_pci_write_cfg2(adapter, pos + PCI_EXP_DEVCTL, v);
+               if (is_t6(adapter->params.chip)) {
+                       t4_set_reg_field(adapter, A_PCIE_CFG2,
+                                        V_T6_TOTMAXTAG(M_T6_TOTMAXTAG),
+                                        V_T6_TOTMAXTAG(7));
+                       t4_set_reg_field(adapter, A_PCIE_CMD_CFG,
+                                        V_T6_MINTAG(M_T6_MINTAG),
+                                        V_T6_MINTAG(8));
+               } else {
+                       t4_set_reg_field(adapter, A_PCIE_CFG2,
+                                        V_TOTMAXTAG(M_TOTMAXTAG),
+                                        V_TOTMAXTAG(3));
+                       t4_set_reg_field(adapter, A_PCIE_CMD_CFG,
+                                        V_MINTAG(M_MINTAG),
+                                        V_MINTAG(8));
+               }
+       }
+}
+
 /*
  * Tweak configuration based on system architecture, etc.  Most of these have
  * defaults assigned to them by Firmware Configuration Files (if we're using
@@ -596,7 +626,7 @@ static int adap_init0_config(struct adapter *adapter, int reset)
        /*
         * Return successfully and note that we're operating with parameters
         * not supplied by the driver, rather than from hard-wired
-        * initialization constants burried in the driver.
+        * initialization constants buried in the driver.
         */
        dev_info(adapter,
                 "Successfully configured using Firmware Configuration File \"%s\", version %#x, computed checksum %#x\n",
@@ -799,6 +829,7 @@ static int adap_init0(struct adapter *adap)
        }
        t4_init_sge_params(adap);
        t4_init_tp_params(adap);
+       configure_pcie_ext_tag(adap);
 
        adap->params.drv_memwin = MEMWIN_NIC;
        adap->flags |= FW_OK;
@@ -984,33 +1015,22 @@ int setup_rss(struct port_info *pi)
 /*
  * Enable NAPI scheduling and interrupt generation for all Rx queues.
  */
-static void enable_rx(struct adapter *adap)
+static void enable_rx(struct adapter *adap, struct sge_rspq *q)
 {
-       struct sge *s = &adap->sge;
-       struct sge_rspq *q = &s->fw_evtq;
-       int i, j;
-
        /* 0-increment GTS to start the timer and enable interrupts */
        t4_write_reg(adap, MYPF_REG(A_SGE_PF_GTS),
                     V_SEINTARM(q->intr_params) |
                     V_INGRESSQID(q->cntxt_id));
+}
 
-       for_each_port(adap, i) {
-               const struct port_info *pi = &adap->port[i];
-               struct rte_eth_dev *eth_dev = pi->eth_dev;
-
-               for (j = 0; j < eth_dev->data->nb_rx_queues; j++) {
-                       q = eth_dev->data->rx_queues[j];
-
-                       /*
-                        * 0-increment GTS to start the timer and enable
-                        * interrupts
-                        */
-                       t4_write_reg(adap, MYPF_REG(A_SGE_PF_GTS),
-                                    V_SEINTARM(q->intr_params) |
-                                    V_INGRESSQID(q->cntxt_id));
-               }
-       }
+void cxgbe_enable_rx_queues(struct port_info *pi)
+{
+       struct adapter *adap = pi->adapter;
+       struct sge *s = &adap->sge;
+       unsigned int i;
+
+       for (i = 0; i < pi->n_rx_qsets; i++)
+               enable_rx(adap, &s->ethrxq[pi->first_qset + i].rspq);
 }
 
 /**
@@ -1023,7 +1043,7 @@ static void enable_rx(struct adapter *adap)
  */
 int cxgbe_up(struct adapter *adap)
 {
-       enable_rx(adap);
+       enable_rx(adap, &adap->sge.fw_evtq);
        t4_sge_tx_monitor_start(adap);
        t4_intr_enable(adap);
        adap->flags |= FULL_INIT_DONE;