Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2930627iog; Mon, 20 Jun 2022 07:43:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tlUaL4EXlNZXGL287XgaIfB2PxDYX4p2tUWBjEZi7GfPkL8RzVxboIw45pzh+79nB3bGfC X-Received: by 2002:a17:902:a706:b0:16a:13c6:69ca with SMTP id w6-20020a170902a70600b0016a13c669camr11128386plq.171.1655736219270; Mon, 20 Jun 2022 07:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736219; cv=none; d=google.com; s=arc-20160816; b=XZ6e7fWrs6jH9kf+ndcAL5IhGxT30ELA3m/ebNuNlOz9/liRqDIkcE+sI49ICN/UMo hDjmTWAY7Cuu9Y34orG8rMmUl0TYGZupl4q8JwjQmpygO1cSQ4z4wxYjy0f5VPJ8SAXh sSUwwXd+WnAe0Tt0dl3d0RnRKD+JExSvaf8Cdp8vj/iWPvpB7bP7UyTmuP5qYossJbAl H5pd73kydV7uPtZeJUR5Eimyl+bqlzhQ4RMXvbkLv8uOW43W+KSiT3ixMlWtoNjAmwKj eUz6XpccqP1SLc5w5j0QkbZ3fPO3zCBtce/bImgFvEm/UvAK97jTAi2pBkmEEYS+BkFR +ZZA== 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=6DHoESOP74moXzUpC3F7Ldk8FY6WoZGZrbtjn/Obc98=; b=mBCm3+tlR4i9x3fQLn/ADd/wh8SdH4SATb49x6EKhA8vZ4zoPt98aKZg99BDBbaFGh Bfg5hWPDhq6QpnK6UClN6zwZRKL2ja4GMSoVE48x42VgL2efFPug/Gj23b9aswjR8bRQ ecZIXCpW4YmICvhXSbEnWf6ra0jm47CPpyEWBq1i0gvdtg0N4H78Tq2QQnhUdAwmEVJj C3+BV7+g9fxiVGAVsSSzeQ6AtrAqJWwF7nUV+DnRi2lzsCmM2dc9JHtc3aC4ACfsOIja dnjijcJfnkcXmFU8hLyVUhuYJj4INphb0csjhhBCYCAKPqdDk4X2okqj+Pc7dkVysYqL VQtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dHOcrgUk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p7-20020a63ab07000000b003fc4a3b9fbesi4884211pgf.818.2022.06.20.07.43.26; Mon, 20 Jun 2022 07:43:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dHOcrgUk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1348633AbiFTOE6 (ORCPT + 99 others); Mon, 20 Jun 2022 10:04:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345720AbiFTNy6 (ORCPT ); Mon, 20 Jun 2022 09:54:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5324E33377; Mon, 20 Jun 2022 06:21:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F025260FAD; Mon, 20 Jun 2022 13:21:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B567C3411C; Mon, 20 Jun 2022 13:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655731270; bh=pHNUnVvFxgMHHtqeEJJweemAidY0jWCuaaOGMSlY6nc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dHOcrgUkLM412kNSseX+x2U9boFmdJvJC5HhuUnyC2peWUXkEXeIkLXpp9aB479T1 2dwcajL6pVZSRTaNass4Hy77x5pJYFJ5mNUOCis1FMZYqY5GWqR/5JP00VZ6w+Eskc Qlc6V8uK8PkLADISKJYUfFGH56GN5V3s93CResOs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grzegorz Szczurek , Jedrzej Jagielski , Bharathi Sreenivas , Tony Nguyen , Sasha Levin Subject: [PATCH 5.4 208/240] i40e: Fix calculating the number of queue pairs Date: Mon, 20 Jun 2022 14:51:49 +0200 Message-Id: <20220620124745.007503488@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Grzegorz Szczurek [ Upstream commit 0bb050670ac90a167ecfa3f9590f92966c9a3677 ] If ADQ is enabled for a VF, then actual number of queue pair is a number of currently available traffic classes for this VF. Without this change the configuration of the Rx/Tx queues fails with error. Fixes: d29e0d233e0d ("i40e: missing input validation on VF message handling by the PF") Signed-off-by: Grzegorz Szczurek Signed-off-by: Jedrzej Jagielski Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index 4962e6193eec..4080fdacca4c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -2149,7 +2149,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) } if (vf->adq_enabled) { - for (i = 0; i < I40E_MAX_VF_VSI; i++) + for (i = 0; i < vf->num_tc; i++) num_qps_all += vf->ch[i].num_qps; if (num_qps_all != qci->num_queue_pairs) { aq_ret = I40E_ERR_PARAM; -- 2.35.1