From: Hariprasad Kelam <hkelam@marvell.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Network Development <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
David Miller <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
Sunil Kovvuri Goutham <sgoutham@marvell.com>,
Linu Cherian <lcherian@marvell.com>,
Geethasowjanya Akula <gakula@marvell.com>,
Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
Subbaraya Sundeep Bhatta <sbhatta@marvell.com>,
Christina Jacob <cjacob@marvell.com>
Subject: Re: [Patch v2 net-next 3/7] octeontx2-pf: ethtool fec mode support
Date: Sat, 30 Jan 2021 10:05:12 +0000 [thread overview]
Message-ID: <MWHPR18MB14219441C77FF415879C5773DEB89@MWHPR18MB1421.namprd18.prod.outlook.com> (raw)
Hi Willem,
> -----Original Message-----
> From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
> Sent: Thursday, January 28, 2021 2:01 AM
> To: Hariprasad Kelam <hkelam@marvell.com>
> Cc: Network Development <netdev@vger.kernel.org>; LKML <linux-
> kernel@vger.kernel.org>; David Miller <davem@davemloft.net>; Jakub
> Kicinski <kuba@kernel.org>; Sunil Kovvuri Goutham
> <sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>;
> Geethasowjanya Akula <gakula@marvell.com>; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; Subbaraya Sundeep Bhatta <sbhatta@marvell.com>;
> Christina Jacob <cjacob@marvell.com>
> Subject: [EXT] Re: [Patch v2 net-next 3/7] octeontx2-pf: ethtool fec mode
> support
>
> External Email
>
> ----------------------------------------------------------------------
> On Wed, Jan 27, 2021 at 4:03 AM Hariprasad Kelam <hkelam@marvell.com>
> wrote:
> >
> > From: Christina Jacob <cjacob@marvell.com>
> >
> > Add ethtool support to configure fec modes baser/rs and support to
> > fecth FEC stats from CGX as well PHY.
> >
> > Configure fec mode
> > - ethtool --set-fec eth0 encoding rs/baser/off/auto Query fec
> > mode
> > - ethtool --show-fec eth0
> >
> > Signed-off-by: Christina Jacob <cjacob@marvell.com>
> > Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
> > Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
> > ---
> > .../ethernet/marvell/octeontx2/nic/otx2_common.c | 23 +++
> > .../ethernet/marvell/octeontx2/nic/otx2_common.h | 6 +
> > .../ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 181
> ++++++++++++++++++++-
> > .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 3 +
> > 4 files changed, 211 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> > b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> > index bdfa2e2..f7e5450 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> > @@ -60,6 +60,22 @@ void otx2_update_lmac_stats(struct otx2_nic *pfvf)
> > mutex_unlock(&pfvf->mbox.lock); }
> >
> > +void otx2_update_lmac_fec_stats(struct otx2_nic *pfvf) {
> > + struct msg_req *req;
> > +
> > + if (!netif_running(pfvf->netdev))
> > + return;
> > + mutex_lock(&pfvf->mbox.lock);
> > + req = otx2_mbox_alloc_msg_cgx_fec_stats(&pfvf->mbox);
> > + if (!req) {
> > + mutex_unlock(&pfvf->mbox.lock);
> > + return;
> > + }
> > + otx2_sync_mbox_msg(&pfvf->mbox);
>
> Perhaps simpler to have a single exit from the critical section:
>
Agreed will fix this in next version.
> if (req)
> otx2_update_lmac_fec_stats
>
> > + mutex_unlock(&pfvf->mbox.lock); }
>
> Also, should this function return an error on failure? The caller returns errors
> in other cases.
Caller of this function otx2_get_sset_count . Where driver suppose to return number of stats.
This function is just to update local netdev counters fec_corr_blks/ fec_uncorr_blks. So failure
Of this function should not effect.
Thanks,
Hariprasad k
next reply other threads:[~2021-01-30 10:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-30 10:05 Hariprasad Kelam [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-01-27 7:45 [Patch v2 net-next 0/7] ethtool support for fec and link configuration Hariprasad Kelam
2021-01-27 7:45 ` [Patch v2 net-next 3/7] octeontx2-pf: ethtool fec mode support Hariprasad Kelam
2021-01-27 20:30 ` Willem de Bruijn
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=MWHPR18MB14219441C77FF415879C5773DEB89@MWHPR18MB1421.namprd18.prod.outlook.com \
--to=hkelam@marvell.com \
--cc=cjacob@marvell.com \
--cc=davem@davemloft.net \
--cc=gakula@marvell.com \
--cc=jerinj@marvell.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=willemdebruijn.kernel@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).