> -----Original Message----- > From: Maxime Coquelin <[email protected]> > Sent: 2022年6月2日 17:07 > To: Ma, WenwuX <[email protected]>; [email protected]; > [email protected]; Xia, Chenbo <[email protected]>; > [email protected]; Matz, Olivier <[email protected]> > Cc: [email protected] > Subject: Re: [PATCH 6/6] net/vhost: perform SW checksum in Tx path > > Hi Wenwu, > > Sorry, I missed your review. > > On 5/7/22 05:20, Ma, WenwuX wrote: > > > >> -----Original Message----- > >> From: Maxime Coquelin <[email protected]> > >> Sent: 2022年5月5日 18:27 > >> To: [email protected]; [email protected]; Xia, Chenbo > >> <[email protected]>; [email protected]; > >> [email protected] > >> Cc: [email protected]; Maxime Coquelin <[email protected]> > >> Subject: [PATCH 6/6] net/vhost: perform SW checksum in Tx path > >> > >> Virtio specification supports guest checksum offloading for L4, which > >> is enabled with VIRTIO_NET_F_GUEST_CSUM feature negotiation. > However, > >> the Vhost PMD does not advertise Tx checksum offload capabilities. > >> > >> Advertising these offload capabilities at the ethdev level is not > >> enough, because we could still end-up with the application enabling > >> these offloads while the guest not negotiating it. > >> > >> This patch advertizes the Tx checksum offload capabilities, and > >> introduces a compatibility layer to cover the case > >> VIRTIO_NET_F_GUEST_CSUM has not been negotiated but the > application > >> does configure the Tx checksum offloads. This function performs the L4 Tx > checksum in SW for UDP and TCP. > >> Compared to Rx SW checksum, the Tx SW checksum function needs to > >> compute the pseudo-header checksum, as we cannot knwo whether it > was > >> done before. > >> > >> This patch does not advertize SCTP checksum offloading capability for > >> now, but it could be handled later if the need arises. > > > > In virtio_enqueue_offload(), if RTE_MBUF_F_TX_IP_CKSUM is set, we will > > performs the L3 Tx checksum, why do not we advertise IPV4 checksum > offloading capability? > > Will we advertise it later? > > > > Indeed, we have an IPv4 SW checksum fallback in Vhost library. > We could think about adding the capability, but that's not urgent I think. Do > you have a use-case where it is needed? > The GRO/GSO library doesn't re-calculate IPv4 checksums for merged/fragmented packets, it will cause iperf in the vm to fail.
> Regards, > Maxime

