From d3376cdc7d7d685aee9e84186f8ae315c03f57f3 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Thu, 28 Jan 2021 09:23:30 +0530 Subject: [PATCH] net/bnxt: fix mbuf flags for PTP packets Commit "899f06130724" broke the update of mbuf flags for PTP packets. "mbuf->ol_flags" is overwritten in bnxt_set_ol_flags() function. Fixes: 899f06130724 ("net/bnxt: add Rx logic for 58818 chips") Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_rxr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 75d49d23c3..8c2781c968 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -590,6 +590,12 @@ bnxt_set_ol_flags(struct bnxt_rx_ring_info *rxr, struct rx_pkt_cmpl *rxcmp, ol_flags |= PKT_RX_RSS_HASH; } +#ifdef RTE_LIBRTE_IEEE1588 + if (unlikely((flags_type & RX_PKT_CMPL_FLAGS_MASK) == + RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP)) + ol_flags |= PKT_RX_IEEE1588_PTP | PKT_RX_IEEE1588_TMST; +#endif + mbuf->ol_flags = ol_flags; } @@ -843,10 +849,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, #ifdef RTE_LIBRTE_IEEE1588 if (unlikely((rte_le_to_cpu_16(rxcmp->flags_type) & RX_PKT_CMPL_FLAGS_MASK) == - RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP)) { - mbuf->ol_flags |= PKT_RX_IEEE1588_PTP | PKT_RX_IEEE1588_TMST; + RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP)) bnxt_get_rx_ts_p5(rxq->bp, rxcmp1->reorder); - } #endif if (cmp_type == CMPL_BASE_TYPE_RX_L2_V2) { -- 2.20.1