New upstream version 16.11.8
[deb_dpdk.git] / drivers / net / nfp / nfp_net.c
index 1f42dac..0f0589e 100644 (file)
@@ -323,7 +323,7 @@ nfp_net_tx_queue_release_mbufs(struct nfp_net_txq *txq)
 
        for (i = 0; i < txq->tx_count; i++) {
                if (txq->txbufs[i].mbuf) {
-                       rte_pktmbuf_free(txq->txbufs[i].mbuf);
+                       rte_pktmbuf_free_seg(txq->txbufs[i].mbuf);
                        txq->txbufs[i].mbuf = NULL;
                }
        }
@@ -620,7 +620,7 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
        uint32_t tmp;
 
        tmp = rte_be_to_cpu_32(nn_cfg_readl(hw, NFP_NET_CFG_MACADDR));
-       memcpy(&hw->mac_addr[0], &tmp, sizeof(struct ether_addr));
+       memcpy(&hw->mac_addr[0], &tmp, 4);
 
        tmp = rte_be_to_cpu_32(nn_cfg_readl(hw, NFP_NET_CFG_MACADDR + 4));
        memcpy(&hw->mac_addr[4], &tmp, 2);
@@ -1731,16 +1731,16 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                        break;
                }
 
+               rxds = &rxq->rxds[idx];
+               if ((rxds->rxd.meta_len_dd & PCIE_DESC_RX_DD) == 0)
+                       break;
+
                /*
                 * Memory barrier to ensure that we won't do other
                 * reads before the DD bit.
                 */
                rte_rmb();
 
-               rxds = &rxq->rxds[idx];
-               if ((rxds->rxd.meta_len_dd & PCIE_DESC_RX_DD) == 0)
-                       break;
-
                /*
                 * We got a packet. Let's alloc a new mbuff for refilling the
                 * free descriptor ring as soon as possible
@@ -1801,6 +1801,8 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                mb->nb_segs = 1;
                mb->next = NULL;
 
+               mb->port = rxq->port_id;
+
                /* Checking the RSS flag */
                nfp_net_set_hash(rxq, rxds, mb);
 
@@ -2021,11 +2023,15 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
                                txq->tail = 0;
 
                        pkt_size -= dma_size;
-                       if (!pkt_size) {
-                               /* End of packet */
-                               txds->offset_eop |= PCIE_DESC_TX_EOP;
-                       } else {
-                               txds->offset_eop &= PCIE_DESC_TX_OFFSET_MASK;
+
+                       /*
+                        * Making the EOP, packets with just one segment
+                        * the priority
+                        */
+                       if (likely(!pkt_size))
+                               txds->offset_eop = PCIE_DESC_TX_EOP;
+                       else {
+                               txds->offset_eop = 0;
                                pkt = pkt->next;
                        }
                        /* Referencing next free TX descriptor */