Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2753969imj; Mon, 11 Feb 2019 08:00:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IbJ9/WLJSB06+u7bIM1p69Qh0vepmKL7GkwmPWxTABvpNi+eLOjWIHd7QGB4aLfnMJaiFML X-Received: by 2002:a17:902:b101:: with SMTP id q1mr37970135plr.135.1549900835220; Mon, 11 Feb 2019 08:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900835; cv=none; d=google.com; s=arc-20160816; b=Ch88XcQvPXNP8NZ5YBTW+35jpBCTTY761jK2iUCvjrIjzpOeQOGOwerokfPROV4Mx4 xtBn04fIXdcI9S4jfoNHq11jpCz8GR490Ew+b6lP4zfklRJeg/IMkX+mQ0ElZ8fj6Wce PBJOtSfRO6b932cToBEFfC6uqcpWRGOq9dbC/nyIFUT3p7LPxE61m9gq6wpuIYi3Tgkf d+jETk8Lo7GgzOcCxJ4Qam2p7UtYYU+K3YmH/0i0FAAaaAcx9gggoL9ZCsKbSuQAguJD pOqQgl8wGjpBSaoASpzK8THRr9iyM1+5BhVQttOzxbZbJHYY7nlkXlVFnEznEbif8rIA MJBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JOUNH6kNg3PpVzCnF1JPMfBqxG9hq9SArzaa9J9LzSQ=; b=yUYktAsZr3wDizqma+8lOuSqStY35NsYKrn8/fJtt8y8CFmjmLN21VZ/E/eGLBvziU /H/bS7sPwg/LryKV47pWUcrAprL34+509qce86jCivjRsp4GJsKhkAfrp21/cgSToFOL gDSZmILxx8FIYOCrgSPJXWIxGcW+EE0G+E0PFwiqoxTSuVMtVek/lsFEgku/gGvMgyXh p8y4wMchWZfuQBX/Ib2ydaJz9zYH2AjSaKX7ILRBK8OXY5pUue1vPngUjn1Xmb+wp1n1 le529TVxnEHo79jhmVyOcbu9WCOo0uS2gbiC1UN3JkR/kXrJleLrRainm/Yuy3LNgqyI /mSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KCo/y9zS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si10423387pgn.32.2019.02.11.08.00.16; Mon, 11 Feb 2019 08:00:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KCo/y9zS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730906AbfBKP7Y (ORCPT + 99 others); Mon, 11 Feb 2019 10:59:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:39534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730114AbfBKOcO (ORCPT ); Mon, 11 Feb 2019 09:32:14 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C3FB220844; Mon, 11 Feb 2019 14:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895534; bh=Ng5fQiYRJ9rOSbXvdo++/Wm9yyWJHyKEqRr0lHD+mYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KCo/y9zSZnGYUho5MA2Y9ZbfDd53FMgw97sd+eNEFy0hhSrf1TtXur2dm9OF2jHtS OQKccnO1Efe3VAdI2KtjG9+wYTiFYvUrTmjnZ1RBLJw5ZGMDy6yek+9vwN2cFjIIUI qDiuadGBvUp5PwQ+xH9uvIpoabsfrIFCLKMCUU4Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Young Xiao , Anirudh Venkataramanan , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.20 236/352] ice: Do not enable NAPI on q_vectors that have no rings Date: Mon, 11 Feb 2019 15:17:43 +0100 Message-Id: <20190211141902.197408152@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit eec903769b4ea476591ffff73bb7359f14f38c51 ] 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 Acked-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- 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 333312a1d595..945000449279 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); + } } /** -- 2.19.1