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]
Date:   Thu, 23 Mar 2023 17:24:55 +0000
From:   Veerasenareddy Burru <vburru@...vell.com>
To:     Leon Romanovsky <leon@...nel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Abhijit Ayarekar <aayarekar@...vell.com>,
        Sathesh B Edara <sedara@...vell.com>,
        Satananda Burla <sburla@...vell.com>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Subject: RE: [EXT] Re: [PATCH net-next v4 6/8] octeon_ep: support asynchronous
 notifications



> -----Original Message-----
> From: Leon Romanovsky <leon@...nel.org>
> Sent: Thursday, March 23, 2023 3:39 AM
> To: Veerasenareddy Burru <vburru@...vell.com>
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; Abhijit Ayarekar
> <aayarekar@...vell.com>; Sathesh B Edara <sedara@...vell.com>;
> Satananda Burla <sburla@...vell.com>; linux-doc@...r.kernel.org; David S.
> Miller <davem@...emloft.net>; Eric Dumazet <edumazet@...gle.com>;
> Jakub Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>
> Subject: [EXT] Re: [PATCH net-next v4 6/8] octeon_ep: support
> asynchronous notifications
> 
> External Email
> 
> ----------------------------------------------------------------------
> 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@...vell.com>
> > Signed-off-by: Abhijit Ayarekar <aayarekar@...vell.com>
> > ---
> > v3 -> v4:
> >  * 0005-xxx.patch in v3 is 0006-xxx.patch in v4.
> >  * addressed review comments
> >    https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__lore.kernel.org_all_Y-2B0J94sowllCe5Gs-
> 40boxer_&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=XkP_75lnbPIeeucsP
> X36ZgjiMqEKttwZfwNyWMCLjT0&m=5CnsD-
> SX6ZoW98szwM0k4IXgNC3wY0EwCQHxDKGyNIRUJxdaNe3zorLcOhc9iU6d&s
> =k73McQSsjbjj87VbCCB8EFFtGWtksMIGhn15RK12XF8&e=
> >    - 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

Thanks for the kind feedback.
I do not see netif_carrier_on/off require any protection. I referred few other drivers and do not see such protection used for carrier on/off.
Please suggest if I am missing something here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ