diff mbox series

[net,v2] octeontx2-af: Fix hardware timestamping for VFs

Message ID 20231003110504.913980-1-saikrishnag@marvell.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net,v2] octeontx2-af: Fix hardware timestamping for VFs | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers fail 1 blamed authors not CCed: zyta@marvell.com; 1 maintainers not CCed: zyta@marvell.com
netdev/build_clang success Errors and warnings before: 1363 this patch: 1363
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1363 this patch: 1363
netdev/checkpatch warning WARNING: line length of 82 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Sai Krishna Gajula Oct. 3, 2023, 11:05 a.m. UTC
From: Subbaraya Sundeep <sbhatta@marvell.com>

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")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Simon Horman Oct. 7, 2023, 2:52 p.m. UTC | #1
On Tue, Oct 03, 2023 at 04:35:04PM +0530, Sai Krishna wrote:
> From: Subbaraya Sundeep <sbhatta@marvell.com>
> 
> 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")
> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
> ---
>  drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> index f2b1edf1bb43..f464640e188b 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> @@ -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)))

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).

> +		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
> 
>
Subbaraya Sundeep Oct. 11, 2023, 5:01 a.m. UTC | #2
Hi Simon,

>-----Original Message-----
>From: Simon Horman <horms@kernel.org>
>Sent: Saturday, October 7, 2023 8:22 PM
>To: Sai Krishna Gajula <saikrishnag@marvell.com>
>Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
>pabeni@redhat.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
>Sunil Kovvuri Goutham <sgoutham@marvell.com>; Geethasowjanya Akula
><gakula@marvell.com>; richardcochran@gmail.com; Linu Cherian
><lcherian@marvell.com>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
>Hariprasad Kelam <hkelam@marvell.com>; Subbaraya Sundeep Bhatta
><sbhatta@marvell.com>
>Subject: [EXT] Re: [net PATCH v2] octeontx2-af: Fix hardware timestamping for
>VFs
>On Tue, Oct 03, 2023 at 04:35:04PM +0530, Sai Krishna wrote:
>> From: Subbaraya Sundeep <sbhatta@marvell.com>
>>
>> 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")
>> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
>> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
>> Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
>> ---
>>  drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 7 +++----
>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
>b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
>> index f2b1edf1bb43..f464640e188b 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
>> @@ -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)))
>
>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).
>
Good catch. No need of rvu_get_pf(pcifunc) again. We will change and send v3.
Thanks for the review.

Sundeep

>> +		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
>>
>>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
index f2b1edf1bb43..f464640e188b 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
@@ -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);