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: <MN0PR21MB34378EC0697BCDCE76FFA429CA8BA@MN0PR21MB3437.namprd21.prod.outlook.com> Date: Thu, 8 May 2025 16:20:54 +0000 From: Haiyang Zhang <haiyangz@...rosoft.com> To: Shradha Gupta <shradhagupta@...ux.microsoft.com> CC: "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>, Dexuan Cui <decui@...rosoft.com>, "stephen@...workplumber.org" <stephen@...workplumber.org>, KY Srinivasan <kys@...rosoft.com>, Paul Rosswurm <paulros@...rosoft.com>, "olaf@...fle.de" <olaf@...fle.de>, "vkuznets@...hat.com" <vkuznets@...hat.com>, "davem@...emloft.net" <davem@...emloft.net>, "wei.liu@...nel.org" <wei.liu@...nel.org>, "edumazet@...gle.com" <edumazet@...gle.com>, "kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>, "leon@...nel.org" <leon@...nel.org>, Long Li <longli@...rosoft.com>, "ssengar@...ux.microsoft.com" <ssengar@...ux.microsoft.com>, "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>, "daniel@...earbox.net" <daniel@...earbox.net>, "john.fastabend@...il.com" <john.fastabend@...il.com>, "bpf@...r.kernel.org" <bpf@...r.kernel.org>, "ast@...nel.org" <ast@...nel.org>, "hawk@...nel.org" <hawk@...nel.org>, "tglx@...utronix.de" <tglx@...utronix.de>, "andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org> Subject: RE: [PATCH net-next] net: mana: Add handler for hardware servicing events > -----Original Message----- > From: Shradha Gupta <shradhagupta@...ux.microsoft.com> > Sent: Thursday, May 8, 2025 5:29 AM > To: Haiyang Zhang <haiyangz@...rosoft.com> > Cc: linux-hyperv@...r.kernel.org; netdev@...r.kernel.org; Dexuan Cui > <decui@...rosoft.com>; stephen@...workplumber.org; KY Srinivasan > <kys@...rosoft.com>; Paul Rosswurm <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; Long Li <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; > andrew+netdev@...n.ch; linux-kernel@...r.kernel.org > Subject: Re: [PATCH net-next] net: mana: Add handler for hardware > servicing events > > On Wed, May 07, 2025 at 08:58:39AM -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> > > --- > > .../net/ethernet/microsoft/mana/gdma_main.c | 61 +++++++++++++++++++ > > include/net/mana/gdma.h | 5 +- > > 2 files changed, 65 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c > b/drivers/net/ethernet/microsoft/mana/gdma_main.c > > index 4ffaf7588885..aa2ccf4d0ec6 100644 > > --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c > > +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c > > @@ -352,11 +352,52 @@ void mana_gd_ring_cq(struct gdma_queue *cq, u8 > arm_bit) > > } > > EXPORT_SYMBOL_NS(mana_gd_ring_cq, "NET_MANA"); > > > > +#define MANA_SERVICE_PERIOD 10 > > + > > +struct mana_serv_work { > > + struct work_struct serv_work; > > + struct pci_dev *pdev; > > +}; > > + > > +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; > > + > > + if (!pdev) > > + goto out; > > + > > + bus = pdev->bus; > > + if (!bus) { > > + dev_err(&pdev->dev, "MANA service: no bus\n"); > > + goto out; > > + } > > + > > + parent = bus->parent; > > + if (!parent) { > > + dev_err(&pdev->dev, "MANA service: no parent bus\n"); > > + goto out; > > + } > > + > > + pci_stop_and_remove_bus_device_locked(bus->self); > > + > > + msleep(MANA_SERVICE_PERIOD * 1000); > > + > > + pci_lock_rescan_remove(); > > + pci_rescan_bus(parent); > > + pci_unlock_rescan_remove(); > > + > > +out: > > + kfree(mns_wk); > > Shouldn't gc->in_service be set to false again? > > > +} > > + > > static void mana_gd_process_eqe(struct gdma_queue *eq) > > { > > u32 head = eq->head % (eq->queue_size / GDMA_EQE_SIZE); > > struct gdma_context *gc = eq->gdma_dev->gdma_context; > > struct gdma_eqe *eq_eqe_ptr = eq->queue_mem_ptr; > > + struct mana_serv_work *mns_wk; > > union gdma_eqe_info eqe_info; > > enum gdma_eqe_type type; > > struct gdma_event event; > > @@ -400,6 +441,26 @@ 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: > > may be we also add a log(dev_dbg) to indicate if the servicing is for > FPGA reconfig or socmana crash. Thanks, I will add this. - Haiyang
Powered by blists - more mailing lists