Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Sep 2014 15:05:34 -0400
From:      Jeremiah Lott <jlott@averesystems.com>
To:        freebsd-xen@freebsd.org
Subject:   netfront driver with mbufs > 4K
Message-ID:  <CANG7ib9TQz3%2Bk2ubMqtp0_YwRVi-96U8ZSr%2BFyRrC5tmqfuMCQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
It seems the netback driver (at least in linux) cannot handle a fragment
passed to it that crosses a 4K boundary.  Here is the code from the linux
netback driver that enforces this:

if (unlikely((txp->offset + txp->size) > PAGE_SIZE)) {
    netdev_err(vif->dev, "Cross page boundary, txp->offset: %x, size:
%u\n", txp->offset, txp->size);
    xenvif_fatal_tx_err(vif);
    return -EINVAL;
}

The netfront driver in FreeBSD creates a fragment for each mbuf in the
chain, but does not check if the mbuf crosses a 4K boundary.  For mbufs
allocated from the zone_jumbo9 or zone_jumbo16 uma zones, it can create
fragments that are too large and/or cross a page boundary.  In this case
the netback stops responding, and the network interface appears to "hang".
 It is also a problem for mbufs that have external data attached to them
(as the data could be any size or alignment).

It seems that the netfront driver needs split mbufs that span page
boundaries into multiple fragments.  I'm starting to think about code to do
that, but I figured I'd put this out there if anyone has suggestions on
handling this.  Thanks,

  Jeremiah Lott
  Avere Systems



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANG7ib9TQz3%2Bk2ubMqtp0_YwRVi-96U8ZSr%2BFyRrC5tmqfuMCQ>