From: Venkataramanan, Anirudh <anirudh.venkataramanan@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] intel: ice: Do not enable NAPI on q_vectors that have no rings
Date: Thu, 29 Nov 2018 16:57:29 +0000 [thread overview]
Message-ID: <1543510648.15106.13.camel@intel.com> (raw)
In-Reply-To: <HK0PR01MB21630071FC7DAA5B3189A40EADD20@HK0PR01MB2163.apcprd01.prod.exchangelabs.com>
On Thu, 2018-11-29 at 01:54 +0000, Yang Xiao wrote:
> From: Young Xiao <YangX92@hotmail.com>
>
> If ice driver has q_vectors w/ active NAPI that has no rings,
> then this will result in a divide by zero error. To correct it
> I am updating the driver code so that we only support NAPI on
> q_vectors that have 1 or more rings allocated to them.
>
> See commit 13a8cd191a2b ("i40e: Do not enable NAPI on q_vectors
> that have no rings") for detail.
>
> Signed-off-by: Young Xiao <YangX92@hotmail.com>
> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c
> b/drivers/net/ethernet/intel/ice/ice_main.c
> index 333312a..9450004 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -2563,8 +2563,12 @@ static void ice_napi_enable_all(struct ice_vsi
> *vsi)
> if (!vsi->netdev)
> return;
>
> - for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++)
> - napi_enable(&vsi->q_vectors[q_idx]->napi);
> + for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
> + struct ice_q_vector *q_vector = vsi-
> >q_vectors[q_idx];
> +
> + if (q_vector->rx.ring || q_vector->tx.ring)
> + napi_enable(&q_vector->napi);
> + }
> }
>
> /**
> @@ -2931,8 +2935,12 @@ static void ice_napi_disable_all(struct
> ice_vsi *vsi)
> if (!vsi->netdev)
> return;
>
> - for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++)
> - napi_disable(&vsi->q_vectors[q_idx]->napi);
> + for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
> + struct ice_q_vector *q_vector = vsi-
> >q_vectors[q_idx];
> +
> + if (q_vector->rx.ring || q_vector->tx.ring)
> + napi_disable(&q_vector->napi);
> + }
> }
>
> /**
Acked-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Thanks for the patch, Yang!
- Ani
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3302 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20181129/16e1b1f6/attachment-0001.bin>
WARNING: multiple messages have this Message-ID (diff)
From: "Venkataramanan, Anirudh" <anirudh.venkataramanan@intel.com>
To: "davem@davemloft.net" <davem@davemloft.net>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
"YangX92@hotmail.com" <YangX92@hotmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH] intel: ice: Do not enable NAPI on q_vectors that have no rings
Date: Thu, 29 Nov 2018 16:57:29 +0000 [thread overview]
Message-ID: <1543510648.15106.13.camel@intel.com> (raw)
In-Reply-To: <HK0PR01MB21630071FC7DAA5B3189A40EADD20@HK0PR01MB2163.apcprd01.prod.exchangelabs.com>
[-- Attachment #1: Type: text/plain, Size: 1949 bytes --]
On Thu, 2018-11-29 at 01:54 +0000, Yang Xiao wrote:
> From: Young Xiao <YangX92@hotmail.com>
>
> If ice driver has q_vectors w/ active NAPI that has no rings,
> then this will result in a divide by zero error. To correct it
> I am updating the driver code so that we only support NAPI on
> q_vectors that have 1 or more rings allocated to them.
>
> See commit 13a8cd191a2b ("i40e: Do not enable NAPI on q_vectors
> that have no rings") for detail.
>
> Signed-off-by: Young Xiao <YangX92@hotmail.com>
> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c
> b/drivers/net/ethernet/intel/ice/ice_main.c
> index 333312a..9450004 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -2563,8 +2563,12 @@ static void ice_napi_enable_all(struct ice_vsi
> *vsi)
> if (!vsi->netdev)
> return;
>
> - for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++)
> - napi_enable(&vsi->q_vectors[q_idx]->napi);
> + for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
> + struct ice_q_vector *q_vector = vsi-
> >q_vectors[q_idx];
> +
> + if (q_vector->rx.ring || q_vector->tx.ring)
> + napi_enable(&q_vector->napi);
> + }
> }
>
> /**
> @@ -2931,8 +2935,12 @@ static void ice_napi_disable_all(struct
> ice_vsi *vsi)
> if (!vsi->netdev)
> return;
>
> - for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++)
> - napi_disable(&vsi->q_vectors[q_idx]->napi);
> + for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
> + struct ice_q_vector *q_vector = vsi-
> >q_vectors[q_idx];
> +
> + if (q_vector->rx.ring || q_vector->tx.ring)
> + napi_disable(&q_vector->napi);
> + }
> }
>
> /**
Acked-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Thanks for the patch, Yang!
- Ani
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3302 bytes --]
next prev parent reply other threads:[~2018-11-29 16:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 1:54 [Intel-wired-lan] [PATCH] intel: ice: Do not enable NAPI on q_vectors that have no rings Yang Xiao
2018-11-29 16:57 ` Venkataramanan, Anirudh [this message]
2018-11-29 16:57 ` Venkataramanan, Anirudh
2018-12-04 17:01 ` Bowers, AndrewX
2018-12-04 17:01 ` Bowers, AndrewX
-- strict thread matches above, loose matches on Subject: below --
2018-11-28 12:24 [Intel-wired-lan] " Yang Xiao
2018-11-28 19:43 ` Jeff Kirsher
2018-11-29 1:52 ` Yang Xiao
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=1543510648.15106.13.camel@intel.com \
--to=anirudh.venkataramanan@intel.com \
--cc=intel-wired-lan@osuosl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.