Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1615261pxb; Mon, 11 Oct 2021 09:32:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtTb6YH3e5qlUkgPjPOH7N1aMoCbjRUc40KCJkm7h6FEKWs5f78T8cje63+DrmK3gOhtEv X-Received: by 2002:a17:907:7703:: with SMTP id kw3mr26471105ejc.34.1633969926530; Mon, 11 Oct 2021 09:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969926; cv=none; d=google.com; s=arc-20160816; b=oBYns91AVy0Po+DCIdk4teK6B7MfJeh10UQswiuwE/U4YzpFPRPYoem/H9r3HYxePe GZedLrbnhgaMUTw2SpAt1+d3XJGONGzgBcaSg82QatOiNXUcrvJ7hFYqauGiV+4lXHxv IDKyihT+MqQ0n4fpHs2zkWEt/ijaKaF4U65i6ID9FZRrxtNaQj1uXCsXbs+CWFS3QTQi owz2+N8WO+s5sMrJ8HjumK/3jKD9fXP7zycRo7WkplpNzIl1HcYZGvbWtK2ua7dmaTcC XfDquf7V1DmfNMaowRAaryv3V6d5M12p7x7DYH9xXmxpROXH3Q6u3Y9px9YrYOuX6Ju9 Bi3A== 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=/E4w7/zHagM04VrkCxUU/gY7Z0S9MYo9uTupMvx9hKI=; b=XnwxRXakYwg6oU+e+1259EpLPivuW7mKfTAzTjEEfQWbpN/OlJdaYeke2EDjrcySk5 ifxWUHUyB64FKukOQH+HIsFvbEXJYMg38lXTOjWzwXOVxWfqlOrM8/MAp6cHlVeZc6b7 tmNqzZcPjsAu9CQUyP5DEdjIBEV0p6JKeip1Qrr1GUNyuu/kD5oAkIBLU7eXlJYK3SoN +1CipYsnsH2mUpwKyF7dnuOT8gUGD39HSpgCqbAjXUMZJvJ8L9DhYMyqqBzVWPLAn/xS ue4/S2tCF/ISO7TzA/MOl/58JGAD7FM3ZccdkgDlhwxSxo74M/1Xfh7yvbMoVVrdL8Ge txxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kdkoRxx4; 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 f5si11910297ejj.789.2021.10.11.09.31.43; Mon, 11 Oct 2021 09:32:06 -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=kdkoRxx4; 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 S236873AbhJKN7N (ORCPT + 99 others); Mon, 11 Oct 2021 09:59:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:40964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237131AbhJKN5F (ORCPT ); Mon, 11 Oct 2021 09:57:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 876DB60F6E; Mon, 11 Oct 2021 13:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960436; bh=wlfZdwYdVAsEA6R9GQFkDQmZUOzjedhFrxJLH4Ar3g4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kdkoRxx40dVz3UgQauk1TSSfFYUtUAyJdy3yNy48JiE1BubSLr6pxJ5C9TXvG3XTg pZtZmW8mshbGGS9DzydtL6df0irjROMPJn3LNjs0z+/ysP/Df5CeDTlAj38JmGLxXh 5CUu0Vbq7N9VK9b+w71ze9RquD97prICU5UvQrWo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Catherine Sullivan , Jeroen de Borst , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 59/83] gve: Correct available tx qpl check Date: Mon, 11 Oct 2021 15:46:19 +0200 Message-Id: <20211011134510.429075159@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@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: Catherine Sullivan [ Upstream commit d03477ee10f4bc35d3573cf1823814378ef2dca2 ] The qpl_map_size is rounded up to a multiple of sizeof(long), but the number of qpls doesn't have to be. Fixes: f5cedc84a30d2 ("gve: Add transmit and receive support") Signed-off-by: Catherine Sullivan Signed-off-by: Jeroen de Borst Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/google/gve/gve.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h index f5c80229ea96..cfb174624d4e 100644 --- a/drivers/net/ethernet/google/gve/gve.h +++ b/drivers/net/ethernet/google/gve/gve.h @@ -472,7 +472,7 @@ struct gve_queue_page_list *gve_assign_rx_qpl(struct gve_priv *priv) gve_num_tx_qpls(priv)); /* we are out of rx qpls */ - if (id == priv->qpl_cfg.qpl_map_size) + if (id == gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv)) return NULL; set_bit(id, priv->qpl_cfg.qpl_id_map); -- 2.33.0