net/net_rx_pkt: Use iovec for net_rx_pkt_set_protocols()

igb does not properly ensure the buffer passed to
net_rx_pkt_set_protocols() is contiguous for the entire L2/L3/L4 header.
Allow it to pass scattered data to net_rx_pkt_set_protocols().

Fixes: 3a977deebe ("Intrdocue igb device emulation")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Akihiko Odaki 2023-05-23 11:42:58 +09:00 committed by Jason Wang
parent f0b1df5c45
commit 2f0fa232b8
7 changed files with 34 additions and 30 deletions

View file

@ -55,12 +55,14 @@ size_t net_rx_pkt_get_total_len(struct NetRxPkt *pkt);
* parse and set packet analysis results
*
* @pkt: packet
* @data: pointer to the data buffer to be parsed
* @len: data length
* @iov: received data scatter-gather list
* @iovcnt: number of elements in iov
* @iovoff: data start offset in the iov
*
*/
void net_rx_pkt_set_protocols(struct NetRxPkt *pkt, const void *data,
size_t len);
void net_rx_pkt_set_protocols(struct NetRxPkt *pkt,
const struct iovec *iov, size_t iovcnt,
size_t iovoff);
/**
* fetches packet analysis results