mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
IB/mlx4: Convert is_xxx variables in build_mlx_header() to bool
Matches the way they're used, and actually lets at least x86-64 generate better code: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-38 (-38) function old new delta mlx4_ib_post_send 4416 4378 -38 Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:
parent
6108372070
commit
a29bec1241
@ -652,12 +652,12 @@ int __mlx4_ib_query_gid(struct ib_device *ibdev, u8 port, int index,
|
|||||||
int mlx4_ib_resolve_grh(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah_attr,
|
int mlx4_ib_resolve_grh(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah_attr,
|
||||||
u8 *mac, int *is_mcast, u8 port);
|
u8 *mac, int *is_mcast, u8 port);
|
||||||
|
|
||||||
static inline int mlx4_ib_ah_grh_present(struct mlx4_ib_ah *ah)
|
static inline bool mlx4_ib_ah_grh_present(struct mlx4_ib_ah *ah)
|
||||||
{
|
{
|
||||||
u8 port = be32_to_cpu(ah->av.ib.port_pd) >> 24 & 3;
|
u8 port = be32_to_cpu(ah->av.ib.port_pd) >> 24 & 3;
|
||||||
|
|
||||||
if (rdma_port_get_link_layer(ah->ibah.device, port) == IB_LINK_LAYER_ETHERNET)
|
if (rdma_port_get_link_layer(ah->ibah.device, port) == IB_LINK_LAYER_ETHERNET)
|
||||||
return 1;
|
return true;
|
||||||
|
|
||||||
return !!(ah->av.ib.g_slid & 0x80);
|
return !!(ah->av.ib.g_slid & 0x80);
|
||||||
}
|
}
|
||||||
|
@ -1746,11 +1746,11 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
|
|||||||
int header_size;
|
int header_size;
|
||||||
int spc;
|
int spc;
|
||||||
int i;
|
int i;
|
||||||
int is_eth;
|
|
||||||
int is_vlan = 0;
|
|
||||||
int is_grh;
|
|
||||||
u16 vlan;
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
u16 vlan;
|
||||||
|
bool is_eth;
|
||||||
|
bool is_vlan = false;
|
||||||
|
bool is_grh;
|
||||||
|
|
||||||
send_size = 0;
|
send_size = 0;
|
||||||
for (i = 0; i < wr->num_sge; ++i)
|
for (i = 0; i < wr->num_sge; ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user