netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Subbaraya Sundeep <sbhatta@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com,
	edumazet@google.com, sgoutham@marvell.com, gakula@marvell.com,
	hkelam@marvell.com, lcherian@marvell.com, jerinj@marvell.com
Subject: Re: [PATCH v2 net] octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam
Date: Wed, 29 Nov 2023 17:26:33 +0000	[thread overview]
Message-ID: <20231129172633.GG43811@kernel.org> (raw)
In-Reply-To: <1701235422-22488-1-git-send-email-sbhatta@marvell.com>

On Wed, Nov 29, 2023 at 10:53:42AM +0530, Subbaraya Sundeep wrote:
> All the mailbox messages sent to AF needs to be guarded
> by mutex lock. Add the missing lock in otx2_get_pauseparam
> function.
> 
> Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
> ---
> v2 changes:
>  Added maintainers of AF driver too

Hi Subbaraya,

I was expecting an update to locking in otx2_dcbnl_ieee_setpfc()
Am I missing something here?

Link: https://lore.kernel.org/all/CO1PR18MB4666C2C1D1284F425E4C9F38A183A@CO1PR18MB4666.namprd18.prod.outlook.com/

> 
>  drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> index 9efcec5..53f6258 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> @@ -334,9 +334,12 @@ static void otx2_get_pauseparam(struct net_device *netdev,
>  	if (is_otx2_lbkvf(pfvf->pdev))
>  		return;
>  
> +	mutex_lock(&pfvf->mbox.lock);
>  	req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
> -	if (!req)
> +	if (!req) {
> +		mutex_unlock(&pfvf->mbox.lock);
>  		return;
> +	}
>  
>  	if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
>  		rsp = (struct cgx_pause_frm_cfg *)
> @@ -344,6 +347,7 @@ static void otx2_get_pauseparam(struct net_device *netdev,
>  		pause->rx_pause = rsp->rx_pause;
>  		pause->tx_pause = rsp->tx_pause;
>  	}
> +	mutex_unlock(&pfvf->mbox.lock);
>  }
>  
>  static int otx2_set_pauseparam(struct net_device *netdev,
> -- 
> 2.7.4
> 

  reply	other threads:[~2023-11-29 17:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29  5:23 [PATCH v2 net] octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam Subbaraya Sundeep
2023-11-29 17:26 ` Simon Horman [this message]
2023-11-30  4:36   ` [EXT] " Subbaraya Sundeep Bhatta
2023-11-30 16:24     ` Simon Horman
2023-12-01 11:10 ` patchwork-bot+netdevbpf

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=20231129172633.GG43811@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@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=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.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).