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
| ||
|
Message-ID: <20250512141546.GI3339421@horms.kernel.org> Date: Mon, 12 May 2025 15:15:46 +0100 From: Simon Horman <horms@...nel.org> To: Haiyang Zhang <haiyangz@...rosoft.com> Cc: linux-hyperv@...r.kernel.org, netdev@...r.kernel.org, decui@...rosoft.com, stephen@...workplumber.org, kys@...rosoft.com, paulros@...rosoft.com, olaf@...fle.de, vkuznets@...hat.com, davem@...emloft.net, wei.liu@...nel.org, edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com, leon@...nel.org, longli@...rosoft.com, ssengar@...ux.microsoft.com, linux-rdma@...r.kernel.org, daniel@...earbox.net, john.fastabend@...il.com, bpf@...r.kernel.org, ast@...nel.org, hawk@...nel.org, tglx@...utronix.de, shradhagupta@...ux.microsoft.com, andrew+netdev@...n.ch, linux-kernel@...r.kernel.org Subject: Re: [PATCH net-next,v2] net: mana: Add handler for hardware servicing events On Fri, May 09, 2025 at 04:16:43PM -0700, Haiyang Zhang wrote: > To collaborate with hardware servicing events, upon receiving the special > EQE notification from the HW channel, remove the devices on this bus. > Then, after a waiting period based on the device specs, rescan the parent > bus to recover the devices. > > Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.com> > --- > v2: > Added dev_dbg for service type as suggested by Shradha Gupta. > Added driver cap bit. > > --- > .../net/ethernet/microsoft/mana/gdma_main.c | 63 +++++++++++++++++++ > include/net/mana/gdma.h | 11 +++- > 2 files changed, 72 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c ... > +static void mana_serv_func(struct work_struct *w) > +{ > + struct mana_serv_work *mns_wk = container_of(w, struct mana_serv_work, serv_work); > + struct pci_dev *pdev = mns_wk->pdev; > + struct pci_bus *bus, *parent; Please avoid lines wider than 80 columns in Networking code. In this case I would suggest separating the declaration and initialisation of mns_wk and pdev. Something like this (completely untested!): struct mana_serv_work *mns_wk; struct pci_bus *bus, *parent; struct pci_dev *pdev; mns_wk = container_of(w, struct mana_serv_work, serv_work); pdev = mns_wk->pdev; ... > @@ -400,6 +441,28 @@ static void mana_gd_process_eqe(struct gdma_queue *eq) > eq->eq.callback(eq->eq.context, eq, &event); > break; > > + case GDMA_EQE_HWC_FPGA_RECONFIG: > + case GDMA_EQE_HWC_SOCMANA_CRASH: > + dev_dbg(gc->dev, "Recv MANA service type:%d\n", type); > + > + if (gc->in_service) { > + dev_info(gc->dev, "Already in service\n"); > + break; > + } > + > + mns_wk = kzalloc(sizeof(*mns_wk), GFP_ATOMIC); > + if (!mns_wk) { > + dev_err(gc->dev, "Fail to alloc mana_serv_work\n"); The memory allocator will log a message on error. So please don't also do so here. > + break; > + } > + > + dev_info(gc->dev, "Start MANA service type:%d\n", type); > + gc->in_service = true; > + mns_wk->pdev = to_pci_dev(gc->dev); > + INIT_WORK(&mns_wk->serv_work, mana_serv_func); > + schedule_work(&mns_wk->serv_work); > + break; > + > default: > break; > } ... -- pw-bot: changes-requested
Powered by blists - more mailing lists