Skip to content

Add sendmmsg vector IO support#2

Open
kot-begemot-uk wants to merge 20 commits into
wdebruij:masterfrom
kot-begemot-uk:add_vector_support
Open

Add sendmmsg vector IO support#2
kot-begemot-uk wants to merge 20 commits into
wdebruij:masterfrom
kot-begemot-uk:add_vector_support

Conversation

@kot-begemot-uk

Copy link
Copy Markdown
  1. Add an option to send using sendmmsg
  2. Reorganize packet creation to match sendmmsg semantics
  3. Allow for the creation of packets split in 3:
    vmesg header, header, body - this matches the format
    that would be generated in a kernel skb is converted
    to an iov.

Signed-off-by: Anton Ivanov anton.ivanov@cambridgegreys.com

wdebruij and others added 20 commits July 3, 2014 15:21
A benchmark process that creates multiple packet sockets in a single
fanout group. It spawns one process per socket and pins each process
to its own core. Each process reads the packets arriving on that cpu.
The socket group has flag PACKET_FANOUT_FLAG_ROLLOVER enabled, so
that a saturated cpu can offload packets to others in the group.

Use this with a remote packet generator (such as pktgen.ko) to cause
high load. Send a single 4-tuple to cause load imbalance. To create
socket overload without saturating the physical link, limit the
processing rate of each socket reader process by passing -l $RATE.

Signed-off-by: Willem de Bruijn <willemb@google.com>
delay concurrent execution until the socket fanout group is completely
initialized.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Add a test that reads from a packet socket ring with both options
PACKET_RX_RING and PACKET_VNET_HDR enabled.
Add a test that writes over a packet socket both
- with and without PACKET_TX_RING
- with and without PACKET_VNET_HDR
Add
- PACKET_QDISC_BYPASS support
- Short input support
  - override length flag
  - drop CAP_SYS_RAWIO to force min length check in kernel

Fix
- Always allocate large enough ring slot
tcplate computes traffic shaping latency by reading egress
packet timestamps with nflog and packet sockets.

SO_TIMESTAMPING offers a more complete timestamping solution
for processes that own file descriptors. Tcplate is geared at
casual latency monitoring by administrators.
Allow passing a vnet_hdr to the packet socket without triggering
segmentation offload. This allows testing checksum offload on MTU
sized packets.
pingpong_tcpudp sends a simple echo request/response pair over
packet sockets, mimicing TCP or UDP headers.
1. Add an option to send using sendmmsg
2. Reorganize packet creation to match sendmmsg semantics
3. Allow for the creation of packets split in 3:
    vmesg header, header, body - this matches the format
    that would be generated in a kernel skb is converted
    to an iov.

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>

@wdebruij wdebruij left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing your code.

Point 3 is interesting: testing sendmsg with with vectors of more elements.

Point 1 is not needed. sendmmsg() is really a thin loop around sendmsg(). It helps performance centric workloads, but exercising that codepath does not add relevant code coverage for this functional af_packet test, while complicating the code. In general the patch has a lot of code churn. Also, dynamic allocation is failure prone, and indeed not freed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants