From: Haiyang Zhang <haiyangz@microsoft.com>
To: Andrew Lunn <andrew@lunn.ch>, Dexuan Cui <decui@microsoft.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
KY Srinivasan <kys@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
Wei Liu <liuwe@microsoft.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"leon@kernel.org" <leon@kernel.org>,
"bernd@petrovitsch.priv.at" <bernd@petrovitsch.priv.at>,
"rdunlap@infradead.org" <rdunlap@infradead.org>,
Shachar Raindel <shacharr@microsoft.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Subject: RE: [PATCH v4 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)
Date: Mon, 12 Apr 2021 14:39:37 +0000 [thread overview]
Message-ID: <BL0PR2101MB0930AC7E5299EF713821FC76CA709@BL0PR2101MB0930.namprd21.prod.outlook.com> (raw)
In-Reply-To: <YHQ9wBFbjpRIj45k@lunn.ch>
> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Monday, April 12, 2021 8:32 AM
> To: Dexuan Cui <decui@microsoft.com>
> Cc: davem@davemloft.net; kuba@kernel.org; KY Srinivasan
> <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Stephen
> Hemminger <sthemmin@microsoft.com>; wei.liu@kernel.org; Wei Liu
> <liuwe@microsoft.com>; netdev@vger.kernel.org; leon@kernel.org;
> bernd@petrovitsch.priv.at; rdunlap@infradead.org; Shachar Raindel
> <shacharr@microsoft.com>; linux-kernel@vger.kernel.org; linux-
> hyperv@vger.kernel.org
> Subject: Re: [PATCH v4 net-next] net: mana: Add a driver for Microsoft Azure
> Network Adapter (MANA)
>
> > +static void mana_gd_deregiser_irq(struct gdma_queue *queue) {
> > + struct gdma_dev *gd = queue->gdma_dev;
> > + struct gdma_irq_context *gic;
> > + struct gdma_context *gc;
> > + struct gdma_resource *r;
> > + unsigned int msix_index;
> > + unsigned long flags;
> > +
> > + /* At most num_online_cpus() + 1 interrupts are used. */
> > + msix_index = queue->eq.msix_index;
> > + if (WARN_ON(msix_index > num_online_cpus()))
> > + return;
>
> Do you handle hot{un}plug of CPUs?
We don't have hot{un}plug of CPU feature yet.
>
> > +static void mana_hwc_init_event_handler(void *ctx, struct gdma_queue
> *q_self,
> > + struct gdma_event *event)
> > +{
> > + struct hw_channel_context *hwc = ctx;
> > + struct gdma_dev *gd = hwc->gdma_dev;
> > + union hwc_init_type_data type_data;
> > + union hwc_init_eq_id_db eq_db;
> > + u32 type, val;
> > +
> > + switch (event->type) {
> > + case GDMA_EQE_HWC_INIT_EQ_ID_DB:
> > + eq_db.as_uint32 = event->details[0];
> > + hwc->cq->gdma_eq->id = eq_db.eq_id;
> > + gd->doorbell = eq_db.doorbell;
> > + break;
> > +
> > + case GDMA_EQE_HWC_INIT_DATA:
> > +
> > + type_data.as_uint32 = event->details[0];
> > +
> > + case GDMA_EQE_HWC_INIT_DONE:
> > + complete(&hwc->hwc_init_eqe_comp);
> > + break;
>
> ...
>
> > + default:
> > + WARN_ON(1);
> > + break;
> > + }
>
> Are these events from the firmware? If you have newer firmware with an
> older driver, are you going to spam the kernel log with WARN_ON dumps?
For protocol version mismatch, the host and guest will either negotiate the
highest common version, or fail to probe. So this kind of warnings are not
expected.
>
> > +static int mana_move_wq_tail(struct gdma_queue *wq, u32 num_units) {
> > + u32 used_space_old;
> > + u32 used_space_new;
> > +
> > + used_space_old = wq->head - wq->tail;
> > + used_space_new = wq->head - (wq->tail + num_units);
> > +
> > + if (used_space_new > used_space_old) {
> > + WARN_ON(1);
> > + return -ERANGE;
> > + }
>
> You could replace the 1 by the condition. There are a couple of these.
Will do.
Thanks,
- Haiyang
next prev parent reply other threads:[~2021-04-12 14:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 2:34 [PATCH v4 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Dexuan Cui
2021-04-12 7:45 ` Leon Romanovsky
2021-04-12 8:35 ` Dexuan Cui
2021-04-12 8:52 ` Leon Romanovsky
2021-04-12 12:10 ` Andrew Lunn
2021-04-12 12:15 ` Andrew Lunn
2021-04-12 14:29 ` Haiyang Zhang
2021-04-12 12:32 ` Andrew Lunn
2021-04-12 14:39 ` Haiyang Zhang [this message]
2021-04-12 20:30 ` Dexuan Cui
2021-04-12 18:21 ` Jakub Kicinski
2021-04-12 20:43 ` Dexuan Cui
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=BL0PR2101MB0930AC7E5299EF713821FC76CA709@BL0PR2101MB0930.namprd21.prod.outlook.com \
--to=haiyangz@microsoft.com \
--cc=andrew@lunn.ch \
--cc=bernd@petrovitsch.priv.at \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuwe@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=shacharr@microsoft.com \
--cc=sthemmin@microsoft.com \
--cc=wei.liu@kernel.org \
/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).