Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/qlxgbe/ql_isr.c
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
* Name: qla_rx_intr | * Name: qla_rx_intr | ||||
* Function: Handles normal ethernet frames received | * Function: Handles normal ethernet frames received | ||||
*/ | */ | ||||
static void | static void | ||||
qla_rx_intr(qla_host_t *ha, qla_sgl_rcv_t *sgc, uint32_t sds_idx) | qla_rx_intr(qla_host_t *ha, qla_sgl_rcv_t *sgc, uint32_t sds_idx) | ||||
{ | { | ||||
qla_rx_buf_t *rxb; | qla_rx_buf_t *rxb; | ||||
struct mbuf *mp = NULL, *mpf = NULL, *mpl = NULL; | struct mbuf *mp = NULL, *mpf = NULL, *mpl = NULL; | ||||
struct ifnet *ifp = ha->ifp; | if_t ifp = ha->ifp; | ||||
qla_sds_t *sdsp; | qla_sds_t *sdsp; | ||||
struct ether_vlan_header *eh; | struct ether_vlan_header *eh; | ||||
uint32_t i, rem_len = 0; | uint32_t i, rem_len = 0; | ||||
uint32_t r_idx = 0; | uint32_t r_idx = 0; | ||||
qla_rx_ring_t *rx_ring; | qla_rx_ring_t *rx_ring; | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
struct lro_ctrl *lro; | struct lro_ctrl *lro; | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | #endif | ||||
M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE_HASH); | M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE_HASH); | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
if (ha->hw.enable_soft_lro) | if (ha->hw.enable_soft_lro) | ||||
tcp_lro_queue_mbuf(lro, mpf); | tcp_lro_queue_mbuf(lro, mpf); | ||||
else | else | ||||
#endif | #endif | ||||
(*ifp->if_input)(ifp, mpf); | if_input(ifp, mpf); | ||||
if (sdsp->rx_free > ha->std_replenish) | if (sdsp->rx_free > ha->std_replenish) | ||||
qla_replenish_normal_rx(ha, sdsp, r_idx); | qla_replenish_normal_rx(ha, sdsp, r_idx); | ||||
return; | return; | ||||
} | } | ||||
#define QLA_TCP_HDR_SIZE 20 | #define QLA_TCP_HDR_SIZE 20 | ||||
#define QLA_TCP_TS_OPTION_SIZE 12 | #define QLA_TCP_TS_OPTION_SIZE 12 | ||||
/* | /* | ||||
* Name: qla_lro_intr | * Name: qla_lro_intr | ||||
* Function: Handles normal ethernet frames received | * Function: Handles normal ethernet frames received | ||||
*/ | */ | ||||
static int | static int | ||||
qla_lro_intr(qla_host_t *ha, qla_sgl_lro_t *sgc, uint32_t sds_idx) | qla_lro_intr(qla_host_t *ha, qla_sgl_lro_t *sgc, uint32_t sds_idx) | ||||
{ | { | ||||
qla_rx_buf_t *rxb; | qla_rx_buf_t *rxb; | ||||
struct mbuf *mp = NULL, *mpf = NULL, *mpl = NULL; | struct mbuf *mp = NULL, *mpf = NULL, *mpl = NULL; | ||||
struct ifnet *ifp = ha->ifp; | if_t ifp = ha->ifp; | ||||
qla_sds_t *sdsp; | qla_sds_t *sdsp; | ||||
struct ether_vlan_header *eh; | struct ether_vlan_header *eh; | ||||
uint32_t i, rem_len = 0, pkt_length, iplen; | uint32_t i, rem_len = 0, pkt_length, iplen; | ||||
struct tcphdr *th; | struct tcphdr *th; | ||||
struct ip *ip = NULL; | struct ip *ip = NULL; | ||||
struct ip6_hdr *ip6 = NULL; | struct ip6_hdr *ip6 = NULL; | ||||
uint16_t etype; | uint16_t etype; | ||||
uint32_t r_idx = 0; | uint32_t r_idx = 0; | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | qla_lro_intr(qla_host_t *ha, qla_sgl_lro_t *sgc, uint32_t sds_idx) | ||||
mpf->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID | | mpf->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID | | ||||
CSUM_DATA_VALID | CSUM_PSEUDO_HDR; | CSUM_DATA_VALID | CSUM_PSEUDO_HDR; | ||||
mpf->m_pkthdr.csum_data = 0xFFFF; | mpf->m_pkthdr.csum_data = 0xFFFF; | ||||
mpf->m_pkthdr.flowid = sgc->rss_hash; | mpf->m_pkthdr.flowid = sgc->rss_hash; | ||||
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); | if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); | ||||
(*ifp->if_input)(ifp, mpf); | if_input(ifp, mpf); | ||||
if (sdsp->rx_free > ha->std_replenish) | if (sdsp->rx_free > ha->std_replenish) | ||||
qla_replenish_normal_rx(ha, sdsp, r_idx); | qla_replenish_normal_rx(ha, sdsp, r_idx); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 591 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
ql_isr(void *arg) | ql_isr(void *arg) | ||||
{ | { | ||||
qla_ivec_t *ivec = arg; | qla_ivec_t *ivec = arg; | ||||
qla_host_t *ha ; | qla_host_t *ha ; | ||||
int idx; | int idx; | ||||
qla_hw_t *hw; | qla_hw_t *hw; | ||||
struct ifnet *ifp; | if_t ifp; | ||||
qla_tx_fp_t *fp; | qla_tx_fp_t *fp; | ||||
ha = ivec->ha; | ha = ivec->ha; | ||||
hw = &ha->hw; | hw = &ha->hw; | ||||
ifp = ha->ifp; | ifp = ha->ifp; | ||||
if ((idx = ivec->sds_idx) >= ha->hw.num_sds_rings) | if ((idx = ivec->sds_idx) >= ha->hw.num_sds_rings) | ||||
return; | return; | ||||
fp = &ha->tx_fp[idx]; | fp = &ha->tx_fp[idx]; | ||||
hw->sds[idx].intr_count++; | hw->sds[idx].intr_count++; | ||||
if ((fp->fp_taskqueue != NULL) && | if ((fp->fp_taskqueue != NULL) && | ||||
(ifp->if_drv_flags & IFF_DRV_RUNNING)) | (if_getdrvflags(ifp) & IFF_DRV_RUNNING)) | ||||
taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task); | taskqueue_enqueue(fp->fp_taskqueue, &fp->fp_task); | ||||
return; | return; | ||||
} | } |