Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp26269pxb; Tue, 12 Apr 2022 15:48:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymuZAM5w7aTPajS3wEL/bJafVLDEWTXIePPzAWcvoqxzR45PbL3xdqgfhcm4mnsWCw/Dz2 X-Received: by 2002:a17:902:c2d8:b0:154:b384:917b with SMTP id c24-20020a170902c2d800b00154b384917bmr40783889pla.58.1649803736123; Tue, 12 Apr 2022 15:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649803736; cv=none; d=google.com; s=arc-20160816; b=WSZ5rxg53748Jdm5mG0fHq40WMu4N2OHQu0EiX90fPolZAwJnAuJqqelK4zO9VnagU feJHMsqyvsU3+qHg/C+AAdi7LQChQeo+yuQNOxNeufXf8S4137u+3jpar45r3x4/Dizq NQE0AFIs9/iF1obzfWG3NjLvjHo72Pifbp1eIR1gDhHCOhQxqbyRLCf0OkHb9arKXzvQ 7MGlVx97+VnQsZgtXhPCXE/RPacYlb7sK+U3V9Dblv+dpRzKG+WPcSMFaEQDSJQLBoyU fmUbqlYvdLW8qYV3nz426HmmQAdWn/HppCoxq95FdzyCxNPQ1DHhSJXIoROXdX9n/O1i 3Aww== 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=8eGpEYxpzQKTimiDUJHU7ddb4GnA/MMkKpzpU88Crjk=; b=jYkrIH4x/Brjb2EULim3Lum7oZKWQ2+E+7dZBcuUHhkI6T/sJ2LEtHBAXKz1qvPCrF R4rav/G1lKTHuZfP7GhQ2FIDk7qj0D9X9w1RcFx6z5nEQfFnC/xX9yBfM/ZCk1u9WHch ie36UmTwkxOT13E6HVWQHlrh0kCmvr47vjs22TruYDoaMaDM8q5ke5XX1mEa/yI5jp5s GK+mgp0CTuytXsXnxhegpdnSSsOvV/457cP/+Jywfn8EFjTSJa4eJThpKGkirz0vJUs1 vo8EOfYTVQEhGABjXMMZuMk3jJNnMsznrca5KsvIs2g1Gn3M8Uqi9YhaPEYYKFTegqt8 q3eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SVS2fAVx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h4-20020a635304000000b003862123af5esi3866623pgb.712.2022.04.12.15.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:48:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SVS2fAVx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 63A8E1BE0D9; Tue, 12 Apr 2022 14:30:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238661AbiDLJN0 (ORCPT + 99 others); Tue, 12 Apr 2022 05:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358342AbiDLHl0 (ORCPT ); Tue, 12 Apr 2022 03:41:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CB271EC48; Tue, 12 Apr 2022 00:17:50 -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 9651F6153F; Tue, 12 Apr 2022 07:17:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99AF6C385C4; Tue, 12 Apr 2022 07:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649747869; bh=HROHGGsBFbO4vq3IAw5etvco6016oKrSMD4SXiABxIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SVS2fAVx69/TqZEzGnhu1FgOBCYOaAIsaTn4GWSIdLG6ckpw2ho56MdoxYznXaVwy 0IsdIxFyF/nIOXh61EkLqeFeIzXZwTzYSDHVakIIfyKf3ZICisex0xbEfunXbJYdHS +osTBlI8kJ0WFl1CisO7sXMRePpsKfEQPUAqfUPY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anatolii Gerasymenko , Maciej Fijalkowski , Konrad Jankowski , Alice Michael , Tony Nguyen , Paolo Abeni , Sasha Levin Subject: [PATCH 5.17 233/343] ice: Set txq_teid to ICE_INVAL_TEID on ring creation Date: Tue, 12 Apr 2022 08:30:51 +0200 Message-Id: <20220412062958.061361475@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062951.095765152@linuxfoundation.org> References: <20220412062951.095765152@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Anatolii Gerasymenko [ Upstream commit ccfee1822042b87e5135d33cad8ea353e64612d2 ] When VF is freshly created, but not brought up, ring->txq_teid value is by default set to 0. But 0 is a valid TEID. On some platforms the Root Node of Tx scheduler has a TEID = 0. This can cause issues as shown below. The proper way is to set ring->txq_teid to ICE_INVAL_TEID (0xFFFFFFFF). Testing Hints: echo 1 > /sys/class/net/ens785f0/device/sriov_numvfs ip link set dev ens785f0v0 up ip link set dev ens785f0v0 down If we have freshly created VF and quickly turn it on and off, so there would be no time to reach VIRTCHNL_OP_CONFIG_VSI_QUEUES stage, then VIRTCHNL_OP_DISABLE_QUEUES stage will fail with error: [ 639.531454] disable queue 89 failed 14 [ 639.532233] Failed to disable LAN Tx queues, error: ICE_ERR_AQ_ERROR [ 639.533107] ice 0000:02:00.0: Failed to stop Tx ring 0 on VSI 5 The reason for the fail is that we are trying to send AQ command to delete queue 89, which has never been created and receive an "invalid argument" error from firmware. As this queue has never been created, it's teid and ring->txq_teid have default value 0. ice_dis_vsi_txq has a check against non-existent queues: node = ice_sched_find_node_by_teid(pi->root, q_teids[i]); if (!node) continue; But on some platforms the Root Node of Tx scheduler has a teid = 0. Hence, ice_sched_find_node_by_teid finds a node with teid = 0 (it is pi->root), and we go further to submit an erroneous request to firmware. Fixes: 37bb83901286 ("ice: Move common functions out of ice_main.c part 7/7") Signed-off-by: Anatolii Gerasymenko Reviewed-by: Maciej Fijalkowski Tested-by: Konrad Jankowski Signed-off-by: Alice Michael Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 20d755822d43..5fd2bbeab2d1 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -1452,6 +1452,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi) ring->tx_tstamps = &pf->ptp.port.tx; ring->dev = dev; ring->count = vsi->num_tx_desc; + ring->txq_teid = ICE_INVAL_TEID; WRITE_ONCE(vsi->tx_rings[i], ring); } -- 2.35.1