Re: [net-next PATCH v2] octeontx2-pf: Reset MAC stats during probe

From: Sai Krishna Gajula
Date: Fri Mar 08 2024 - 01:10:05 EST



> -----Original Message-----
> From: Jakub Kicinski <kuba@xxxxxxxxxx>
> Sent: Friday, March 8, 2024 10:17 AM
> To: Sai Krishna Gajula <saikrishnag@xxxxxxxxxxx>
> Cc: davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; pabeni@xxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Sunil Kovvuri Goutham
> <sgoutham@xxxxxxxxxxx>; Geethasowjanya Akula <gakula@xxxxxxxxxxx>;
> Hariprasad Kelam <hkelam@xxxxxxxxxxx>; Subbaraya Sundeep Bhatta
> <sbhatta@xxxxxxxxxxx>
> Subject: Re: [net-next PATCH v2] octeontx2-pf: Reset MAC stats
> during probe
>
> On Tue, 5 Mar 2024 13:57:07 +0530 Sai Krishna wrote:
> > +int otx2_reset_mac_stats(struct otx2_nic *pfvf);
> >
> > /* RVU block related APIs */
> > int otx2_attach_npa_nix(struct otx2_nic *pfvf); diff --git
> > a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> > b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> > index e5fe67e73865..a91f5b7e84c6 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> > @@ -1124,6 +1124,24 @@ static int otx2_cgx_config_linkevents(struct
> otx2_nic *pf, bool enable)
> > return err;
> > }
> >
> > +int otx2_reset_mac_stats(struct otx2_nic *pfvf) {
> > + struct msg_req *req;
> > + int err;
> > +
> > + mutex_lock(&pfvf->mbox.lock);
> > + req = otx2_mbox_alloc_msg_cgx_stats_rst(&pfvf->mbox);
> > + if (!req) {
> > + mutex_unlock(&pfvf->mbox.lock);
> > + return -ENOMEM;
> > + }
> > +
> > + err = otx2_sync_mbox_msg(&pfvf->mbox);
> > + mutex_unlock(&pfvf->mbox.lock);
> > + return err;
> > +}
> > +EXPORT_SYMBOL(otx2_reset_mac_stats);
>
> Why the export? I see only one call to this function and it's right below.

Ack, Will remove this export and submit patch V3

>
> > static int otx2_cgx_config_loopback(struct otx2_nic *pf, bool enable)
> > {
> > struct msg_req *msg;
> > @@ -3048,6 +3066,9 @@ static int otx2_probe(struct pci_dev *pdev,
> > const struct pci_device_id *id)
> >
> > otx2_qos_init(pf, qos_txqs);
> >
> > + /* reset CGX/RPM MAC stats */
> > + otx2_reset_mac_stats(pf);
> > +