From patchwork Tue Jan 24 18:24:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13114504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90AC5C25B4E for ; Tue, 24 Jan 2023 18:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbjAXSY1 (ORCPT ); Tue, 24 Jan 2023 13:24:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjAXSY0 (ORCPT ); Tue, 24 Jan 2023 13:24:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1960742DD1 for ; Tue, 24 Jan 2023 10:24:26 -0800 (PST) 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 C2692B8163F for ; Tue, 24 Jan 2023 18:24:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D38ABC433EF; Tue, 24 Jan 2023 18:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674584663; bh=MPO9umwd0nOj3a5SIBNiTnyFkXEXJrikt/2idDZOJwQ=; h=From:To:Cc:Subject:Date:From; b=gD5zgHKeqzSHMIiVnSIiPhrR9VMLWWFYqc5vijRDo7CbpAlV2t1cgfsb7pu7fpT7b 1ZZBqQUPMMy0MJaKFB4aMFvnCLrxelufgJq6tMFDGX94d4DGnn/FBZav50S1ZcN+5p quxuoxbMwFxTWE/raU4rXFQvQ5vFp0bX2Mvrid2SAKc7HW5UFMI3+H/Bz7BNKV3RVl h3ceMUtzE8ClG/Ch1a2EVwRTVaRchLPUcrTohatJLohqzJZvVJI7nZW40BYzfzCgbs l44eITgQAonG2xVsx1jY9dE3a6+T1+OpmH+Y0zoripzKjtLeRQZI8GRqne0aKxiHkL c1RMfSlTirbkg== From: Leon Romanovsky To: Jason Gunthorpe Cc: Dragos Tatulea , linux-rdma@vger.kernel.org Subject: [PATCH rdma-rc v2] IB/IPoIB: Fix queue count for non-enhanced IPoIB over netlink Date: Tue, 24 Jan 2023 20:24:18 +0200 Message-Id: <95eb6b74c7cf49fa46281f9d056d685c9fa11d38.1674584576.git.leon@kernel.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Dragos Tatulea Make sure that non-enhanced IPoIB queues are configured with only 1 tx and rx queues over netlink. This behavior is consistent with the sysfs child_create configuration. The cited commit opened up the possibility for child PKEY interface to have multiple tx/rx queues. It is the driver's responsibility to re-adjust the queue count accordingly. This patch does exactly that: non-enhanced IPoIB supports only 1 tx and 1 rx queue. Fixes: dbc94a0fb817 ("IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces") Signed-off-by: Dragos Tatulea Signed-off-by: Leon Romanovsky --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index ac25fc80fb33..f10d4bcf87d2 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -2200,6 +2200,14 @@ int ipoib_intf_init(struct ib_device *hca, u32 port, const char *name, rn->attach_mcast = ipoib_mcast_attach; rn->detach_mcast = ipoib_mcast_detach; rn->hca = hca; + + rc = netif_set_real_num_tx_queues(dev, 1); + if (rc) + goto out; + + rc = netif_set_real_num_rx_queues(dev, 1); + if (rc) + goto out; } priv->rn_ops = dev->netdev_ops;