On Mon, 25 Jul 2022 17:28:11 +0200
Mário Kuka <k...@cesnet.cz> wrote:

> The rte_pcapng_write_packets() function fails when we try to write more
> packets than the IOV_MAX limit. The error is caused by the writev()
> system call, which is limited by the IOV_MAX limit. The iovcnt argument
> is valid if it is greater than 0 and less than or equal to IOV_MAX as
> defined in <limits.h>.
> 
> To avoid this problem, we can split the iovec buffer into smaller
> chunks with a maximum size of IOV_MAX and write them sequentially by
> calling the writev() repeatedly.

That risks writing partial packets.

Better to move the break down inside the logic of rte_pcapng_write_packets()
and at the same time, remove the VLA of iov[iovcnt]

> 
> Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files")
> Cc: step...@networkplumber.org
> 
> Signed-off-by: Mário Kuka <k...@cesnet.cz>

What is the burst size here?
IOV_MAX is 1024, and typical max mbuf per packet would be 5
that means as is the code works for up to 204 burst size.

Sure you can use DPDK in odd ways with small mbuf sizes and huge
burst sizes, but this needs to only in some slow path.

Reply via email to