Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx4/mlx4_en/en.h
Show All 33 Lines | |||||
#ifndef _MLX4_EN_H_ | #ifndef _MLX4_EN_H_ | ||||
#define _MLX4_EN_H_ | #define _MLX4_EN_H_ | ||||
#include <linux/bitops.h> | #include <linux/bitops.h> | ||||
#include <linux/compiler.h> | #include <linux/compiler.h> | ||||
#include <linux/list.h> | #include <linux/list.h> | ||||
#include <linux/mutex.h> | #include <linux/mutex.h> | ||||
#include <linux/kobject.h> | #include <linux/kobject.h> | ||||
#include <linux/netdevice.h> | |||||
#include <linux/if_vlan.h> | #include <linux/if_vlan.h> | ||||
#include <linux/if_ether.h> | #include <linux/if_ether.h> | ||||
#ifdef CONFIG_MLX4_EN_DCB | #ifdef CONFIG_MLX4_EN_DCB | ||||
#include <linux/dcbnl.h> | #include <linux/dcbnl.h> | ||||
#endif | #endif | ||||
#include <sys/socket.h> | |||||
#include <sys/taskqueue.h> | |||||
#include <net/if_types.h> | |||||
#include <net/if.h> | |||||
#include <net/if_var.h> | |||||
#include <net/if_dl.h> | |||||
#include <dev/mlx4/device.h> | #include <dev/mlx4/device.h> | ||||
#include <dev/mlx4/qp.h> | #include <dev/mlx4/qp.h> | ||||
#include <dev/mlx4/cq.h> | #include <dev/mlx4/cq.h> | ||||
#include <dev/mlx4/srq.h> | #include <dev/mlx4/srq.h> | ||||
#include <dev/mlx4/doorbell.h> | #include <dev/mlx4/doorbell.h> | ||||
#include <dev/mlx4/cmd.h> | #include <dev/mlx4/cmd.h> | ||||
#include <net/debugnet.h> | #include <net/debugnet.h> | ||||
▲ Show 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | |||||
struct mlx4_mac_entry { | struct mlx4_mac_entry { | ||||
struct hlist_node hlist; | struct hlist_node hlist; | ||||
unsigned char mac[ETH_ALEN + 2]; | unsigned char mac[ETH_ALEN + 2]; | ||||
u64 reg_id; | u64 reg_id; | ||||
}; | }; | ||||
static inline void * | static inline void * | ||||
netdev_priv(const struct ifnet *dev) | mlx4_netdev_priv(const struct ifnet *dev) | ||||
{ | { | ||||
return (dev->if_softc); | return (dev->if_softc); | ||||
} | } | ||||
static inline struct mlx4_cqe *mlx4_en_get_cqe(u8 *buf, int idx, int cqe_sz) | static inline struct mlx4_cqe *mlx4_en_get_cqe(u8 *buf, int idx, int cqe_sz) | ||||
{ | { | ||||
return (struct mlx4_cqe *)(buf + idx * cqe_sz); | return (struct mlx4_cqe *)(buf + idx * cqe_sz); | ||||
} | } | ||||
Show All 38 Lines | |||||
/* called from mlx4_en_low_latency_poll() */ | /* called from mlx4_en_low_latency_poll() */ | ||||
static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) | static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) | ||||
{ | { | ||||
int rc = true; | int rc = true; | ||||
spin_lock_bh(&cq->poll_lock); | spin_lock_bh(&cq->poll_lock); | ||||
if ((cq->state & MLX4_CQ_LOCKED)) { | if ((cq->state & MLX4_CQ_LOCKED)) { | ||||
struct ifnet *dev = cq->dev; | struct ifnet *dev = cq->dev; | ||||
struct mlx4_en_priv *priv = netdev_priv(dev); | struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); | ||||
struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; | struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; | ||||
cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD; | cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD; | ||||
rc = false; | rc = false; | ||||
#ifdef LL_EXTENDED_STATS | #ifdef LL_EXTENDED_STATS | ||||
rx_ring->yields++; | rx_ring->yields++; | ||||
#endif | #endif | ||||
} else | } else | ||||
▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines |