Project

General

Profile

Actions

Task #1293

open

Reserve buffer space when receiving packets on all faces

Added by Alex Afanasyev over 10 years ago. Updated about 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Faces
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When receiving packets on all faces, we need to reserve some space in front and at the back of the packet. This will reduce number of copy operations (ideally to just first initial copy).

Actions #1

Updated by Junxiao Shi over 10 years ago

Please explain:

  • What scenarios would need copying ?
  • Why reserving buffer space can reduce copying?
  • How to calculate how much buffer space should be reserved?
Actions #2

Updated by Davide Pesavento over 10 years ago

One example is the TX path of EthernetFace. When the ethernet packet is constructed, the link layer header must be prepended to the serialized TLV, and in some cases padding must be added after it. If the buffer already has some headroom and tailroom, that space can be filled with the aforementioned data, thus saving a memory allocation and a copy operation.

The ethernet header size is fixed (14 bytes), so the headroom could just be static.
The tailroom must be at least max(0, ethernet::MIN_DATA_LEN - data.size()) in the ethernet case.

An skbuff-like mechanism or scatter/gather would solve this nicely.

Actions #3

Updated by Alex Afanasyev over 10 years ago

I think I created this issue before I discovered scatter/gather capability in boost.asio.

Actions #4

Updated by Davide Pesavento over 10 years ago

EthernetFace does not use boost to send and receive packets...

Actions #5

Updated by Junxiao Shi over 10 years ago

  • Target version deleted (v0.2)

20140514 meeting decides to defer this performance optimization.

Alex or Davide should write more about what's the problem.

Actions #6

Updated by Junxiao Shi about 10 years ago

20141114 conference call urges Alex to complete the definition of this problem.

Actions

Also available in: Atom PDF