netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Veerasenareddy Burru <vburru@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	aayarekar@marvell.com, sedara@marvell.com, sburla@marvell.com,
	linux-doc@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next v4 6/8] octeon_ep: support asynchronous notifications
Date: Thu, 23 Mar 2023 12:39:00 +0200	[thread overview]
Message-ID: <20230323103900.GC36557@unreal> (raw)
In-Reply-To: <20230322091958.13103-7-vburru@marvell.com>

On Wed, Mar 22, 2023 at 02:19:55AM -0700, Veerasenareddy Burru wrote:
> Add asynchronous notification support to the control mailbox.
> 
> Signed-off-by: Veerasenareddy Burru <vburru@marvell.com>
> Signed-off-by: Abhijit Ayarekar <aayarekar@marvell.com>
> ---
> v3 -> v4:
>  * 0005-xxx.patch in v3 is 0006-xxx.patch in v4.
>  * addressed review comments
>    https://lore.kernel.org/all/Y+0J94sowllCe5Gs@boxer/
>    - fixed rct violation.
>    - process_mbox_notify() now returns void.
> 
> v2 -> v3:
>  * no change
> 
> v1 -> v2:
>  * no change
> 
>  .../marvell/octeon_ep/octep_ctrl_net.c        | 29 +++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c
> index cef4bc3b1ec0..465eef2824e3 100644
> --- a/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c
> +++ b/drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c
> @@ -271,6 +271,33 @@ static void process_mbox_resp(struct octep_device *oct,
>  	}
>  }
>  
> +static int process_mbox_notify(struct octep_device *oct,
> +			       struct octep_ctrl_mbox_msg *msg)
> +{
> +	struct net_device *netdev = oct->netdev;
> +	struct octep_ctrl_net_f2h_req *req;
> +
> +	req = (struct octep_ctrl_net_f2h_req *)msg->sg_list[0].msg;
> +	switch (req->hdr.s.cmd) {
> +	case OCTEP_CTRL_NET_F2H_CMD_LINK_STATUS:
> +		if (netif_running(netdev)) {
> +			if (req->link.state) {
> +				dev_info(&oct->pdev->dev, "netif_carrier_on\n");
> +				netif_carrier_on(netdev);
> +			} else {
> +				dev_info(&oct->pdev->dev, "netif_carrier_off\n");
> +				netif_carrier_off(netdev);
> +			}

Shouldn't netdev changes be protected by some lock?
Is is safe to get event from FW and process it as is?

Thanks

  reply	other threads:[~2023-03-23 10:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  9:19 [PATCH net-next v4 0/8] octeon_ep: deferred probe and mailbox Veerasenareddy Burru
2023-03-22  9:19 ` [PATCH net-next v4 1/8] octeon_ep: defer probe if firmware not ready Veerasenareddy Burru
2023-03-22  9:19 ` [PATCH net-next v4 2/8] octeon_ep: poll for control messages Veerasenareddy Burru
2023-03-22  9:19 ` [PATCH net-next v4 3/8] octeon_ep: control mailbox for multiple PFs Veerasenareddy Burru
2023-03-22  9:19 ` [PATCH net-next v4 4/8] octeon_ep: add separate mailbox command and response queues Veerasenareddy Burru
2023-03-22  9:19 ` [PATCH net-next v4 5/8] octeon_ep: include function id in mailbox commands Veerasenareddy Burru
2023-03-22  9:19 ` [PATCH net-next v4 6/8] octeon_ep: support asynchronous notifications Veerasenareddy Burru
2023-03-23 10:39   ` Leon Romanovsky [this message]
2023-03-23 17:24     ` [EXT] " Veerasenareddy Burru
2023-03-29  7:29       ` Leon Romanovsky
2023-03-22  9:19 ` [PATCH net-next v4 7/8] octeon_ep: function id in link info and stats mailbox commands Veerasenareddy Burru
2023-03-22  9:19 ` [PATCH net-next v4 8/8] octeon_ep: add heartbeat monitor Veerasenareddy Burru
2023-03-23 10:47   ` Leon Romanovsky
2023-03-23 18:14     ` [EXT] " Veerasenareddy Burru
2023-03-29  7:33       ` Leon Romanovsky

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=20230323103900.GC36557@unreal \
    --to=leon@kernel.org \
    --cc=aayarekar@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sburla@marvell.com \
    --cc=sedara@marvell.com \
    --cc=vburru@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).