On occasion I would get the "Oversized header or SG list" error. It might have been due to having too few TXBB slots for the number of fragments.
Our TCP stack doesn't limit the number of EBDs it sends down the pipe yet. In lieu of breaking the block into multiple blocks, we can linearize it. I had the same issue with r8169. The longer term fixes: - Maybe a helper that breaks a block, but it'd need to maintain the headers, to include the length fields. - Peak at the first block in the queue or otherwise block until there is enough room. Need to be careful that we don't get a block that has more EBDs than the NIC has SG slots. - Give TCP (and other block producers) a way to know the max number of EBDs. - Just use 16. I somewhat like the notion of having a limit and then have the helper break the block at the appropriate layer, since you might not know where a block is going when you create it. (Though TCP does - we do this with MSS already). Signed-off-by: Barret Rhoden <[email protected]> --- Merged to master at 3751ae416e9f..be1925fb29c9 (from, to] You can see the entire diff with 'git diff' or at https://github.com/brho/akaros/compare/3751ae416e9f...be1925fb29c9 kern/drivers/net/mlx4/en_tx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kern/drivers/net/mlx4/en_tx.c b/kern/drivers/net/mlx4/en_tx.c index ab51ae15e461..36db4ab6b498 100644 --- a/kern/drivers/net/mlx4/en_tx.c +++ b/kern/drivers/net/mlx4/en_tx.c @@ -1299,6 +1299,11 @@ void __mlx4_xmit_poke(void *args) block = qget(edev->oq); if (!block) break; + /* This estimate might be off a little. I think the driver is expecting + * 16 (Linux's MAX_SKB_FRAGS). I base that in part on the comment in + * mlx4_en.h (grep "Typical TSO"). */ + if (block->nr_extra_bufs > MAX_SKB_FRAGS) + block = linearizeblock(block); mlx4_send_packet(block, priv, ring); } } -- 2.15.1.504.g5279b80103-goog -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
