Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
Show First 20 Lines • Show All 302 Lines • ▼ Show 20 Lines | bus_dmamap_sync(ring->dma_tag, tx_info->dma_map, | ||||
BUS_DMASYNC_POSTWRITE); | BUS_DMASYNC_POSTWRITE); | ||||
bus_dmamap_unload(ring->dma_tag, tx_info->dma_map); | bus_dmamap_unload(ring->dma_tag, tx_info->dma_map); | ||||
m_freem(mb); | m_freem(mb); | ||||
done: | done: | ||||
return (tx_info->nr_txbb); | return (tx_info->nr_txbb); | ||||
} | } | ||||
int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring) | int mlx4_en_free_tx_buf(struct ifnet *dev, struct mlx4_en_tx_ring *ring) | ||||
{ | { | ||||
struct mlx4_en_priv *priv = netdev_priv(dev); | struct mlx4_en_priv *priv = netdev_priv(dev); | ||||
int cnt = 0; | int cnt = 0; | ||||
/* Skip last polled descriptor */ | /* Skip last polled descriptor */ | ||||
ring->cons += ring->last_nr_txbb; | ring->cons += ring->last_nr_txbb; | ||||
en_dbg(DRV, priv, "Freeing Tx buf - cons:0x%x prod:0x%x\n", | en_dbg(DRV, priv, "Freeing Tx buf - cons:0x%x prod:0x%x\n", | ||||
ring->cons, ring->prod); | ring->cons, ring->prod); | ||||
Show All 19 Lines | |||||
static bool | static bool | ||||
mlx4_en_tx_ring_is_full(struct mlx4_en_tx_ring *ring) | mlx4_en_tx_ring_is_full(struct mlx4_en_tx_ring *ring) | ||||
{ | { | ||||
int wqs; | int wqs; | ||||
wqs = ring->size - (ring->prod - ring->cons); | wqs = ring->size - (ring->prod - ring->cons); | ||||
return (wqs < (HEADROOM + (2 * MLX4_EN_TX_WQE_MAX_WQEBBS))); | return (wqs < (HEADROOM + (2 * MLX4_EN_TX_WQE_MAX_WQEBBS))); | ||||
} | } | ||||
static int mlx4_en_process_tx_cq(struct net_device *dev, | static int mlx4_en_process_tx_cq(struct ifnet *dev, | ||||
struct mlx4_en_cq *cq) | struct mlx4_en_cq *cq) | ||||
{ | { | ||||
struct mlx4_en_priv *priv = netdev_priv(dev); | struct mlx4_en_priv *priv = netdev_priv(dev); | ||||
struct mlx4_cq *mcq = &cq->mcq; | struct mlx4_cq *mcq = &cq->mcq; | ||||
struct mlx4_en_tx_ring *ring = priv->tx_ring[cq->ring]; | struct mlx4_en_tx_ring *ring = priv->tx_ring[cq->ring]; | ||||
struct mlx4_cqe *cqe; | struct mlx4_cqe *cqe; | ||||
u16 index; | u16 index; | ||||
u16 new_index, ring_index, stamp_index; | u16 new_index, ring_index, stamp_index; | ||||
▲ Show 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | static void hashrandom_init(void *arg) | ||||
/* | /* | ||||
* It is assumed that the random subsystem has been | * It is assumed that the random subsystem has been | ||||
* initialized when this function is called: | * initialized when this function is called: | ||||
*/ | */ | ||||
hashrandom = m_ether_tcpip_hash_init(); | hashrandom = m_ether_tcpip_hash_init(); | ||||
} | } | ||||
SYSINIT(hashrandom_init, SI_SUB_RANDOM, SI_ORDER_ANY, &hashrandom_init, NULL); | SYSINIT(hashrandom_init, SI_SUB_RANDOM, SI_ORDER_ANY, &hashrandom_init, NULL); | ||||
u16 mlx4_en_select_queue(struct net_device *dev, struct mbuf *mb) | u16 mlx4_en_select_queue(struct ifnet *dev, struct mbuf *mb) | ||||
{ | { | ||||
struct mlx4_en_priv *priv = netdev_priv(dev); | struct mlx4_en_priv *priv = netdev_priv(dev); | ||||
u32 rings_p_up = priv->num_tx_rings_p_up; | u32 rings_p_up = priv->num_tx_rings_p_up; | ||||
u32 up = 0; | u32 up = 0; | ||||
u32 queue_index; | u32 queue_index; | ||||
#if (MLX4_EN_NUM_UP > 1) | #if (MLX4_EN_NUM_UP > 1) | ||||
/* Obtain VLAN information if present */ | /* Obtain VLAN information if present */ | ||||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |