diff options
| author | Bin Meng <bin.meng@windriver.com> | 2020-12-11 17:35:12 +0800 |
|---|---|---|
| committer | Jason Wang <jasowang@redhat.com> | 2021-01-25 17:04:56 +0800 |
| commit | f574633529926697ced51b6865e5c50bbb78bf1b (patch) | |
| tree | 98d77919083dfcbec0247c6980c479d08bc07d3b /hw/net/xen_nic.c | |
| parent | d97f11590a0f60cd911ace8bb68180b5a09a068d (diff) | |
| download | focaccia-qemu-f574633529926697ced51b6865e5c50bbb78bf1b.tar.gz focaccia-qemu-f574633529926697ced51b6865e5c50bbb78bf1b.zip | |
net: checksum: Introduce fine control over checksum type
At present net_checksum_calculate() blindly calculates all types of checksums (IP, TCP, UDP). Some NICs may have a per type setting in their BDs to control what checksum should be offloaded. To support such hardware behavior, introduce a 'csum_flag' parameter to the net_checksum_calculate() API to allow fine control over what type checksum is calculated. Existing users of this API are updated accordingly. Signed-off-by: Bin Meng <bin.meng@windriver.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/net/xen_nic.c')
| -rw-r--r-- | hw/net/xen_nic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 00a7fdf843..5c815b4f0c 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -174,7 +174,7 @@ static void net_tx_packets(struct XenNetDev *netdev) tmpbuf = g_malloc(XC_PAGE_SIZE); } memcpy(tmpbuf, page + txreq.offset, txreq.size); - net_checksum_calculate(tmpbuf, txreq.size); + net_checksum_calculate(tmpbuf, txreq.size, CSUM_ALL); qemu_send_packet(qemu_get_queue(netdev->nic), tmpbuf, txreq.size); } else { |