Page MenuHomeFreeBSD

Add support for packet batching in ifnet
AcceptedPublic

Authored by mmacy on May 8 2018, 12:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 2:23 AM
Unknown Object (File)
Sep 2 2023, 2:17 AM
Unknown Object (File)
Jun 3 2023, 1:47 AM
Unknown Object (File)
May 16 2023, 9:07 PM
Unknown Object (File)
May 14 2023, 6:25 AM

Details

Summary

This adds two new functions to ifnet:

if_transmit_txq(): equivalent to if_transmit but will handle multiple packets bound for a given hardware queue

if_mbuf_to_qid(): allows the caller to verify if a list of packets is all bound for the same hardware queue allowing opportunistic batching of > TSO sized batches of data

Part of VPC upstreaming (important for minimizing passes through the VPC stack).

Interface suggested by np@ in an email exchange.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/net/if.c
4505

Looks like an empty line snuck in here.

It would be nice to have this patch together with at least one example of a caller and one example of a NIC driver implementing the API.

sys/net/if.c
3964

Is there a leak here?

At this point, the NIC's if_transmit() method will have freed mp. The remainder of the packets are reachable only via mnext, however that's a local which goes away as soon as you return. So even if the caller tried, it could not free the unsent packets in the chain. So I think you need to free them here.

It would be nice to have this patch together with at least one example of a caller and one example of a NIC driver implementing the API.

It's used pervasively in VPC:
https://reviews.freebsd.org/D15356

But I'll add in tree iflib as a consumer to this review.

Appoved pending update for an iflib consumer.

This revision is now accepted and ready to land.May 11 2018, 11:33 PM