New upstream version 17.11.4
[deb_dpdk.git] / drivers / net / cxgbe / sge.c
index 5376fc5..5180084 100644 (file)
@@ -149,7 +149,7 @@ static int map_mbuf(struct rte_mbuf *mbuf, dma_addr_t *addr)
        struct rte_mbuf *m = mbuf;
 
        for (; m; m = m->next, addr++) {
-               *addr = m->buf_physaddr + rte_pktmbuf_headroom(m);
+               *addr = m->buf_iova + rte_pktmbuf_headroom(m);
                if (*addr == 0)
                        goto out_err;
        }
@@ -423,7 +423,7 @@ static unsigned int refill_fl_usembufs(struct adapter *adap, struct sge_fl *q,
                mbuf->nb_segs = 1;
                mbuf->port = rxq->rspq.port_id;
 
-               mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_physaddr +
+               mapping = (dma_addr_t)RTE_ALIGN(mbuf->buf_iova +
                                                mbuf->data_off,
                                                adap->sge.fl_align);
                mapping |= buf_size_idx;
@@ -1318,7 +1318,7 @@ alloc_sw_ring:
        if (metadata)
                *(void **)metadata = s;
 
-       *phys = (uint64_t)tz->phys_addr;
+       *phys = (uint64_t)tz->iova;
        return tz->addr;
 }
 
@@ -1405,7 +1405,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
        }
 
        if (pkt->vlan_ex) {
-               mbuf->ol_flags |= PKT_RX_VLAN_PKT;
+               mbuf->ol_flags |= PKT_RX_VLAN;
                mbuf->vlan_tci = ntohs(pkt->vlan);
        }
        rxq->stats.pkts++;
@@ -1550,7 +1550,7 @@ static int process_responses(struct sge_rspq *q, int budget,
                                }
 
                                if (cpl->vlan_ex) {
-                                       pkt->ol_flags |= PKT_RX_VLAN_PKT;
+                                       pkt->ol_flags |= PKT_RX_VLAN;
                                        pkt->vlan_tci = ntohs(cpl->vlan);
                                }
 
@@ -1689,6 +1689,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
        char z_name[RTE_MEMZONE_NAMESIZE];
        char z_name_sw[RTE_MEMZONE_NAMESIZE];
        unsigned int nb_refill;
+       u8 pciechan;
 
        /* Size needs to be multiple of 16, including status entry. */
        iq->size = cxgbe_roundup(iq->size, 16);
@@ -1708,6 +1709,9 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
        c.op_to_vfn = htonl(V_FW_CMD_OP(FW_IQ_CMD) | F_FW_CMD_REQUEST |
                            F_FW_CMD_WRITE | F_FW_CMD_EXEC |
                            V_FW_IQ_CMD_PFN(adap->pf) | V_FW_IQ_CMD_VFN(0));
+
+       pciechan = pi->tx_chan;
+
        c.alloc_to_len16 = htonl(F_FW_IQ_CMD_ALLOC | F_FW_IQ_CMD_IQSTART |
                                 (sizeof(c) / 16));
        c.type_to_iqandstindex =
@@ -1719,16 +1723,19 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
                      V_FW_IQ_CMD_IQANDSTINDEX(intr_idx >= 0 ? intr_idx :
                                                               -intr_idx - 1));
        c.iqdroprss_to_iqesize =
-               htons(V_FW_IQ_CMD_IQPCIECH(cong > 0 ? cxgbe_ffs(cong) - 1 :
-                                                     pi->tx_chan) |
+               htons(V_FW_IQ_CMD_IQPCIECH(pciechan) |
                      F_FW_IQ_CMD_IQGTSMODE |
                      V_FW_IQ_CMD_IQINTCNTTHRESH(iq->pktcnt_idx) |
                      V_FW_IQ_CMD_IQESIZE(ilog2(iq->iqe_len) - 4));
        c.iqsize = htons(iq->size);
        c.iqaddr = cpu_to_be64(iq->phys_addr);
        if (cong >= 0)
-               c.iqns_to_fl0congen = htonl(F_FW_IQ_CMD_IQFLINTCONGEN |
-                                           F_FW_IQ_CMD_IQRO);
+               c.iqns_to_fl0congen =
+                       htonl(F_FW_IQ_CMD_IQFLINTCONGEN |
+                             V_FW_IQ_CMD_IQTYPE(cong ?
+                                                FW_IQ_IQTYPE_NIC :
+                                                FW_IQ_IQTYPE_OFLD) |
+                             F_FW_IQ_CMD_IQRO);
 
        if (fl) {
                struct sge_eth_rxq *rxq = container_of(fl, struct sge_eth_rxq,