Received: by 10.192.165.148 with SMTP id m20csp1239614imm; Sat, 5 May 2018 07:40:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqLr/9AdguBSMaLgYo2fggojoV51MQx3j9+8zyzXjR0eOtp9MupbbQWMtc992VY5HQhjAXF X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr31341561plb.226.1525531223973; Sat, 05 May 2018 07:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525531223; cv=none; d=google.com; s=arc-20160816; b=Y32S5JBW4jJTnUbcpVvtxlCL5zw3qTwQWInM6hkUuobs/dHBLVKM8ic7ex2lh2ZsiV VHQR2VF8DBRVk4BhAie02+azq2TBvH6hNBK25rJrvJfvda70Nd02pJGzmrcncI4ustsg DdWWgLC33/oOjza3UtCM7cAtOhyWZwvbd3je4/XD7i6D+bw8jboA8uNPmfuUd+mpy9zt YO/+OK+9dQFwgra5DyyKzBxVX4iIRW9kVif3O9ZH12KBvQ6qryccpQwssKu5OsbzMZ40 rZYpy0g8jTMIMzKufxrgBTAkbIMHCKDDmgzJGVcotLGCFGXs386BTHX4N3TzRScKaVtR WPaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=gOb1QyT1I1sBnE/5Qe50H6qvhnf/f1+cyQ3gYIl5OJE=; b=VhEGzl3enOIe+DBlTVcUPIdCx8SItTrjbBAw22Hk7vWTZHskQsdgN1P8h5Anp61hlI Db+NMgZuAUry+QgfTTOhj0gvsai+Epfhhqg3WJr2gY7SB1+35M1mhbEoZr8fCnjV6CFk QGrUbpU57PlR5/ZRRgDIoo2PjnReHNfEA3wqeiTHINnCE+z4tLSO5K5ot6IU4oBYcCga QNcqyCGUy4DlEt1BSASIYtryceyp40m3kpIynfvgDVxvt3WpFqu7jdHB9vdnp51r8QXY DADsLMOFeNjp3PHH3Uzzv2keDrhm7pn9Oh4MIAmiQqH8pwIEl8rjq56HhsDBb+0UoGEQ b20w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=xQqQM45D; 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 p3si8683279pfb.171.2018.05.05.07.40.08; Sat, 05 May 2018 07:40:23 -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=xQqQM45D; 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 S1751591AbeEEOip (ORCPT + 99 others); Sat, 5 May 2018 10:38:45 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:52970 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751206AbeEEOin (ORCPT ); Sat, 5 May 2018 10:38:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gOb1QyT1I1sBnE/5Qe50H6qvhnf/f1+cyQ3gYIl5OJE=; b=xQqQM45Dfu2Of7ZBV6HnDy61tN THJx7bKgHSrpeYKeQMvCEARHT3QxwntzX582E3mFmGiYuuuzBSk76a3krCIlDnz5dGvQouCs53kQc 5wDpGCz/qx3FQCkCmOjr6rDQT4lrenwdi4oiNhMt3AyZTogcMLgWp22QD2bFj3bOxUmuvA7oT8Lku RqThC9y7KvpKEcUblLmBGqWhlVmbMh1ocPNGEOfNJ3zTEehQzeVYpsGpm2NzYgUYcvugR2GIhgEoL 7wlhCj60io7jebZnOZfKSDo/rsfy0ZlQT/di9HU2NYloSY0SR78g9iIiLtI9eedrtOOnmKlgNNcxb W+yGlLEQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:47172 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.89) (envelope-from ) id 1fEyKd-000s9X-Mi; Sat, 05 May 2018 14:38:40 +0000 Date: Sat, 5 May 2018 07:38:38 -0700 From: Guenter Roeck To: Israel Rukshin Cc: Max Gurtovoy , Matan Barak , Doug Ledford , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH] net/mlx5: Fix mlx5_get_vector_affinity function Message-ID: <20180505143838.GA12621@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 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 ? Guenter > Fixes: 2572cf57d75a ("mlx5: fix mlx5_get_vector_affinity to start from completion vector 0") > Fixes: 05e0cc84e00c ("net/mlx5: Fix get vector affinity helper function") > Signed-off-by: Israel Rukshin > Reviewed-by: Max Gurtovoy > Reviewed-by: Sagi Grimberg > --- > drivers/infiniband/hw/mlx5/main.c | 2 +- > include/linux/mlx5/driver.h | 12 +++--------- > 2 files changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c > index daa919e5a442..241cf4ff9901 100644 > --- a/drivers/infiniband/hw/mlx5/main.c > +++ b/drivers/infiniband/hw/mlx5/main.c > @@ -4757,7 +4757,7 @@ mlx5_ib_get_vector_affinity(struct ib_device *ibdev, int comp_vector) > { > struct mlx5_ib_dev *dev = to_mdev(ibdev); > > - return mlx5_get_vector_affinity(dev->mdev, comp_vector); > + return mlx5_get_vector_affinity_hint(dev->mdev, comp_vector); > } > > /* The mlx5_ib_multiport_mutex should be held when calling this function */ > diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h > index 767d193c269a..2a156c5dfadd 100644 > --- a/include/linux/mlx5/driver.h > +++ b/include/linux/mlx5/driver.h > @@ -1284,25 +1284,19 @@ enum { > }; > > 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; > } > > #endif /* MLX5_DRIVER_H */ > -- > 2.7.4