Received: by 10.192.165.148 with SMTP id m20csp421990imm; Wed, 9 May 2018 15:20:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpfmksBcdwwaqHcdNjhyO84+z3pOiHYD1i6/caxLF/3QjiaRFFeoSctT37KOi3vTfam1whw X-Received: by 10.98.35.215 with SMTP id q84mr45118721pfj.31.1525904451827; Wed, 09 May 2018 15:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525904451; cv=none; d=google.com; s=arc-20160816; b=0saYtUOuM+j8FAbSnkyNJfpnEQEQp2FxBQ9PJPHZVE0lgikIkH+LqHh90ZPr9lgscd YsYMoweKMf5+55CJ8PGylAw2Rsg1+l65WA/IxaK+wlzASHZ/v6eFEEHp7kYvAxK5Mt1G Reimx3kQvjnxi3d6vsrRAn81KEHsGtPflwWbGZbXzZwMsuDWIJZPEKFKf9qaBSNew6TC V39wYWSIqB/w2IMnsrGCeJ5AkhiluOtJQuyrt4kU11taUVcaOnPMzag1lrlfx4TjglfY sS5Sr0h36qxsdEvQXNtlyOLyFnjp3Z+m/XcTatdFSvX/yvAx/gzDsRfcNRanXKIivlNV sKtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=p832YGzKETPYwMYzwCW06cFZY5AHrWKri8I8zy9Vue8=; b=GFzfbRFeycpQMFVC3YzeyRsG/pJ+TOCVQowhOoaiW37mzpvJ2r4u9Rc29QhTQuhXhQ dVtUdBtXUJRMewn1mdRtSy06Lxxm4CDkU3rt0uKV+lnPG8+Ks8dZ9wd+6PDxhUhsiOCw qwUKHLoEBe6u3fawsdKA1wwBUqo1XUzWkYAOzyt9zkAnvnZNY3PWgxbwtSOe995km+1j 1OlfBBxRSWtQE0Rw9KAI3g7ST3uORT3RduNbJ/wSTkXznLUKXFd8cKF2qY5MpNpPoesH ilkSa30cYi26fMqEZxqMnmCmyup2U53/eaCls0JfPXdRabmas+zvUYD5JPhISD74DyMa IpSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=bhoS2aQm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6-v6si8675102pgt.611.2018.05.09.15.20.37; Wed, 09 May 2018 15:20:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=bhoS2aQm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965797AbeEIWTL (ORCPT + 99 others); Wed, 9 May 2018 18:19:11 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:50531 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965163AbeEIWTJ (ORCPT ); Wed, 9 May 2018 18:19:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=p832YGzKETPYwMYzwCW06cFZY5AHrWKri8I8zy9Vue8=; b=bhoS2aQmZVRIjOwGW+pzA3uRv5 mPLH+9vE//CibTuGRebd9AwhP2XWsfqtnSFGVbk/9agEWhd0Xos9wsZ64iRA+CMKOIGZcm0fm9cNO V3IjVCmtKQJ33I7VLLA+xR/CymZZeKwQtzqj1fhZUlGqwaVmvrU02TBhcQEE76cCnTODBRj9d1op0 OXBt8sWXqOCKbpqMaXTTaCBcnrMGxi8P9AIUhv2bJVFbNgG2R2SM+nlRUAfoI4eFSDT06hrUv6Qi6 +NCubV9yYJ2w29Sk4Rmt8v6omO1/HNG5IcfqP9zpz8MmoI8VcRbf4LXRCGOu1Um9/R362fRY+j6+R ExwG1bTQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:35224 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.89) (envelope-from ) id 1fGXQQ-002y9k-VG; Wed, 09 May 2018 22:19:07 +0000 Date: Wed, 9 May 2018 15:19:06 -0700 From: Guenter Roeck To: Thomas Gleixner Cc: Israel Rukshin , Max Gurtovoy , Matan Barak , Doug Ledford , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] net/mlx5: Fix mlx5_get_vector_affinity function Message-ID: <20180509221906.GA7548@roeck-us.net> References: <20180505143838.GA12621@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 06, 2018 at 09:33:26AM +0200, Thomas Gleixner wrote: > On Sat, 5 May 2018, Guenter Roeck wrote: > > > On Thu, Apr 12, 2018 at 09:49:11AM +0000, Israel Rukshin wrote: > > > Adding the vector offset when calling to mlx5_vector2eqn() is wrong. > > > This is because mlx5_vector2eqn() checks if EQ index is equal to vector number > > > and the fact that the internal completion vectors that mlx5 allocates > > > don't get an EQ index. > > > > > > The second problem here is that using effective_affinity_mask gives the same > > > CPU for different vectors. > > > This leads to unmapped queues when calling it from blk_mq_rdma_map_queues(). > > > This doesn't happen when using affinity_hint mask. > > > > > Except that affinity_hint is only defined if SMP is enabled. Without: > > > > include/linux/mlx5/driver.h: In function ‘mlx5_get_vector_affinity_hint’: > > include/linux/mlx5/driver.h:1299:13: error: > > ‘struct irq_desc’ has no member named ‘affinity_hint’ > > > > Note that this is the only use of affinity_hint outside kernel/irq. > > Don't other drivers have similar problems ? > > Aside of that. > > > > static inline const struct cpumask * > > > -mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector) > > > +mlx5_get_vector_affinity_hint(struct mlx5_core_dev *dev, int vector) > > > { > > > - const struct cpumask *mask; > > > struct irq_desc *desc; > > > unsigned int irq; > > > int eqn; > > > int err; > > > > > > - err = mlx5_vector2eqn(dev, MLX5_EQ_VEC_COMP_BASE + vector, &eqn, &irq); > > > + err = mlx5_vector2eqn(dev, vector, &eqn, &irq); > > > if (err) > > > return NULL; > > > > > > desc = irq_to_desc(irq); > > > -#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK > > > - mask = irq_data_get_effective_affinity_mask(&desc->irq_data); > > > -#else > > > - mask = desc->irq_common_data.affinity; > > > -#endif > > > - return mask; > > > + return desc->affinity_hint; > > NAK. > The offending patch is upstream, breaking non-SMP test builds, and I have not seen any feedback from the submitter. Any suggestion how to proceed ? Guenter > Nothing in regular device drivers is supposed to ever fiddle with struct > irq_desc. The existing code is already a violation of that rule and needs > to be fixed, but not in that way. > > The logic here is completely screwed. affinity_hint is set by the driver, > so the driver already knows what it is. If the driver does not set it, then > the thing is NULL. > > Thanks, > > tglx >