FreeBSD/sys/dev/bxe/bxe.c
/*
 * The aggregation on the current TPA queue has completed. Pull the individual
 * mbuf fragments together into a single mbuf, perform all necessary checksum
 * calculations, and send the resuting mbuf to the stack.
 */
The aggregation on the current TPA queue has completed. Pull the individual
mbuf fragments together into a single mbuf, perform all necessary checksum
calculations, and send the resuting mbuf to the stack.
The aggregation on the current TPA queue has completed . Pull the individual mbuf fragments together into a single mbuf perform all necessary checksum calculations and send the resuting mbuf to the stack .
static void
bxe_tpa_stop(struct bxe_softc          *sc,
             struct bxe_fastpath       *fp,
             struct bxe_sw_tpa_info    *tpa_info,
             uint16_t                  queue,
             uint16_t                  pages,
			 struct eth_end_agg_rx_cqe *cqe,
             uint16_t                  cqe_idx)
{
    if_t ifp = sc->ifp;
    struct mbuf *m;
    int rc = 0;
    BLOGD(sc, DBG_LRO,
          "fp[%02d].tpa[%02d] pad=%d pkt_len=%d pages=%d vlan=%d\n",
          fp->index, queue, tpa_info->placement_offset,
          le16toh(cqe->pkt_len), pages, tpa_info->vlan_tag);
    m = tpa_info->bd.m;
    rc = bxe_alloc_rx_tpa_mbuf(fp, queue);
    if (rc) {
        fp->eth_q_stats.rx_soft_errors++;
        goto bxe_tpa_stop_exit;
    }
    m_adj(m, tpa_info->placement_offset);
    m->m_pkthdr.len = m->m_len = tpa_info->len_on_bd;
    fp->eth_q_stats.rx_ofld_frames_csum_ip++;
    fp->eth_q_stats.rx_ofld_frames_csum_tcp_udp++;
    m->m_pkthdr.csum_data = 0xffff;
    m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED |
                               CSUM_IP_VALID   |
                               CSUM_DATA_VALID |
                               CSUM_PSEUDO_HDR);
    rc = bxe_fill_frag_mbuf(sc, fp, tpa_info, queue, pages, m, cqe, cqe_idx);
    if (rc) {
        fp->eth_q_stats.rx_soft_errors++;
        m_freem(m);
    } else {
        if (tpa_info->parsing_flags & PARSING_FLAGS_INNER_VLAN_EXIST) {
            m->m_pkthdr.ether_vtag = tpa_info->vlan_tag;
            m->m_flags |= M_VLANTAG;
        }
        if_setrcvif(m, ifp);
#if __FreeBSD_version >= 800000
        m->m_pkthdr.flowid = fp->index;
        BXE_SET_FLOWID(m);
#endif
        if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
        fp->eth_q_stats.rx_tpa_pkts++;
        if_input(ifp, m);
    }
    fp->eth_q_stats.mbuf_alloc_tpa--;
bxe_tpa_stop_exit:
    fp->rx_tpa_info[queue].state = BXE_TPA_STATE_STOP;
    fp->rx_tpa_queue_used &= ~(1 << queue);
}
static void bxe_tpa_stop ( struct bxe_softc * sc , struct bxe_fastpath * fp , struct bxe_sw_tpa_info * tpa_info , uint16_t queue , uint16_t pages , struct eth_end_agg_rx_cqe * cqe , uint16_t cqe_idx ) { if_t ifp = sc -> ifp ; struct mbuf * m ; int rc = 0 ; BLOGD ( sc , DBG_LRO , " \n " , fp -> index , queue , tpa_info -> placement_offset , le16toh ( cqe -> pkt_len ) , pages , tpa_info -> vlan_tag ) ; m = tpa_info -> bd . m ; rc = bxe_alloc_rx_tpa_mbuf ( fp , queue ) ; if ( rc ) { fp -> eth_q_stats . rx_soft_errors ++ ; goto bxe_tpa_stop_exit ; } m_adj ( m , tpa_info -> placement_offset ) ; m -> m_pkthdr . len = m -> m_len = tpa_info -> len_on_bd ; fp -> eth_q_stats . rx_ofld_frames_csum_ip ++ ; fp -> eth_q_stats . rx_ofld_frames_csum_tcp_udp ++ ; m -> m_pkthdr . csum_data = 0xffff ; m -> m_pkthdr . csum_flags |= ( CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR ) ; rc = bxe_fill_frag_mbuf ( sc , fp , tpa_info , queue , pages , m , cqe , cqe_idx ) ; if ( rc ) { fp -> eth_q_stats . rx_soft_errors ++ ; m_freem ( m ) ; } else { if ( tpa_info -> parsing_flags & PARSING_FLAGS_INNER_VLAN_EXIST ) { m -> m_pkthdr . ether_vtag = tpa_info -> vlan_tag ; m -> m_flags |= M_VLANTAG ; } if_setrcvif ( m , ifp ) ; #if __FreeBSD_version >= 800000 m -> m_pkthdr . flowid = fp -> index ; BXE_SET_FLOWID ( m ) ; #endif if_inc_counter ( ifp , IFCOUNTER_IPACKETS , 1 ) ; fp -> eth_q_stats . rx_tpa_pkts ++ ; if_input ( ifp , m ) ; } fp -> eth_q_stats . mbuf_alloc_tpa -- ; bxe_tpa_stop_exit : fp -> rx_tpa_info [ queue ] . state = BXE_TPA_STATE_STOP ; fp -> rx_tpa_queue_used &= ~ ( 1 << queue ) ; }
The aggregation on the current TPA queue has completed.
The aggregation on the current TPA queue has completed .
/* allocate a replacement before modifying existing mbuf */ /* drop the frame and log an error */ /* we have a replacement, fixup the current mbuf */ /* mark the checksums valid (taken care of by the firmware) */ /* aggregate all of the SGEs into a single mbuf */ /* drop the packet and log an error */ /* assign packet to this interface interface */ /* specify what RSS queue was used for this flow */ /* pass the frame to the stack */ /* we passed an mbuf up the stack or dropped the frame */