Index: head/sys/dev/ena/ena.h =================================================================== --- head/sys/dev/ena/ena.h +++ head/sys/dev/ena/ena.h @@ -215,6 +215,7 @@ counter_u64_t bytes; counter_u64_t refil_partial; counter_u64_t bad_csum; + counter_u64_t mjum_alloc_fail; counter_u64_t mbuf_alloc_fail; counter_u64_t dma_mapping_err; counter_u64_t bad_desc_num; Index: head/sys/dev/ena/ena.c =================================================================== --- head/sys/dev/ena/ena.c +++ head/sys/dev/ena/ena.c @@ -549,7 +549,7 @@ BUS_SPACE_MAXADDR, /* highaddr of excl window */ NULL, NULL, /* filter, filterarg */ MJUM16BYTES, /* maxsize */ - 1, /* nsegments */ + adapter->max_rx_sgl_size, /* nsegments */ MJUM16BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ @@ -950,6 +950,7 @@ struct ena_com_buf *ena_buf; bus_dma_segment_t segs[1]; int nsegs, error; + int mlen; /* if previous allocated frag is not used */ if (unlikely(rx_info->mbuf != NULL)) @@ -959,11 +960,18 @@ rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); if (unlikely(rx_info->mbuf == NULL)) { - counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); - return (ENOMEM); + counter_u64_add(rx_ring->rx_stats.mjum_alloc_fail, 1); + rx_info->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (unlikely(rx_info->mbuf == NULL)) { + counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); + return (ENOMEM); + } + mlen = MCLBYTES; + } else { + mlen = MJUM16BYTES; } /* Set mbuf length*/ - rx_info->mbuf->m_pkthdr.len = rx_info->mbuf->m_len = MJUM16BYTES; + rx_info->mbuf->m_pkthdr.len = rx_info->mbuf->m_len = mlen; /* Map packets for DMA */ ena_trace(ENA_DBG | ENA_RSC | ENA_RXPTH, @@ -983,7 +991,7 @@ ena_buf = &rx_info->ena_buf; ena_buf->paddr = segs[0].ds_addr; - ena_buf->len = MJUM16BYTES; + ena_buf->len = mlen; ena_trace(ENA_DBG | ENA_RSC | ENA_RXPTH, "ALLOC RX BUF: mbuf %p, rx_info %p, len %d, paddr %#jx\n", Index: head/sys/dev/ena/ena_sysctl.c =================================================================== --- head/sys/dev/ena/ena_sysctl.c +++ head/sys/dev/ena/ena_sysctl.c @@ -200,6 +200,9 @@ "mbuf_alloc_fail", CTLFLAG_RD, &rx_stats->mbuf_alloc_fail, "Failed mbuf allocs"); SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, + "mjum_alloc_fail", CTLFLAG_RD, + &rx_stats->mjum_alloc_fail, "Failed jumbo mbuf allocs"); + SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "dma_mapping_err", CTLFLAG_RD, &rx_stats->dma_mapping_err, "DMA mapping errors"); SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO,