Add a function named packet_new_nocopy for COLO.

Use the packet_new_nocopy instead of packet_new in the
filter-rewriter module. There will be one less memory
copy in the processing of each network packet.

Signed-off-by: Lei Rao <lei.rao@intel.com>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Rao, Lei
2021-06-08 16:23:29 +08:00
committed by Jason Wang
parent 3ba024457f
commit 9b492719dd
3 changed files with 19 additions and 10 deletions

View File

@ -270,8 +270,7 @@ static ssize_t colo_rewriter_receive_iov(NetFilterState *nf,
vnet_hdr_len = nf->netdev->vnet_hdr_len;
}
pkt = packet_new(buf, size, vnet_hdr_len);
g_free(buf);
pkt = packet_new_nocopy(buf, size, vnet_hdr_len);
/*
* if we get tcp packet