diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-09-26 23:38:22 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-09-27 01:28:02 +0200 |
commit | dd581730e54b934f80d5b6a820136707dc71c664 (patch) | |
tree | c58b140d407f4b308e1fc1d21703b444ea34cabd /passt.h | |
parent | dfc451319034f594037822b3193a30fa5715175f (diff) | |
download | passt-dd581730e54b934f80d5b6a820136707dc71c664.tar passt-dd581730e54b934f80d5b6a820136707dc71c664.tar.gz passt-dd581730e54b934f80d5b6a820136707dc71c664.tar.bz2 passt-dd581730e54b934f80d5b6a820136707dc71c664.tar.lz passt-dd581730e54b934f80d5b6a820136707dc71c664.tar.xz passt-dd581730e54b934f80d5b6a820136707dc71c664.tar.zst passt-dd581730e54b934f80d5b6a820136707dc71c664.zip |
tap: Completely de-serialise input message batches
Until now, messages would be passed to protocol handlers in a single
batch only if they happened to be dequeued in a row. Packets
interleaved between different connections would result in multiple
calls to the same protocol handler for a single connection.
Instead, keep track of incoming packet descriptors, arrange them in
sequences, and call protocol handlers only as we completely sorted
input messages in batches.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'passt.h')
-rw-r--r-- | passt.h | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -3,15 +3,21 @@ /** * struct tap_msg - Generic message descriptor for arrays of messages - * @start: Pointer to message start - * @l4_start: Pointer to L4 header - * @len: Message length, with L2 headers - * @l4_len: Message length, with L4 headers + * @pkt_buf_offset: Offset from @pkt_buf + * @len: Message length, with L2 headers */ struct tap_msg { - char *start; - char *l4h; + uint32_t pkt_buf_offset; uint16_t len; +}; + +/** + * struct tap_l4_msg - Layer-4 message descriptor for protocol handlers + * @pkt_buf_offset: Offset of message from @pkt_buf + * @l4_len: Length of Layer-4 payload, host order + */ +struct tap_l4_msg { + uint32_t pkt_buf_offset; uint16_t l4_len; }; |