From: Mohammad Shuab Siddique <mohammad-shuab.siddique@broadcom.com>
To: dev@dpdk.org
Cc: kishore.padmanabha@broadcom.com,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
stable@dpdk.org,
Mohammad Shuab Siddique <mohammad-shuab.siddique@broadcom.com>
Subject: [PATCH 1/4] net/bnxt: support handling PTP frames in Rx
Date: Mon, 2 Mar 2026 10:12:33 -0700 [thread overview]
Message-ID: <20260302171236.98625-2-Mohammad-Shuab.Siddique@broadcom.com> (raw)
In-Reply-To: <20260302171236.98625-1-Mohammad-Shuab.Siddique@broadcom.com>
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Support handling of PTP frames in the Rx path.
This feature is available in scalar mode data path.
If the Rx completion indicates a PTP timesync packet,
update the mbuf ol_flags accordingly.
This feature is not available in the compressed Rx CQE mode.
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Mohammad Shuab Siddique <mohammad-shuab.siddique@broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.c | 11 ++++++++++-
drivers/net/bnxt/bnxt_rxr.h | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index c94abefa01..ac4c61b850 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -724,7 +724,7 @@ bnxt_set_ol_flags(struct bnxt_rx_ring_info *rxr, struct rx_pkt_cmpl *rxcmp,
RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP))
ol_flags |= RTE_MBUF_F_RX_IEEE1588_PTP | RTE_MBUF_F_RX_IEEE1588_TMST;
- mbuf->ol_flags = ol_flags;
+ mbuf->ol_flags |= ol_flags;
}
static void
@@ -1182,6 +1182,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
if (mbuf == NULL)
return -EBUSY;
+ mbuf->ol_flags = 0;
mbuf->data_off = RTE_PKTMBUF_HEADROOM;
mbuf->nb_segs = 1;
mbuf->next = NULL;
@@ -1199,6 +1200,14 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
bnxt_parse_csum_v3(mbuf, rxcmp1);
bnxt_parse_pkt_type_v3(mbuf, rxcmp, rxcmp1);
bnxt_rx_vlan_v3(mbuf, rxcmp, rxcmp1);
+ /* Packet cannot be a PTP ethertype if it is detected as L4 */
+ if (mbuf->ol_flags & RTE_MBUF_F_RX_L4_CKSUM_GOOD)
+ mbuf->ol_flags &= ~RTE_MBUF_F_RX_IEEE1588_PTP;
+
+ /* If its a PTP frame, ptype cannot be L2_ETHER */
+ if (mbuf->ol_flags & RTE_MBUF_F_RX_IEEE1588_PTP)
+ mbuf->packet_type = RTE_PTYPE_L2_ETHER_TIMESYNC;
+
if (BNXT_TRUFLOW_EN(bp))
mark_id = bnxt_ulp_set_mark_in_mbuf_v3(rxq->bp, rxcmp1,
mbuf, &vfr_flag);
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 7357ca4427..5e5496964f 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -535,6 +535,6 @@ bnxt_parse_csum_v3(struct rte_mbuf *mbuf, struct rx_pkt_cmpl_hi *rxcmp1)
uint16_t error_v2 = rte_le_to_cpu_16(v3_cmp->errors_v2);
uint32_t flags2 = rte_le_to_cpu_32(v3_cmp->flags2);
- mbuf->ol_flags = bnxt_parse_csum_fields_v3(flags2, error_v2);
+ mbuf->ol_flags |= bnxt_parse_csum_fields_v3(flags2, error_v2);
}
#endif /* _BNXT_RXR_H_ */
--
2.47.3
next prev parent reply other threads:[~2026-03-02 17:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 17:12 [PATCH 0/4] net/bnxt: PTP support series Mohammad Shuab Siddique
2026-03-02 17:12 ` Mohammad Shuab Siddique [this message]
2026-03-02 17:12 ` [PATCH 2/4] net/bnxt: pass Rx timestamp in mbuf Mohammad Shuab Siddique
2026-03-02 17:12 ` [PATCH 3/4] net/bnxt: support timestamp parsing in Tx Mohammad Shuab Siddique
2026-03-02 17:12 ` [PATCH 4/4] net/bnxt: add ptp_cfg struct support for Thor 2 VFs Mohammad Shuab Siddique
2026-03-02 17:26 ` [PATCH v2 " Mohammad Shuab Siddique
2026-03-11 18:29 ` [PATCH 0/4] net/bnxt: PTP support series Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260302171236.98625-2-Mohammad-Shuab.Siddique@broadcom.com \
--to=mohammad-shuab.siddique@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=kishore.padmanabha@broadcom.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox