Skip to contentSkip to conversation

octeontx2-af: Fix hardware timestamping for VFs

PATCH In review Sai Krishna 3 participants 3 messages Oct 3, 2023 – Oct 11, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 octeontx2-af: Fix hardware timestamping for VFs

From: Subbaraya Sundeep <[email protected]>

Currently for VFs, mailbox returns ENODEV error when hardware timestamping enable is requested. This patch fixes this issue. Modified this patch to return EPERM error for the PF/VFs which are not attached to CGX/RPM.

Fixes 421572175ba5 ("octeontx2-af: Support to enable/disable HW timestamping")
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +3 -4
index f2b1edf1bb43..f464640e188b 100644
@@ -756,12 +756,11 @@ static int rvu_cgx_ptp_rx_cfg(struct rvu *rvu, u16 pcifunc, bool enable)
 	if (!is_mac_feature_supported(rvu, pf, RVU_LMAC_FEAT_PTP))
 		return 0;
 
-	/* This msg is expected only from PFs that are mapped to CGX LMACs,
+	/* This msg is expected only from PF/VFs that are mapped to CGX/RPM LMACs,
 	 * if received from other PF/VF simply ACK, nothing to do.
 	 */
-	if ((pcifunc & RVU_PFVF_FUNC_MASK) ||
-	    !is_pf_cgxmapped(rvu, pf))
-		return -ENODEV;
+	if (!is_pf_cgxmapped(rvu, rvu_get_pf(pcifunc)))
+		return -EPERM;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 	cgxd = rvu_cgx_pdata(cgx_id, rvu);
Signature · 1 line
2.25.1
reviewer
#1 lore raw
Quoted 20 lines · Sai Krishna

From: Subbaraya Sundeep <[email protected]>

Currently for VFs, mailbox returns ENODEV error when hardware timestamping enable is requested. This patch fixes this issue. Modified this patch to return EPERM error for the PF/VFs which are not attached to CGX/RPM.

Fixes 421572175ba5 ("octeontx2-af: Support to enable/disable HW timestamping")
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +0 -0
index f2b1edf1bb43..f464640e188b 100644
@@ -756,12 +756,11 @@ static int rvu_cgx_ptp_rx_cfg(struct rvu *rvu, u16 pcifunc, bool enable)
 	if (!is_mac_feature_supported(rvu, pf, RVU_LMAC_FEAT_PTP))

drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c static int rvu_cgx_ptp_rx_cfg(struct rvu *rvu, u16 pcifunc, bool enable) · line 762

Quoted 10 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +2 -4
 		return 0;
 
-	/* This msg is expected only from PFs that are mapped to CGX LMACs,
+	/* This msg is expected only from PF/VFs that are mapped to CGX/RPM LMACs,
 	 * if received from other PF/VF simply ACK, nothing to do.
 	 */
-	if ((pcifunc & RVU_PFVF_FUNC_MASK) ||
-	    !is_pf_cgxmapped(rvu, pf))
-		return -ENODEV;
+	if (!is_pf_cgxmapped(rvu, rvu_get_pf(pcifunc)))

Hi Sai,

I'm not clear on why this change substitutes pf for rvu_get_pf(pcifunc), as futher above in this function pf is set to the return value of rvu_get_pf(pcifunc).

Quoted 8 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +1 -0
+		return -EPERM;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 	cgxd = rvu_cgx_pdata(cgx_id, rvu);
Signature · 1 line
2.25.1
#2 lore raw

Hi Simon,

Quoted 51 lines

-----Original Message-----
From: Simon Horman <[email protected]>
Sent: Saturday, October 7, 2023 8:22 PM
To: Sai Krishna Gajula <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sunil Kovvuri Goutham <[email protected]>; Geethasowjanya Akula <[email protected]>; [email protected]; Linu Cherian <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Hariprasad Kelam <[email protected]>; Subbaraya Sundeep Bhatta <[email protected]>
Subject: [EXT] Re: [net PATCH v2] octeontx2-af: Fix hardware timestamping for VFs

Quoted 7 lines · Sai Krishna

From: Subbaraya Sundeep <[email protected]>

Currently for VFs, mailbox returns ENODEV error when hardware timestamping enable is requested. This patch fixes this issue. Modified this patch to return EPERM error for the PF/VFs which are not attached to CGX/RPM.

Fixes 421572175ba5 ("octeontx2-af: Support to enable/disable HW

timestamping")

Review

Quoted 8 lines
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c

drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c static int rvu_cgx_ptp_rx_cfg(struct rvu *rvu, u16

Quoted 4 lines

index f2b1edf1bb43..f464640e188b 100644

drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +0 -0
@@ -756,12 +756,11 @@ static int rvu_cgx_ptp_rx_cfg(struct rvu *rvu, u16

pcifunc, bool enable)

drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c static int rvu_cgx_ptp_rx_cfg(struct rvu *rvu, u16 pcifunc, bool enable)

Quoted 5 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +1 -1
 	if (!is_mac_feature_supported(rvu, pf, RVU_LMAC_FEAT_PTP))
 		return 0;
 
-	/* This msg is expected only from PFs that are mapped to CGX LMACs,
+	/* This msg is expected only from PF/VFs that are mapped to CGX/RPM

LMACs,

drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c static int rvu_cgx_ptp_rx_cfg(struct rvu *rvu, u16 pcifunc, bool enable) · line 762

Quoted 6 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +1 -3
 	 * if received from other PF/VF simply ACK, nothing to do.
 	 */
-	if ((pcifunc & RVU_PFVF_FUNC_MASK) ||
-	    !is_pf_cgxmapped(rvu, pf))
-		return -ENODEV;
+	if (!is_pf_cgxmapped(rvu, rvu_get_pf(pcifunc)))

Hi Sai,

Quoted 4 lines

I'm not clear on why this change substitutes pf for rvu_get_pf(pcifunc), as futher above in this function pf is set to the return value of rvu_get_pf(pcifunc).

Good catch. No need of rvu_get_pf(pcifunc) again. We will change and send v3. Thanks for the review.

Sundeep

Quoted 8 lines
Quoted 8 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +1 -1
+		return -EPERM;
 
 	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 	cgxd = rvu_cgx_pdata(cgx_id, rvu);
--

2.25.1