Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp916201pxb; Wed, 1 Sep 2021 12:36:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKQjOOR3FacfGRmsC3jS6bjEIW9yAz1LZ8OteXcaimDADnqzzFMnbLCWUMAtXdZppcooBI X-Received: by 2002:a05:6638:4122:: with SMTP id ay34mr1054611jab.131.1630524981934; Wed, 01 Sep 2021 12:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630524981; cv=none; d=google.com; s=arc-20160816; b=GaSKO8FQPozmOqYm4HdSoTpI8oUlHiDNrIYz8e6BTZfyjyhnEtMpqPghcdkLGgVm/1 T/XK1ZiJTtLvcQkKwdSi1OarJsQwUq8vVSYBCK/RwQ7jnkXj7w+Pq5BgINq0V68qRdjg coyyJA0uhoPgoaBWJARMHqTin9WHBxh+WkXmhYg3Va0TqTRxtzD+ngVobr1rMUtWuVuC fbeyjUTweEuPPnHZwtwBLYrO14Jwxvbpv4p5to1/SGjA89589JPQpU7tt66kCUUn2REd hrPwSjnO+FZ4MvOGdJztqzvBO7ZI5nUjykbIRXqoXCNZHNmAo5jH7vtuvVy20rgYSOkX F21g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oruyWkv7t85Tq83yiqfAlsc4EUG7LwxP7WtaIXBHB6Q=; b=EeAWVpZy026YnALmHnwHrq7Le95T3siEUiXaWY2QqHQRbmXlaouHOMLaShDGFvDwT9 fGDXSGDukVQnKqo1PuphBqJmVBOF9jI+eBbrhX+iuofQSKG79t32FdlX2rvxDSpVzbAx kMvco+88RIBwJaTHh94+wvwRLZllr6Ux6iICBKvZeiOHAMiQULdrGy+cEypFdR74TT9F coIMvxzpbluQnzzx9+t5Nu4xshcCx6dGELqkTer0LDYMsL5zq+3XzS3ZJq5/Y8ETh6Bf sDGvdVy5IHmdmpfPto5vQ9gyE3w0NzU2wzFdYI7Gj8TZtSHbgiAqyseANOyBejTjhwFf JOGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NnWD//nS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si500907ilg.86.2021.09.01.12.36.09; Wed, 01 Sep 2021 12:36:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NnWD//nS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344465AbhIAMmq (ORCPT + 99 others); Wed, 1 Sep 2021 08:42:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:43102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344592AbhIAMjm (ORCPT ); Wed, 1 Sep 2021 08:39:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9870C61179; Wed, 1 Sep 2021 12:35:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630499728; bh=Xds0caNBGsvrEbSX4KgRyhhNwjd2j0kw4FUUFbk0lEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NnWD//nSo+tYJLgBbPCW67QDRRbj4kz9bqoAqlxyS6g92a3HvidEz4w6rhkGU39IF CJZ2JKuxYcS1Qd5GQUv/bsw4NwEpJMJwt2riVZrAa2gk5S1Kzw4WYym608AbS4dzCx nU3OSvQrz+Z7SqlYszQw2XwOPbf5Clcnc2DzW8bQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Toshiki Nishioka , Muhammad Husaini Zulkifli , Sasha Neftin , Tony Nguyen , Sasha Levin Subject: [PATCH 5.10 029/103] igc: Use num_tx_queues when iterating over tx_ring queue Date: Wed, 1 Sep 2021 14:27:39 +0200 Message-Id: <20210901122301.534031704@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210901122300.503008474@linuxfoundation.org> References: <20210901122300.503008474@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Toshiki Nishioka [ Upstream commit 691bd4d7761992914a0e83c27a4ce57d01474cda ] Use num_tx_queues rather than the IGC_MAX_TX_QUEUES fixed number 4 when iterating over tx_ring queue since instantiated queue count could be less than 4 where on-line cpu count is less than 4. Fixes: ec50a9d437f0 ("igc: Add support for taprio offloading") Signed-off-by: Toshiki Nishioka Signed-off-by: Muhammad Husaini Zulkifli Tested-by: Muhammad Husaini Zulkifli Acked-by: Sasha Neftin Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igc/igc_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 66f181d12578..013dd2955381 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -4761,7 +4761,7 @@ static bool validate_schedule(struct igc_adapter *adapter, if (e->command != TC_TAPRIO_CMD_SET_GATES) return false; - for (i = 0; i < IGC_MAX_TX_QUEUES; i++) { + for (i = 0; i < adapter->num_tx_queues; i++) { if (e->gate_mask & BIT(i)) queue_uses[i]++; @@ -4818,7 +4818,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter, end_time += e->interval; - for (i = 0; i < IGC_MAX_TX_QUEUES; i++) { + for (i = 0; i < adapter->num_tx_queues; i++) { struct igc_ring *ring = adapter->tx_ring[i]; if (!(e->gate_mask & BIT(i))) -- 2.30.2