[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240703195557.4b643f90@kernel.org>
Date: Wed, 3 Jul 2024 19:55:57 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
netdev@...r.kernel.org, Anil Samal <anil.samal@...el.com>, Simon Horman
<horms@...nel.org>, Jesse Brandeburg <jesse.brandeburg@...el.com>, Pucha
Himasekhar Reddy <himasekharx.reddy.pucha@...el.com>
Subject: Re: [PATCH net-next 2/3] ice: Implement driver functionality to
dump fec statistics
On Tue, 2 Jul 2024 11:07:06 -0700 Tony Nguyen wrote:
> + pf = np->vsi->back;
> + hw = &pf->hw;
> + pi = np->vsi->port_info;
> +
> + if (!hw || !pi)
> + return;
nit: hw can't possibly be NULL, it's pf + offset, even if pf is null hw
won't be; maybe also combine the pi check with the type check below?
to make it look less like defensive programming..
next patch has the same isse
> + /* Serdes parameters are not supported if not the PF VSI */
> + if (np->vsi->type != ICE_VSI_PF)
> + return;
> +
> + err = ice_get_port_topology(hw, pi->lport, &port_topology);
> + if (err) {
> + netdev_info(netdev, "Extended register dump failed Lport %d\n",
> + pi->lport);
> + return;
> + }
> +
> + /* Get FEC correctable, uncorrectable counter */
> + err = ice_get_port_fec_stats(hw, port_topology.pcs_quad_select,
> + port_topology.pcs_port, fec_stats);
> + if (err) {
> + netdev_info(netdev, "FEC stats get failed Lport %d Err %d\n",
> + pi->lport, err);
> + }
unnecessary brackets
--
pw-bot: cr
Powered by blists - more mailing lists