diff options
author | Hadar Hen Zion <hadarh@mellanox.com> | 2013-04-24 13:58:47 +0000 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-04-24 17:51:29 -0700 |
commit | bcf372971d471f6cb4070adb7bfc987d8b3d21f2 (patch) | |
tree | d99f6faa007d10a1246a0f7a4853dff6e8b98d44 /drivers/net/ethernet/mellanox/mlx4/mcg.c | |
parent | ba60a3560ccf8e4253da9c0e8d1292375fd51796 (diff) |
mlx4_core: Directly expose fields of DMFS HW rule control segment
Some of struct mlx4_net_trans_rule_hw_ctrl fields were packed into u32
and accessed through bit field operations. Expose and access them
directly as u8 or u16.
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/mcg.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/mcg.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c index 3cfd3725961..07712f976c8 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c @@ -656,15 +656,15 @@ static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, [MLX4_FS_MC_SNIFFER] = 0x5, }; - u32 dw = 0; + u8 flags = 0; - dw = ctrl->queue_mode == MLX4_NET_TRANS_Q_LIFO ? 1 : 0; - dw |= ctrl->exclusive ? (1 << 2) : 0; - dw |= ctrl->allow_loopback ? (1 << 3) : 0; - dw |= __promisc_mode[ctrl->promisc_mode] << 8; - dw |= ctrl->priority << 16; + flags = ctrl->queue_mode == MLX4_NET_TRANS_Q_LIFO ? 1 : 0; + flags |= ctrl->exclusive ? (1 << 2) : 0; + flags |= ctrl->allow_loopback ? (1 << 3) : 0; - hw->ctrl = cpu_to_be32(dw); + hw->flags = flags; + hw->type = __promisc_mode[ctrl->promisc_mode]; + hw->prio = cpu_to_be16(ctrl->priority); hw->port = ctrl->port; hw->qpn = cpu_to_be32(ctrl->qpn); } |