]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mlx4: Fixing Ethernet unicast packet steering
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>
Wed, 3 Aug 2011 23:38:59 +0000 (16:38 -0700)
committerJoe Jin <joe.jin@oracle.com>
Thu, 15 Dec 2011 01:20:45 +0000 (09:20 +0800)
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 <roland@purestorage.com>
Tested-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 06fa0a883a01a34a0449ec116c5288c1d196b4b0)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/mlx4/en_port.c
drivers/net/mlx4/main.c

index 5e7109178061ec987594171fb0eb6ad6685c6906..5ada5b4691127fa54026619d20de17596dac9581 100644 (file)
@@ -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 |
index 1ea64e62f0cd9ff0a433a5831adc9cc3f5ac98cd..545a771886453197ba381cecf1d94d75af5083cc 100644 (file)
@@ -1066,6 +1066,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;