FreeBSD/sys/dev/vnic/nicvf_queues.c
/* Check for errors in the receive cmp.queue entry */
Check for errors in the receive cmp.queue entry
Check for errors in the receive cmp . queue entry
int
nicvf_check_cqe_rx_errs(struct nicvf *nic, struct cmp_queue *cq,
    struct cqe_rx_t *cqe_rx)
{
	struct nicvf_hw_stats *stats = &nic->hw_stats;
	struct nicvf_drv_stats *drv_stats = &nic->drv_stats;
	if (!cqe_rx->err_level && !cqe_rx->err_opcode) {
		drv_stats->rx_frames_ok++;
		return (0);
	}
	switch (cqe_rx->err_opcode) {
	case CQ_RX_ERROP_RE_PARTIAL:
		stats->rx_bgx_truncated_pkts++;
		break;
	case CQ_RX_ERROP_RE_JABBER:
		stats->rx_jabber_errs++;
		break;
	case CQ_RX_ERROP_RE_FCS:
		stats->rx_fcs_errs++;
		break;
	case CQ_RX_ERROP_RE_RX_CTL:
		stats->rx_bgx_errs++;
		break;
	case CQ_RX_ERROP_PREL2_ERR:
		stats->rx_prel2_errs++;
		break;
	case CQ_RX_ERROP_L2_MAL:
		stats->rx_l2_hdr_malformed++;
		break;
	case CQ_RX_ERROP_L2_OVERSIZE:
		stats->rx_oversize++;
		break;
	case CQ_RX_ERROP_L2_UNDERSIZE:
		stats->rx_undersize++;
		break;
	case CQ_RX_ERROP_L2_LENMISM:
		stats->rx_l2_len_mismatch++;
		break;
	case CQ_RX_ERROP_L2_PCLP:
		stats->rx_l2_pclp++;
		break;
	case CQ_RX_ERROP_IP_NOT:
		stats->rx_ip_ver_errs++;
		break;
	case CQ_RX_ERROP_IP_CSUM_ERR:
		stats->rx_ip_csum_errs++;
		break;
	case CQ_RX_ERROP_IP_MAL:
		stats->rx_ip_hdr_malformed++;
		break;
	case CQ_RX_ERROP_IP_MALD:
		stats->rx_ip_payload_malformed++;
		break;
	case CQ_RX_ERROP_IP_HOP:
		stats->rx_ip_ttl_errs++;
		break;
	case CQ_RX_ERROP_L3_PCLP:
		stats->rx_l3_pclp++;
		break;
	case CQ_RX_ERROP_L4_MAL:
		stats->rx_l4_malformed++;
		break;
	case CQ_RX_ERROP_L4_CHK:
		stats->rx_l4_csum_errs++;
		break;
	case CQ_RX_ERROP_UDP_LEN:
		stats->rx_udp_len_errs++;
		break;
	case CQ_RX_ERROP_L4_PORT:
		stats->rx_l4_port_errs++;
		break;
	case CQ_RX_ERROP_TCP_FLAG:
		stats->rx_tcp_flag_errs++;
		break;
	case CQ_RX_ERROP_TCP_OFFSET:
		stats->rx_tcp_offset_errs++;
		break;
	case CQ_RX_ERROP_L4_PCLP:
		stats->rx_l4_pclp++;
		break;
	case CQ_RX_ERROP_RBDR_TRUNC:
		stats->rx_truncated_pkts++;
		break;
	}
	return (1);
}
int nicvf_check_cqe_rx_errs ( struct nicvf * nic , struct cmp_queue * cq , struct cqe_rx_t * cqe_rx ) { struct nicvf_hw_stats * stats = & nic -> hw_stats ; struct nicvf_drv_stats * drv_stats = & nic -> drv_stats ; if ( ! cqe_rx -> err_level && ! cqe_rx -> err_opcode ) { drv_stats -> rx_frames_ok ++ ; return ( 0 ) ; } switch ( cqe_rx -> err_opcode ) { case CQ_RX_ERROP_RE_PARTIAL : stats -> rx_bgx_truncated_pkts ++ ; break ; case CQ_RX_ERROP_RE_JABBER : stats -> rx_jabber_errs ++ ; break ; case CQ_RX_ERROP_RE_FCS : stats -> rx_fcs_errs ++ ; break ; case CQ_RX_ERROP_RE_RX_CTL : stats -> rx_bgx_errs ++ ; break ; case CQ_RX_ERROP_PREL2_ERR : stats -> rx_prel2_errs ++ ; break ; case CQ_RX_ERROP_L2_MAL : stats -> rx_l2_hdr_malformed ++ ; break ; case CQ_RX_ERROP_L2_OVERSIZE : stats -> rx_oversize ++ ; break ; case CQ_RX_ERROP_L2_UNDERSIZE : stats -> rx_undersize ++ ; break ; case CQ_RX_ERROP_L2_LENMISM : stats -> rx_l2_len_mismatch ++ ; break ; case CQ_RX_ERROP_L2_PCLP : stats -> rx_l2_pclp ++ ; break ; case CQ_RX_ERROP_IP_NOT : stats -> rx_ip_ver_errs ++ ; break ; case CQ_RX_ERROP_IP_CSUM_ERR : stats -> rx_ip_csum_errs ++ ; break ; case CQ_RX_ERROP_IP_MAL : stats -> rx_ip_hdr_malformed ++ ; break ; case CQ_RX_ERROP_IP_MALD : stats -> rx_ip_payload_malformed ++ ; break ; case CQ_RX_ERROP_IP_HOP : stats -> rx_ip_ttl_errs ++ ; break ; case CQ_RX_ERROP_L3_PCLP : stats -> rx_l3_pclp ++ ; break ; case CQ_RX_ERROP_L4_MAL : stats -> rx_l4_malformed ++ ; break ; case CQ_RX_ERROP_L4_CHK : stats -> rx_l4_csum_errs ++ ; break ; case CQ_RX_ERROP_UDP_LEN : stats -> rx_udp_len_errs ++ ; break ; case CQ_RX_ERROP_L4_PORT : stats -> rx_l4_port_errs ++ ; break ; case CQ_RX_ERROP_TCP_FLAG : stats -> rx_tcp_flag_errs ++ ; break ; case CQ_RX_ERROP_TCP_OFFSET : stats -> rx_tcp_offset_errs ++ ; break ; case CQ_RX_ERROP_L4_PCLP : stats -> rx_l4_pclp ++ ; break ; case CQ_RX_ERROP_RBDR_TRUNC : stats -> rx_truncated_pkts ++ ; break ; } return ( 1 ) ; }
Check for errors in the receive cmp.queue entry
Check for errors in the receive cmp . queue entry