Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2491794pxj; Mon, 10 May 2021 04:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwgjICaAlNyjRZL4KY8yQgSO2gV0qG+MsVs+iY1u9x38HAfiEuzGqWUvSGAEdsKbws6Hcg X-Received: by 2002:a05:6402:1d8e:: with SMTP id dk14mr23861149edb.385.1620645840610; Mon, 10 May 2021 04:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645840; cv=none; d=google.com; s=arc-20160816; b=DanTxyy+qAwS5MT1rKwQQpw/ODSy811tKsw6vftJF0FvLn7MgwEXwR65Od496jdGgm odxpXfzvgSz01z4dhTe2t0WTO48dkrG35+K+UtHThx2LbRHKT5Eo8fHbXo8E1gMCF2Wd YafZ7HTRs2bIVzTN2rfnDuMpKmR5fUgWHNa+aJxceuqQhop/vEqCHe8ZIPzughARXIuy t0Dmml5LK+UB2Qz+3UNoWPzA53Q4EF5mBKcryLnn7/yninoIYiDdFmeaTWhbmCtzT6Ja 6422Ewki9MLm2Y/O14CPz8tJz5i1MvcdMgWszOXcJl5YA/eV64OOQQ/Ck5OcreJgEEzw 29HQ== 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=2SYrwNynSoKma+73orY5b1FFSVfpxskYDiqTlENFIgM=; b=CuUxc/roP1Li1b+8Wg1wRycDn91UHsG6rDwd5wSsVwqDc+ms5N90uka4PXp+kpsbw3 DRLgfjUTBXTC+qXT3BuBOIrx5i3gbu5F/MVNkxvx/tNo9oG/uN2iSbkEmv3vxDkLPpbQ qBFrXxHSHCaM86xsoWDfMVf5k21ZfZd+58gsYVNhT003iQa22wbAUZvk98b1J+EjXBaN jog0DOp6IBidwPIi+a7k1pmhQF32WUWT/RWPDfzKwImdBxC1E0YtaUGNHC/6IhStdCJU /LzVW0u3i4sVMFsIoIxKMzvBvtteh5Y7BDRKsNw26V9L1HC0Dkcm65BtITCG6Z+bTkUH EWhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JEINZzF6; 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 d4si12769084eja.217.2021.05.10.04.23.36; Mon, 10 May 2021 04:24:00 -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=JEINZzF6; 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 S238334AbhEJLRY (ORCPT + 99 others); Mon, 10 May 2021 07:17:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:45210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbhEJKxd (ORCPT ); Mon, 10 May 2021 06:53:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4FCE56191A; Mon, 10 May 2021 10:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643287; bh=ReXTlROa2dmXApoHXaLjl227NwJNlQ2btegkFhmerT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JEINZzF6bfldWE/zWKCUksX1aK10JzE5fRH9Nn5CtUJ3sDOWvREFJjkQrOrp+F/7y ka8kzV5JPuL4ujsiwKded0AkeF6WgMqRVKSIfXbJB+Us6h/fs9FhNcRKsqBL2clceQ bXtr+siF9dw83hExSHBiM7UiIgcI7Xw4vFWByNJI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Edward Cree , "David S. Miller" Subject: [PATCH 5.10 254/299] sfc: farch: fix TX queue lookup in TX event handling Date: Mon, 10 May 2021 12:20:51 +0200 Message-Id: <20210510102013.340268177@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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: Edward Cree commit 83b09a1807415608b387c7bc748d329fefc5617e upstream. We're starting from a TXQ label, not a TXQ type, so efx_channel_get_tx_queue() is inappropriate (and could return NULL, leading to panics). Fixes: 12804793b17c ("sfc: decouple TXQ type from label") Cc: stable@vger.kernel.org Signed-off-by: Edward Cree Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/sfc/farch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/sfc/farch.c +++ b/drivers/net/ethernet/sfc/farch.c @@ -835,14 +835,14 @@ efx_farch_handle_tx_event(struct efx_cha /* Transmit completion */ tx_ev_desc_ptr = EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_DESC_PTR); tx_ev_q_label = EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_Q_LABEL); - tx_queue = efx_channel_get_tx_queue( - channel, tx_ev_q_label % EFX_MAX_TXQ_PER_CHANNEL); + tx_queue = channel->tx_queue + + (tx_ev_q_label % EFX_MAX_TXQ_PER_CHANNEL); efx_xmit_done(tx_queue, tx_ev_desc_ptr); } else if (EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_WQ_FF_FULL)) { /* Rewrite the FIFO write pointer */ tx_ev_q_label = EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_Q_LABEL); - tx_queue = efx_channel_get_tx_queue( - channel, tx_ev_q_label % EFX_MAX_TXQ_PER_CHANNEL); + tx_queue = channel->tx_queue + + (tx_ev_q_label % EFX_MAX_TXQ_PER_CHANNEL); netif_tx_lock(efx->net_dev); efx_farch_notify_tx_desc(tx_queue);