[illumos-Developer] vmxnet3s driver failing on debug builds due to dma_attr_sgllen == -1 (Bug #422)

Yuri Pankov yuri.pankov at gmail.com
Fri Feb 4 23:29:01 PST 2011


Hi,

While looking into the issue, I've found the following piece of code in
usr/src/uts/i86pc/io/rootnex.c, called only in debug builds:

/*
 * rootnex_valid_alloc_parms()
 *    Called in ddi_dma_alloc_handle path to validate its parameters.
 */
static int
rootnex_valid_alloc_parms(ddi_dma_attr_t *attr, uint_t maxsegmentsize)
...
        if ((attr->dma_attr_seg & MMU_PAGEOFFSET) != MMU_PAGEOFFSET ||
            MMU_PAGESIZE & (attr->dma_attr_granular - 1) ||
==>         attr->dma_attr_sgllen <= 0) {          <===
                return (DDI_DMA_BADATTR);
        }
...

vmxnet3s driver uses dma_attr_sgllen == -1, which is pretty ok according
to ddi_dma_attr(9S):
...
     < 0    Device DMA engine is not constrained by the size, for
            example, withDMA chaining.
...

Removing the check allows the driver to successfully start (and
function, I haven't tested the 10Gbps speed due to the lack of hardware,
but currently finishing 50GB transfer at 1Gbps speed). The check is
there from the OpenSolaris launch, so the my real question is - what of
the following sounds correct:
- the check is bogus and should be removed (or changed to == 0, which is
  reserved per manpage)
or
- documentation (ddi_dma_attr(9S), at least) should be updated and the
  driver should be "fixed".

TIA,
Yuri



More information about the Developer mailing list