Message ID | 20231003110504.913980-1-saikrishnag@marvell.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2003277vqb; Tue, 3 Oct 2023 04:06:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFB/mjofGXQHGHhKfYcygQm53wW/bt6+FNQyhI6AwEhmg+y0elKAKLIRSaau5kLnNyAFVfq X-Received: by 2002:a17:90a:c685:b0:269:5adb:993 with SMTP id n5-20020a17090ac68500b002695adb0993mr10426568pjt.22.1696331176792; Tue, 03 Oct 2023 04:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696331176; cv=none; d=google.com; s=arc-20160816; b=PDxTDd9R9rEGJE6kcfAZ5W6+jrZQJmpU0zSu5Ri6yFE4SdVldPPki6y6h5Zv1Z3qn8 haoJ5teZL5WbGfxbbJ2//uM63dBEglKB0mPZxNNtKUE1krvFCC06eawwrzT86RDn2oQn Pl8mzGcpGbQMFY0ZS39xrdIRXB62ErD5e9AZ2igIBlDZAaYyL3h8laOYQSsyJ4cUz4XL RcRgVFf+H7+I+jHXLEO5LXZSdbagGwu4ek3qsMLLeUb4f0y18ImVeu/xmhfc+m5mdih/ KVmVkSEgw77NMABmF/fkBugbCgusGFbXmdaVZdo/BXcmnkOlEuBT1CKDOwGakT5TsBgZ rTsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tET2+AIxtn68+0uz+/GiUayRVrjGD1YQA48ihtjez8Y=; fh=OOfg4bT5sxLM4hQYqk/qWw3CyN88sNXQvu7/QqHGOPg=; b=dmTpFPhm7vEBnno9PJfxfZjw2zjF1W2X/lvM9BnXk3bdzwivw58izat8m6JuuPjcgn cpNwBXEGWvgMjYSeIoA+1yxbNniGMh9H2Rs+UwWSSo4JZFLPx1+pnpMOTPMbuwrcHtdb Ck4pgtvcoe6gSpI+2ItLiAmHl1Xa1XkU3or+DFWvHJRqkHv90OX6CERsBED9G6lQRjb2 CmJqUhsMrqR8Y2hkYmZV/0D87nzLsrKQvV6PqZGZ5AY4FatyfOsdvfSa3oPyVz7cVj40 UMxvckgsTsFHfnwpjezk3r1jEf+vXBzQPWO3iuU6WXPK8CW2Y4+3kdZ7352UiaIXo/Jr yUdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=IiRY5Ecz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b13-20020a17090ae38d00b00267b910cb37si1189592pjz.52.2023.10.03.04.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 04:06:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=IiRY5Ecz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B7D7980793D8; Tue, 3 Oct 2023 04:05:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240013AbjJCLFa (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Tue, 3 Oct 2023 07:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239727AbjJCLF2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 3 Oct 2023 07:05:28 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4401AF; Tue, 3 Oct 2023 04:05:23 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3931jZsg028259; Tue, 3 Oct 2023 04:05:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=tET2+AIxtn68+0uz+/GiUayRVrjGD1YQA48ihtjez8Y=; b=IiRY5Ecz/3kTxlgTZW1T//pgFz8Z+JV0y2GQoIiIrMFDD/t8H+M5k0pfu3HjqkNlpEgJ NcjLeKn9fxnsG7i9Edkt4FkxYNct7A41Xm+JBLE0QRYeD2h6xyhD4xJtohINCQYJ7nOS cHvl/oVcVhgC7zjTdCvxKCYiFqEQHLTp/LfovAUxNVsUDzP4r8PExx4KfuCT0OfxX4ZK gcGEkPTjHSrx9O6WnTWw5td+R/Jc/6YFHZPUlVbZNQyD49fad81Ucyv9m/UkZ2bIfbMm Db6cRVQLrczQiS2wmdIuOaOpsrdIffq+iOi9HdluPoVgDMNuoSGRyfPctjQbDHL+nvaT Cg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3tek6myxnc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 03 Oct 2023 04:05:14 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 3 Oct 2023 04:05:12 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 3 Oct 2023 04:05:12 -0700 Received: from hyd1425.marvell.com (unknown [10.29.37.83]) by maili.marvell.com (Postfix) with ESMTP id 63C983F7082; Tue, 3 Oct 2023 04:05:06 -0700 (PDT) From: Sai Krishna <saikrishnag@marvell.com> To: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <sgoutham@marvell.com>, <gakula@marvell.com>, <richardcochran@gmail.com>, <lcherian@marvell.com>, <jerinj@marvell.com>, <hkelam@marvell.com>, <sbhatta@marvell.com> CC: Sai Krishna <saikrishnag@marvell.com> Subject: [net PATCH v2] octeontx2-af: Fix hardware timestamping for VFs Date: Tue, 3 Oct 2023 16:35:04 +0530 Message-ID: <20231003110504.913980-1-saikrishnag@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: G54itKdXw0XzXu-6Ik06kNscxhMG4PO8 X-Proofpoint-GUID: G54itKdXw0XzXu-6Ik06kNscxhMG4PO8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-03_08,2023-10-02_01,2023-05-22_02 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 04:05:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778732159948266788 X-GMAIL-MSGID: 1778732159948266788 |
Series |
[net,v2] octeontx2-af: Fix hardware timestamping for VFs
|
|
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
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 > >
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 --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);