From patchwork Wed Aug 3 14:24:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Petrilin X-Patchwork-Id: 1031682 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p73EOU0O024428 for ; Wed, 3 Aug 2011 14:24:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753890Ab1HCOY3 (ORCPT ); Wed, 3 Aug 2011 10:24:29 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:50498 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753455Ab1HCOY2 (ORCPT ); Wed, 3 Aug 2011 10:24:28 -0400 Received: from Internal Mail-Server by MTLPINE2 (envelope-from yevgenyp@mellanox.co.il) with SMTP; 3 Aug 2011 17:24:25 +0300 Received: from [10.4.45.1] (10.4.45.1) by MTLCAS01.mtl.com (10.0.8.70) with Microsoft SMTP Server id 14.1.289.1; Wed, 3 Aug 2011 17:24:24 +0300 Message-ID: <4E395A18.8070600@mellanox.co.il> Date: Wed, 3 Aug 2011 17:24:24 +0300 From: Yevgeny Petrilin User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: CC: , , Subject: [PATCH] mlx4: Fixing Ethernet unicast packet steering X-Originating-IP: [10.4.45.1] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 03 Aug 2011 14:24:30 +0000 (UTC) For older FW versions, fixing the usage of per port Mac table. For each port we must define the base QP number, which is passed to the HW. Setting the correct value in SET_PORT FW command to enable the steering. Reported-by: Roland Dreier Signed-off-by: Yevgeny Petrilin --- drivers/net/mlx4/en_port.c | 2 +- drivers/net/mlx4/main.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) -- 1.6.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/mlx4/en_port.c b/drivers/net/mlx4/en_port.c index 5e71091..5ada5b4 100644 --- a/drivers/net/mlx4/en_port.c +++ b/drivers/net/mlx4/en_port.c @@ -128,7 +128,7 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, memset(context, 0, sizeof *context); context->base_qpn = cpu_to_be32(base_qpn); - context->n_mac = 0x7; + context->n_mac = 0x2; context->promisc = cpu_to_be32(promisc << SET_PORT_PROMISC_SHIFT | base_qpn); context->mcast = cpu_to_be32(m_promisc << SET_PORT_MC_PROMISC_SHIFT | diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index c94b342..f0ee35d 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c @@ -1117,6 +1117,8 @@ static int mlx4_init_port_info(struct mlx4_dev *dev, int port) info->port = port; mlx4_init_mac_table(dev, &info->mac_table); mlx4_init_vlan_table(dev, &info->vlan_table); + info->base_qpn = dev->caps.reserved_qps_base[MLX4_QP_REGION_ETH_ADDR] + + (port - 1) * (1 << log_num_mac); sprintf(info->dev_name, "mlx4_port%d", port); info->port_attr.attr.name = info->dev_name;