Commit bcf37297 authored by Hadar Hen Zion's avatar Hadar Hen Zion Committed by Roland Dreier

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: default avatarHadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent ba60a356
...@@ -656,15 +656,15 @@ static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, ...@@ -656,15 +656,15 @@ static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl,
[MLX4_FS_MC_SNIFFER] = 0x5, [MLX4_FS_MC_SNIFFER] = 0x5,
}; };
u32 dw = 0; u8 flags = 0;
dw = ctrl->queue_mode == MLX4_NET_TRANS_Q_LIFO ? 1 : 0; flags = ctrl->queue_mode == MLX4_NET_TRANS_Q_LIFO ? 1 : 0;
dw |= ctrl->exclusive ? (1 << 2) : 0; flags |= ctrl->exclusive ? (1 << 2) : 0;
dw |= ctrl->allow_loopback ? (1 << 3) : 0; flags |= ctrl->allow_loopback ? (1 << 3) : 0;
dw |= __promisc_mode[ctrl->promisc_mode] << 8;
dw |= ctrl->priority << 16;
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->port = ctrl->port;
hw->qpn = cpu_to_be32(ctrl->qpn); hw->qpn = cpu_to_be32(ctrl->qpn);
} }
......
...@@ -964,7 +964,9 @@ struct mlx4_net_trans_rule { ...@@ -964,7 +964,9 @@ struct mlx4_net_trans_rule {
}; };
struct mlx4_net_trans_rule_hw_ctrl { struct mlx4_net_trans_rule_hw_ctrl {
__be32 ctrl; __be16 prio;
u8 type;
u8 flags;
u8 rsvd1; u8 rsvd1;
u8 funcid; u8 funcid;
u8 vep; u8 vep;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment