Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp822932rwb; Mon, 26 Sep 2022 06:21:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JfrTBro1TuMtvRVZIU+WgIFbiIIMq3wTwJtS9mVll/Rry61ZEFaGOd0LOgwLX9WvHl4Q7 X-Received: by 2002:a17:906:fe0b:b0:730:3646:d177 with SMTP id wy11-20020a170906fe0b00b007303646d177mr17239619ejb.688.1664198506010; Mon, 26 Sep 2022 06:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198506; cv=none; d=google.com; s=arc-20160816; b=XR+3I6+bCLmTybCT/VIsEsV4t4BDIVmpEEH37yJI2sYxs6n2GXpaPXVo+xYL3mdp1x MNX/Qovxv0UuRxZb2hEr1eZghn6jnpTT/hxCykHKUSiol/vHZKn98nOfFyMGasOoyW62 rO1Jz1L2imymyrABQwrxdXx2iqQ3Vy0X/YduksrzQy6GUeOx8YH6BSfkmEXKdTUV9BiO +K4rCkD2quUCqPg0em/z362MnXiNs18cs8twQNVtTe+aAYs+3xa1KucSdbQRM96VTQFw xnGBywi1AbWSXiuTjmOPOlgR21k2neSnKrt7X4QhoLTBzwrnd700+AW94P05VPH0NMoR X5Aw== 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=OzBJZoYGjLLLq4/TWbCbLwPluBT1z/bcMpSzaC+tsNo=; b=OZgzmi6E/jLs+o2ilFDniq6ic+kTY1GtC6nPz6VBdmXlZZQUuS/0uer2wm7OnhyBCe E5yqWCovmTEwtVdZDrUDyrcCGRHOk224o7HDTEg/q5pQ3Upr9heLRhPE0tiY/Ji/cr2W 98ojRQe+1RFA+vtX3Aj2N/yXmdJ7UFeCMzD3XFW2TtD6eLou715VG9Fq3OFMcYeWSkC2 wquVCSJ8PQwdj1WQ2WkhqxIQO0ohM5JOxP9HSgR/4BRG3Z4l/pAvrA6Sebg1fVM6GKxh Ejj8hnA140q99LACDXv6M874YMkHYoQ8TvXs2/Yj+6uBMV+GRGpv7HAxH4RxRPYyY3bB jJUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OFEetBPU; 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 b8-20020a056402350800b004539c6d849bsi17045019edd.171.2022.09.26.06.21.20; Mon, 26 Sep 2022 06:21:45 -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=OFEetBPU; 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 S237908AbiIZL0A (ORCPT + 99 others); Mon, 26 Sep 2022 07:26:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238140AbiIZLYQ (ORCPT ); Mon, 26 Sep 2022 07:24:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 231105E56A; Mon, 26 Sep 2022 03:40:23 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3B87DB8091E; Mon, 26 Sep 2022 10:39:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DFC8C433D6; Mon, 26 Sep 2022 10:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188782; bh=erwEEtiOovDlZBytu2eszS/h+adZC5v5HlLJnaHbtx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OFEetBPUmtaLYEIZxjgyeMCAiNi5aEfoRWWvvB/1ZZFKP4csHcJY9s2m3RG3qNSph d/JJSDzkJl9dzFJKPESiWbv75oCoT7wkxVP0s5etUQr1CVBvb7/+jBqz09mBtb+uQf wxcO8LZiI5pWxaVrs/XRSpcAfxUwgYFtfrS83NFw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tianhao Zhao , =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= , Edward Cree , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 088/148] sfc: fix TX channel offset when using legacy interrupts Date: Mon, 26 Sep 2022 12:12:02 +0200 Message-Id: <20220926100759.363443923@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100756.074519146@linuxfoundation.org> References: <20220926100756.074519146@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 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 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: Íñigo Huguet [ Upstream commit f232af4295653afa4ade3230462b3be15ad16419 ] In legacy interrupt mode the tx_channel_offset was hardcoded to 1, but that's not correct if efx_sepparate_tx_channels is false. In that case, the offset is 0 because the tx queues are in the single existing channel at index 0, together with the rx queue. Without this fix, as soon as you try to send any traffic, it tries to get the tx queues from an uninitialized channel getting these errors: WARNING: CPU: 1 PID: 0 at drivers/net/ethernet/sfc/tx.c:540 efx_hard_start_xmit+0x12e/0x170 [sfc] [...] RIP: 0010:efx_hard_start_xmit+0x12e/0x170 [sfc] [...] Call Trace: dev_hard_start_xmit+0xd7/0x230 sch_direct_xmit+0x9f/0x360 __dev_queue_xmit+0x890/0xa40 [...] BUG: unable to handle kernel NULL pointer dereference at 0000000000000020 [...] RIP: 0010:efx_hard_start_xmit+0x153/0x170 [sfc] [...] Call Trace: dev_hard_start_xmit+0xd7/0x230 sch_direct_xmit+0x9f/0x360 __dev_queue_xmit+0x890/0xa40 [...] Fixes: c308dfd1b43e ("sfc: fix wrong tx channel offset with efx_separate_tx_channels") Reported-by: Tianhao Zhao Signed-off-by: Íñigo Huguet Acked-by: Edward Cree Link: https://lore.kernel.org/r/20220914103648.16902-1-ihuguet@redhat.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/sfc/efx_channels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c index b1657e03a74f..450fcedb7042 100644 --- a/drivers/net/ethernet/sfc/efx_channels.c +++ b/drivers/net/ethernet/sfc/efx_channels.c @@ -329,7 +329,7 @@ int efx_probe_interrupts(struct efx_nic *efx) efx->n_channels = 1 + (efx_separate_tx_channels ? 1 : 0); efx->n_rx_channels = 1; efx->n_tx_channels = 1; - efx->tx_channel_offset = 1; + efx->tx_channel_offset = efx_separate_tx_channels ? 1 : 0; efx->n_xdp_channels = 0; efx->xdp_channel_offset = efx->n_channels; efx->legacy_irq = efx->pci_dev->irq; -- 2.35.1