Index: stable/11/sys/dev/ixl/if_ixl.c =================================================================== --- stable/11/sys/dev/ixl/if_ixl.c +++ stable/11/sys/dev/ixl/if_ixl.c @@ -659,13 +659,7 @@ #endif #ifdef DEV_NETMAP - if (vsi->num_rx_desc == vsi->num_tx_desc) { - vsi->queues[0].num_desc = vsi->num_rx_desc; - ixl_netmap_attach(vsi); - } else - device_printf(dev, - "Netmap is not supported when RX and TX descriptor ring sizes differ\n"); - + ixl_netmap_attach(vsi); #endif /* DEV_NETMAP */ #ifdef IXL_IW Index: stable/11/sys/dev/ixl/ixl.h =================================================================== --- stable/11/sys/dev/ixl/ixl.h +++ stable/11/sys/dev/ixl/ixl.h @@ -513,9 +513,6 @@ void *tag; int num_tx_desc; /* both tx and rx */ int num_rx_desc; /* both tx and rx */ -#ifdef DEV_NETMAP - int num_desc; /* for compatibility with current netmap code in kernel */ -#endif struct tx_ring txr; struct rx_ring rxr; struct task task; Index: stable/11/sys/dev/ixl/ixl_txrx.c =================================================================== --- stable/11/sys/dev/ixl/ixl_txrx.c +++ stable/11/sys/dev/ixl/ixl_txrx.c @@ -1587,7 +1587,7 @@ struct ixl_rx_buf *rbuf; KASSERT(rxr != NULL, ("Receive ring pointer cannot be null")); - KASSERT(i < rxr->que->num_rx_desc, ("Descriptor index must be less than que->num_desc")); + KASSERT(i < rxr->que->num_rx_desc, ("Descriptor index must be less than que->num_rx_desc")); rbuf = &rxr->buffers[i]; Index: stable/11/sys/dev/netmap/if_ixl_netmap.h =================================================================== --- stable/11/sys/dev/netmap/if_ixl_netmap.h +++ stable/11/sys/dev/netmap/if_ixl_netmap.h @@ -129,12 +129,8 @@ na.ifp = vsi->ifp; na.na_flags = NAF_BDG_MAYSLEEP; - // XXX check that queues is set. - nm_prinf("queues is %p", vsi->queues); - if (vsi->queues) { - na.num_tx_desc = vsi->queues[0].num_desc; - na.num_rx_desc = vsi->queues[0].num_desc; - } + na.num_tx_desc = vsi->num_tx_desc; + na.num_rx_desc = vsi->num_rx_desc; na.nm_txsync = ixl_netmap_txsync; na.nm_rxsync = ixl_netmap_rxsync; na.nm_register = ixl_netmap_reg; @@ -266,8 +262,10 @@ /* * Second part: reclaim buffers for completed transmissions. */ - nic_i = LE32_TO_CPU(*(volatile __le32 *)&txr->base[que->num_desc]); - if (nic_i != txr->next_to_clean) { + nic_i = LE32_TO_CPU(*(volatile __le32 *)&txr->base[que->num_tx_desc]); + if (unlikely(nic_i >= que->num_tx_desc)) { + nm_prerr("error: invalid value of hw head index %u", nic_i); + } else if (nic_i != txr->next_to_clean) { /* some tx completed, increment avail */ txr->next_to_clean = nic_i; kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, nic_i), lim);