Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp628130rwd; Wed, 31 May 2023 03:13:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5dpFViZMqKgJdPhSPlFi4uOC88IPE8Wq6TkJ4mCikK6KSucF+83j9Ux8dk2HxY3VRYIf4C X-Received: by 2002:a9d:6854:0:b0:6ab:13e6:225b with SMTP id c20-20020a9d6854000000b006ab13e6225bmr1483709oto.12.1685527986830; Wed, 31 May 2023 03:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685527986; cv=none; d=google.com; s=arc-20160816; b=n9g2ctqOmfWx+pTzuMloEvscX1UWkxj6bmGenu2vOR5okWz2Xk7vTI61TFCyrEjUK1 fei6zN/DuSZcXUpj+MaEU4muG8x6QWgQ9nrf3PEtZjrKSCKeE4s3TUEG8yU8z/9bF5gj iVOWBppLMb20XiCtRqmYK4/R846GMNvI680Optq/6ZV+WtSIaO32TVWvix+oTshA4vnd /lOC6CSrZVEOsD4h0Ic3/GbLH31yZX8JQ0YskUTT/5u/ny1W5YN7VKE5e1JqMvj70Rts Y7dn+a/+mJAOo0Oi1gnKedXB6CX3/fvUNUCyf9PFio3+sAV3D0kNp31i+zGGFaeVrS0r V5ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=bGxc4eRfK6pbwqqh2NtDpBVJvcM3fuyjggZTA4cPMnI=; b=Vfv0KCay3yEUJ5hPec5BoQ++EHvmTGdNDeGqZwLRNH+jyKLM58+HFx0U0rM4bx2zfG 72QLtwd1Puaw6wNwZqJ61myQU8VVQH+azwor+KS7eUDI5/KtctzpBXaYFja2CmdNmQsh K6eGSfSmtNSPL8ZYC8coy8DffVp2dIvByVgHGSILY5iKRLYWu9T6CblufxjkZfyAQvPl a7Gw+giwpp6Md/dQNEbhRlmqpMlroIOpuPlHLibKDJWDyPXVvkz18uy7Kd4ZNLwjfgCF 4e6N6LY3VKuwUo7n4P7D+QAFSfLNo7hw5FIgyMgOyJd7kILLnAeDMaEqZUOnEG3Qkawa VJwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WG0mMi/D"; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k124-20020a636f82000000b0053fb1d02b00si771185pgc.383.2023.05.31.03.12.54; Wed, 31 May 2023 03:13:06 -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=@redhat.com header.s=mimecast20190719 header.b="WG0mMi/D"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235598AbjEaJit (ORCPT + 99 others); Wed, 31 May 2023 05:38:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235573AbjEaJio (ORCPT ); Wed, 31 May 2023 05:38:44 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C25310F for ; Wed, 31 May 2023 02:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685525887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bGxc4eRfK6pbwqqh2NtDpBVJvcM3fuyjggZTA4cPMnI=; b=WG0mMi/DxzWJI2byMwwr7rqtQdX+WnE9CjnuqDVSlpo2Vhpz18rUps7c+b79cbyjqT+cuu 6bvYa6ZwprX21RGP3o2h9FKSSIBWddwuGLCHKg5PIP66Dq1VWUUA/s+iDzh73rXY+JGPHP iCziwD+RRQvXgUXpn1jCZ9c7C9d45bc= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-199-pAF1QaxAOMaJBoZhdopU2g-1; Wed, 31 May 2023 05:38:05 -0400 X-MC-Unique: pAF1QaxAOMaJBoZhdopU2g-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-4edc7ab63ccso3179111e87.3 for ; Wed, 31 May 2023 02:38:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685525884; x=1688117884; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bGxc4eRfK6pbwqqh2NtDpBVJvcM3fuyjggZTA4cPMnI=; b=kPTFBfWswFekHIdLfBvo3vi38XyTlPmfBemiOYBirakdoz3+bVvJsqEKR/vQW9A/Ic ADeNLLLrgVvVBqj5GY1EG+kXtHRqwxAondF3PrRH10qYPOZ6juztKTWwWGu+TWJzKVES vubNqrqVqU1dzM48Zk5qePsz97PGdTJTtPnZNbpZSTUKVcNN4QZPHGVWZtqL0ieVZvQo KE9E9iWEFSEpLexltUUC0P5Wl88Vn5QMLv2nahknC8UWRh/Jn2YQ3s3Qdqy+Le+Kx64F YGvrAp6dByr0Uiyv8R+5uiHKYMDUZ0Po3wtJOfYMOBKw/SihE8ZsRuf3ypDcMFIHVz0p 5LFg== X-Gm-Message-State: AC+VfDyQ0S7X5tvbF7huL+iply67s/i67Xhhbf9U2RkhQQEPfViLGKNT 3VKtzCBWwZBsiFVg9eTCK19K7nPKvaPUfNgdNQBWXCVyZY9ywS43TdhELPZFIoKCxqDi7w+Do40 jIrx9Sa1pZXhyIShRb9dLPi5M X-Received: by 2002:ac2:43dc:0:b0:4f1:3bd7:e53a with SMTP id u28-20020ac243dc000000b004f13bd7e53amr2255704lfl.49.1685525884432; Wed, 31 May 2023 02:38:04 -0700 (PDT) X-Received: by 2002:ac2:43dc:0:b0:4f1:3bd7:e53a with SMTP id u28-20020ac243dc000000b004f13bd7e53amr2255690lfl.49.1685525884068; Wed, 31 May 2023 02:38:04 -0700 (PDT) Received: from ?IPV6:2a01:e0a:280:24f0:eb4a:c9d8:c8bb:c0b0? ([2a01:e0a:280:24f0:eb4a:c9d8:c8bb:c0b0]) by smtp.gmail.com with ESMTPSA id x13-20020a5d54cd000000b003063db8f45bsm6157419wrv.23.2023.05.31.02.38.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 May 2023 02:38:03 -0700 (PDT) Message-ID: Date: Wed, 31 May 2023 11:38:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH net v2] net/mlx5: Fix setting of irq->map.index for static IRQ case Content-Language: en-US To: Niklas Schnelle , Shay Drory , Saeed Mahameed , Eli Cohen , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Mark Brown , Simon Horman , linux-rdma@vger.kernel.org References: <20230531084856.2091666-1-schnelle@linux.ibm.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20230531084856.2091666-1-schnelle@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 5/31/23 10:48, Niklas Schnelle wrote: > When dynamic IRQ allocation is not supported all IRQs are allocated up > front in mlx5_irq_table_create() instead of dynamically as part of > mlx5_irq_alloc(). In the latter dynamic case irq->map.index is set > via the mapping returned by pci_msix_alloc_irq_at(). In the static case > and prior to commit 1da438c0ae02 ("net/mlx5: Fix indexing of mlx5_irq") > irq->map.index was set in mlx5_irq_alloc() twice once initially to 0 and > then to the requested index before storing in the xarray. After this > commit it is only set to 0 which breaks all other IRQ mappings. > > Fix this by setting irq->map.index to the requested index together with > irq->map.virq and improve the related comment to make it clearer which > cases it deals with. > > Tested-by: Mark Brown > Reviewed-by: Mark Brown > Reviewed-by: Simon Horman > Reviewed-by: Eli Cohen > Fixes: 1da438c0ae02 ("net/mlx5: Fix indexing of mlx5_irq") > Signed-off-by: Niklas Schnelle I was seeing the issue on a zLPAR with a mlx5 VF device. The patch fixes it. Tested-by: Cédric Le Goater Thanks, C. > --- > v1 -> v2: > - Added R-bs/Acks > - Fixed typos in commit message > > drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c > index db5687d9fec9..fd5b43e8f3bb 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c > @@ -232,12 +232,13 @@ struct mlx5_irq *mlx5_irq_alloc(struct mlx5_irq_pool *pool, int i, > if (!irq) > return ERR_PTR(-ENOMEM); > if (!i || !pci_msix_can_alloc_dyn(dev->pdev)) { > - /* The vector at index 0 was already allocated. > - * Just get the irq number. If dynamic irq is not supported > - * vectors have also been allocated. > + /* The vector at index 0 is always statically allocated. If > + * dynamic irq is not supported all vectors are statically > + * allocated. In both cases just get the irq number and set > + * the index. > */ > irq->map.virq = pci_irq_vector(dev->pdev, i); > - irq->map.index = 0; > + irq->map.index = i; > } else { > irq->map = pci_msix_alloc_irq_at(dev->pdev, MSI_ANY_INDEX, af_desc); > if (!irq->map.virq) {