net/bnxt: support timesync
[dpdk.git] / drivers / net / bnxt / bnxt_rxr.c
index d9621e5..188df36 100644 (file)
@@ -199,7 +199,7 @@ static void bnxt_tpa_start(struct bnxt_rx_queue *rxq,
        if (tpa_start1->flags2 &
            rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN)) {
                mbuf->vlan_tci = rte_le_to_cpu_32(tpa_start1->metadata);
-               mbuf->ol_flags |= PKT_RX_VLAN_PKT;
+               mbuf->ol_flags |= PKT_RX_VLAN;
        }
        if (likely(tpa_start1->flags2 &
                   rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC)))
@@ -437,11 +437,11 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 
        cons = rxcmp->opaque;
        mbuf = bnxt_consume_rx_buf(rxr, cons);
-       rte_prefetch0(mbuf);
-
        if (mbuf == NULL)
                return -EBUSY;
 
+       rte_prefetch0(mbuf);
+
        mbuf->nb_segs = 1;
        mbuf->next = NULL;
        mbuf->pkt_len = rxcmp->len;
@@ -456,6 +456,10 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
                mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;
        }
 
+       if ((rxcmp->flags_type & rte_cpu_to_le_16(RX_PKT_CMPL_FLAGS_MASK)) ==
+            RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP)
+               mbuf->ol_flags |= PKT_RX_IEEE1588_PTP;
+
        if (agg_buf)
                bnxt_rx_pages(rxq, mbuf, &tmp_raw_cons, agg_buf);
 
@@ -464,7 +468,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
                        (RX_PKT_CMPL_METADATA_VID_MASK |
                        RX_PKT_CMPL_METADATA_DE |
                        RX_PKT_CMPL_METADATA_PRI_MASK);
-               mbuf->ol_flags |= PKT_RX_VLAN_PKT;
+               mbuf->ol_flags |= PKT_RX_VLAN;
        }
 
        if (likely(RX_CMP_IP_CS_OK(rxcmp1)))