Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
Show First 20 Lines • Show All 594 Lines • ▼ Show 20 Lines | |||||
mlx4_en_store_inline_header(volatile struct mlx4_wqe_data_seg *dseg, | mlx4_en_store_inline_header(volatile struct mlx4_wqe_data_seg *dseg, | ||||
int len, __be32 owner_bit) | int len, __be32 owner_bit) | ||||
{ | { | ||||
uint8_t *inl = __DEVOLATILE(uint8_t *, dseg); | uint8_t *inl = __DEVOLATILE(uint8_t *, dseg); | ||||
const int spc = MLX4_INLINE_ALIGN - CTRL_SIZE - 4; | const int spc = MLX4_INLINE_ALIGN - CTRL_SIZE - 4; | ||||
if (unlikely(len < MIN_PKT_LEN)) { | if (unlikely(len < MIN_PKT_LEN)) { | ||||
*(volatile uint32_t *)inl = | *(volatile uint32_t *)inl = | ||||
SET_BYTE_COUNT((1 << 31) | MIN_PKT_LEN); | SET_BYTE_COUNT((1U << 31) | MIN_PKT_LEN); | ||||
} else if (len <= spc) { | } else if (len <= spc) { | ||||
*(volatile uint32_t *)inl = | *(volatile uint32_t *)inl = | ||||
SET_BYTE_COUNT((1 << 31) | len); | SET_BYTE_COUNT((1U << 31) | len); | ||||
} else { | } else { | ||||
*(volatile uint32_t *)(inl + 4 + spc) = | *(volatile uint32_t *)(inl + 4 + spc) = | ||||
SET_BYTE_COUNT((1 << 31) | (len - spc)); | SET_BYTE_COUNT((1U << 31) | (len - spc)); | ||||
wmb(); | wmb(); | ||||
*(volatile uint32_t *)inl = | *(volatile uint32_t *)inl = | ||||
SET_BYTE_COUNT((1 << 31) | spc); | SET_BYTE_COUNT((1U << 31) | spc); | ||||
} | } | ||||
} | } | ||||
static uint32_t hashrandom; | static uint32_t hashrandom; | ||||
static void hashrandom_init(void *arg) | static void hashrandom_init(void *arg) | ||||
{ | { | ||||
/* | /* | ||||
* It is assumed that the random subsystem has been | * It is assumed that the random subsystem has been | ||||
▲ Show 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | static int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf **mbp) | ||||
dseg += nr_segs + pad; | dseg += nr_segs + pad; | ||||
/* pad using zero immediate dseg */ | /* pad using zero immediate dseg */ | ||||
while (pad--) { | while (pad--) { | ||||
dseg--; | dseg--; | ||||
dseg->addr = 0; | dseg->addr = 0; | ||||
dseg->lkey = 0; | dseg->lkey = 0; | ||||
wmb(); | wmb(); | ||||
dseg->byte_count = SET_BYTE_COUNT((1 << 31)|0); | dseg->byte_count = SET_BYTE_COUNT((1U << 31)|0); | ||||
} | } | ||||
/* fill segment list */ | /* fill segment list */ | ||||
while (nr_segs--) { | while (nr_segs--) { | ||||
if (unlikely(segs[nr_segs].ds_len == 0)) { | if (unlikely(segs[nr_segs].ds_len == 0)) { | ||||
dseg--; | dseg--; | ||||
dseg->addr = 0; | dseg->addr = 0; | ||||
dseg->lkey = 0; | dseg->lkey = 0; | ||||
wmb(); | wmb(); | ||||
dseg->byte_count = SET_BYTE_COUNT((1 << 31)|0); | dseg->byte_count = SET_BYTE_COUNT((1U << 31)|0); | ||||
} else { | } else { | ||||
dseg--; | dseg--; | ||||
dseg->addr = cpu_to_be64((uint64_t)segs[nr_segs].ds_addr); | dseg->addr = cpu_to_be64((uint64_t)segs[nr_segs].ds_addr); | ||||
dseg->lkey = cpu_to_be32(priv->mdev->mr.key); | dseg->lkey = cpu_to_be32(priv->mdev->mr.key); | ||||
wmb(); | wmb(); | ||||
dseg->byte_count = SET_BYTE_COUNT((uint32_t)segs[nr_segs].ds_len); | dseg->byte_count = SET_BYTE_COUNT((uint32_t)segs[nr_segs].ds_len); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines |