net/virtio: fetch extended statistics with integer ids
[dpdk.git] / drivers / net / fm10k / fm10k_rxtx.c
index 9f832c1..81ed4e7 100644 (file)
@@ -65,6 +65,9 @@ static inline void dump_rxd(union fm10k_rx_desc *rxd)
 }
 #endif
 
+/* @note: When this function is changed, make corresponding change to
+ * fm10k_dev_supported_ptypes_get()
+ */
 static inline void
 rx_desc_to_ol_flags(struct rte_mbuf *m, const union fm10k_rx_desc *d)
 {
@@ -152,6 +155,12 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                 */
                mbuf->ol_flags |= PKT_RX_VLAN_PKT;
                mbuf->vlan_tci = desc.w.vlan;
+               /**
+                * mbuf->vlan_tci_outer is an idle field in fm10k driver,
+                * so it can be selected to store sglort value.
+                */
+               if (q->rx_ftag_en)
+                       mbuf->vlan_tci_outer = rte_le_to_cpu_16(desc.w.sglort);
 
                rx_pkts[count] = mbuf;
                if (++next_dd == q->nb_desc) {
@@ -307,6 +316,13 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                 */
                first_seg->ol_flags |= PKT_RX_VLAN_PKT;
                first_seg->vlan_tci = desc.w.vlan;
+               /**
+                * mbuf->vlan_tci_outer is an idle field in fm10k driver,
+                * so it can be selected to store sglort value.
+                */
+               if (q->rx_ftag_en)
+                       first_seg->vlan_tci_outer =
+                               rte_le_to_cpu_16(desc.w.sglort);
 
                /* Prefetch data of first segment, if configured to do so. */
                rte_packet_prefetch((char *)first_seg->buf_addr +
@@ -498,6 +514,8 @@ static inline void tx_xmit_pkt(struct fm10k_tx_queue *q, struct rte_mbuf *mb)
        q->nb_free -= mb->nb_segs;
 
        q->hw_ring[q->next_free].flags = 0;
+       if (q->tx_ftag_en)
+               q->hw_ring[q->next_free].flags |= FM10K_TXD_FLAG_FTAG;
        /* set checksum flags on first descriptor of packet. SCTP checksum
         * offload is not supported, but we do not explicitly check for this
         * case in favor of greatly simplified processing. */