pci: inherit common driver in PCI driver
[dpdk.git] / drivers / net / cxgbe / sge.c
index aa0c2e5..736f08c 100644 (file)
@@ -808,20 +808,23 @@ static void tx_timer_cb(void *data)
        struct adapter *adap = (struct adapter *)data;
        struct sge_eth_txq *txq = &adap->sge.ethtxq[0];
        int i;
+       unsigned int coal_idx;
 
        /* monitor any pending tx */
        for (i = 0; i < adap->sge.max_ethqsets; i++, txq++) {
-               t4_os_lock(&txq->txq_lock);
-               if (txq->q.coalesce.idx) {
-                       if (txq->q.coalesce.idx == txq->q.last_coal_idx &&
-                           txq->q.pidx == txq->q.last_pidx) {
-                               ship_tx_pkt_coalesce_wr(adap, txq);
-                       } else {
-                               txq->q.last_coal_idx = txq->q.coalesce.idx;
-                               txq->q.last_pidx = txq->q.pidx;
+               if (t4_os_trylock(&txq->txq_lock)) {
+                       coal_idx = txq->q.coalesce.idx;
+                       if (coal_idx) {
+                               if (coal_idx == txq->q.last_coal_idx &&
+                                   txq->q.pidx == txq->q.last_pidx) {
+                                       ship_tx_pkt_coalesce_wr(adap, txq);
+                               } else {
+                                       txq->q.last_coal_idx = coal_idx;
+                                       txq->q.last_pidx = txq->q.pidx;
+                               }
                        }
+                       t4_os_unlock(&txq->txq_lock);
                }
-               t4_os_unlock(&txq->txq_lock);
        }
        rte_eal_alarm_set(50, tx_timer_cb, (void *)adap);
 }
@@ -1329,9 +1332,6 @@ static struct rte_mbuf *t4_pktgl_to_mbuf(const struct pkt_gl *gl)
        return t4_pktgl_to_mbuf_usembufs(gl);
 }
 
-#define RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb) \
-       ((dma_addr_t) ((mb)->buf_physaddr + (mb)->data_off))
-
 /**
  * t4_ethrx_handler - process an ingress ethernet packet
  * @q: the response queue that received the packet
@@ -1645,7 +1645,8 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
        iq->size = cxgbe_roundup(iq->size, 16);
 
        snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-                eth_dev->driver->pci_drv.name, fwevtq ? "fwq_ring" : "rx_ring",
+                eth_dev->driver->pci_drv.driver.name,
+                fwevtq ? "fwq_ring" : "rx_ring",
                 eth_dev->data->port_id, queue_id);
        snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name);
 
@@ -1697,7 +1698,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
                fl->size = cxgbe_roundup(fl->size, 8);
 
                snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-                        eth_dev->driver->pci_drv.name,
+                        eth_dev->driver->pci_drv.driver.name,
                         fwevtq ? "fwq_ring" : "fl_ring",
                         eth_dev->data->port_id, queue_id);
                snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name);
@@ -1820,7 +1821,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
 
 refill_fl_err:
        t4_iq_free(adap, adap->mbox, adap->pf, 0, FW_IQ_TYPE_FL_INT_CAP,
-                  iq->cntxt_id, fl ? fl->cntxt_id : 0xffff, 0xffff);
+                  iq->cntxt_id, fl->cntxt_id, 0xffff);
 fl_nomem:
        ret = -ENOMEM;
 err:
@@ -1893,7 +1894,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
        nentries = txq->q.size + s->stat_len / sizeof(struct tx_desc);
 
        snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-                eth_dev->driver->pci_drv.name, "tx_ring",
+                eth_dev->driver->pci_drv.driver.name, "tx_ring",
                 eth_dev->data->port_id, queue_id);
        snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name);