lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f21ff7c0-9462-44f8-8212-00906698706f@davidwei.uk>
Date: Tue, 20 May 2025 15:57:54 +0100
From: David Wei <dw@...idwei.uk>
To: Michael Chan <michael.chan@...adcom.com>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, kuba@...nel.org,
 pabeni@...hat.com, andrew+netdev@...n.ch, pavan.chebbi@...adcom.com,
 andrew.gospodarek@...adcom.com
Subject: Re: [PATCH net 2/3] bnxt_en: Add a helper function to configure MRU
 and RSS

On 5/19/25 13:41, Michael Chan wrote:
> From: Pavan Chebbi <pavan.chebbi@...adcom.com>
> 
> Add a new helper function that will configure MRU and RSS table
> of a VNIC. This will be useful when we configure both on a VNIC
> when resetting an RX ring.  This function will be used again in
> the next bug fix patch where we have to reconfigure VNICs for RSS
> contexts.
> 
> Suggested-by: Michael Chan <michael.chan@...adcom.com>
> Signed-off-by: Pavan Chebbi <pavan.chebbi@...adcom.com>
> Signed-off-by: Michael Chan <michael.chan@...adcom.com>
> ---
> Cc: David Wei <dw@...idwei.uk>
> ---
>   drivers/net/ethernet/broadcom/bnxt/bnxt.c | 36 ++++++++++++++++-------
>   1 file changed, 25 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 6afc2ab6fad2..a45c5ce81111 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -10738,6 +10738,26 @@ void bnxt_del_one_rss_ctx(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx,
>   	bp->num_rss_ctx--;
>   }
>   
> +static int bnxt_set_vnic_mru_p5(struct bnxt *bp, struct bnxt_vnic_info *vnic,
> +				u16 mru)
> +{
> +	int rc;
> +
> +	if (mru) {
> +		rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true);
> +		if (rc) {
> +			netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n",
> +				   vnic->vnic_id, rc);
> +			return rc;
> +		}
> +	}
> +	vnic->mru = mru;
> +	bnxt_hwrm_vnic_update(bp, vnic,
> +			      VNIC_UPDATE_REQ_ENABLES_MRU_VALID);
> +
> +	return 0;
> +}
> +
>   static void bnxt_hwrm_realloc_rss_ctx_vnic(struct bnxt *bp)
>   {
>   	bool set_tpa = !!(bp->flags & BNXT_FLAG_TPA);
> @@ -15936,15 +15956,10 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
>   	for (i = 0; i < bp->nr_vnics; i++) {
>   		vnic = &bp->vnic_info[i];
>   
> -		rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true);
> -		if (rc) {
> -			netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n",
> -				   vnic->vnic_id, rc);
> +		rc = bnxt_set_vnic_mru_p5(bp, vnic,
> +					  bp->dev->mtu + ETH_HLEN + VLAN_HLEN);

Pure mechanical change, LGTM.

Only nit is to calculate this mru once outside the loop, like patch 2.

Reviewed-by: David Wei <dw@...idwei.uk>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ