Skip to contentSkip to conversation

net/bnxt: remove compile-time option for IEEE 1588

PATCH Superseded Ajit Khaparde 1 participant 1 message Feb 22, 2023 Network drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: remove compile-time option for IEEE 1588

Typically drivers are supposed to enable/disable features dynamically instead of compile time options.
Remove the compile time option RTE_LIBRTE_IEEE1588 from bnxt PMD.

This patch is an improved and bnxt specific version of the previous submission which tried to remove the option tree wide, but was completely disabling for bnxt PMD.

http://patchwork.dpdk.org/project/dpdk/patch/[email protected]/

Also add a devarg to enable/disable the setting,
invoked as for ex: "-a 000:0b:0d.0,ieee-1588=1".

---
 drivers/net/bnxt/bnxt.h        |  1 +
 drivers/net/bnxt/bnxt_ethdev.c | 63 +++++++++++++++++++++++++++++++---
 drivers/net/bnxt/bnxt_rxr.c    |  6 ----
 3 files changed, 59 insertions(+), 11 deletions(-)
drivers/net/bnxt/bnxt.h +1 -0
index c9aa45ed3b..f6eaaeb470 100644
@@ -832,6 +832,7 @@ struct bnxt {
 	uint32_t		hwrm_spec_code;
 
 	struct bnxt_led_info	*leds;
+	uint8_t			ieee_1588;
 	struct bnxt_ptp_cfg     *ptp_cfg;
 	uint16_t		vf_resv_strategy;
 	struct bnxt_ctx_mem_info        *ctx;
drivers/net/bnxt/bnxt_ethdev.c +58 -5

111 lines not on this page · raw message

drivers/net/bnxt/bnxt_rxr.c +0 -6
index 0eebddb05d..a067278dca 100644
@@ -680,16 +680,13 @@ bnxt_set_ol_flags(struct bnxt_rx_ring_info *rxr, struct rx_pkt_cmpl *rxcmp,
 		ol_flags |= RTE_MBUF_F_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 |= RTE_MBUF_F_RX_IEEE1588_PTP | RTE_MBUF_F_RX_IEEE1588_TMST;
-#endif
 
 	mbuf->ol_flags = ol_flags;
 }
 
-#ifdef RTE_LIBRTE_IEEE1588
 static void
 bnxt_get_rx_ts_p5(struct bnxt *bp, uint32_t rx_ts_cmpl)
 {
@@ -716,7 +713,6 @@ bnxt_get_rx_ts_p5(struct bnxt *bp, uint32_t rx_ts_cmpl)
 	}
 	ptp->rx_timestamp = pkt_time;
 }
-#endif
 
 static uint32_t
 bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
@@ -925,12 +921,10 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	mbuf->data_len = mbuf->pkt_len;
 	mbuf->port = rxq->port_id;
 
-#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))
 		bnxt_get_rx_ts_p5(rxq->bp, rxcmp1->reorder);
-#endif
 
 	if (cmp_type == CMPL_BASE_TYPE_RX_L2_V2) {
 		bnxt_parse_csum_v2(mbuf, rxcmp1);
Signature · 1 line
2.37.1 (Apple Git-137.1)