Hi,david
In dpdk 22.11 rte_mbuf_core.h file, there are notes as follows:
/**
* TCP segmentation offload. To enable this offload feature for a
* packet to be transmitted on hardware supporting TSO:
* - set the RTE_MBUF_F_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies
* RTE_MBUF_F_TX_TCP_CKSUM)
* - set the flag RTE_MBUF_F_TX_IPV4 or RTE_MBUF_F_TX_IPV6
* - if it's IPv4, set the RTE_MBUF_F_TX_IP_CKSUM flag
* - fill the mbuf offload information: l2_len, l3_len, l4_len, tso_segsz
*/
And also, in testpmd example csum engine file csumonly.c, we can see
func process_inner_cksums partial code as follows
if (tso_segsz)
ol_flags |= RTE_MBUF_F_TX_TCP_SEG;
else if (tx_offloads & RTE_ETH_TX_OFFLOAD_TCP_CKSUM) {
ol_flags |= RTE_MBUF_F_TX_TCP_CKSUM;
} else {
if (info->is_tunnel)
l4_off = info->outer_l2_len +
info->outer_l3_len +
info->l2_len + info->l3_len;
else
l4_off = info->l2_len + info->l3_len;
tcp_hdr->cksum = 0;
tcp_hdr->cksum =
get_udptcp_checksum(m, l3_hdr, l4_off,
info->ethertype);
}
We can see when RTE_MBUF_F_TX_TCP_SEG is set, and RTE_ETH_TX_OFFLOAD_TCP_CKSUM
is not set.
Best regards
dexia
-----邮件原件-----
发件人: David Marchand <[email protected]>
发送时间: 2023年9月14日 19:23
收件人: Dexia Li <[email protected]>
抄送: [email protected]; [email protected]; Mike Pattrick
<[email protected]>; Eelco Chaudron <[email protected]>
主题: Re: [ovs-dev] [PATCH] netdev-dpdk: fix tso bug
Hello,
On Wed, Sep 13, 2023 at 8:55 AM Dexia Li via dev <[email protected]>
wrote:
>
> when userspace tso enabled, mbuf RTE_MBUF_F_TX_TCP_SEG and
> RTE_MBUF_F_TX_TCP_CKSUM
>
> flag bits all positioned will result in driver hang using intel E810
> vf
>
> driver iavf. As refered to dpdk csum example, RTE_MBUF_F_TX_TCP_SEG
>
> should only be positioned when tso is open.
>
> Signed-off-by: Dexia Li <[email protected]>
Sorry, I am missing something...
The mbuf API mentions that it is implied that RTE_MBUF_F_TX_TCP_CKSUM is set
along RTE_MBUF_F_TX_TCP_SEG.
Meaning that an application may request both RTE_MBUF_F_TX_TCP_SEG or
RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_TCP_CKSUM.
And iirc the combination of both RTE_MBUF_F_TX_TCP_CKSUM and
RTE_MBUF_F_TX_TCP_SEG is accepted in some dpdk drivers.
Looking at the 22.11 iavf driver, the scalar tx handler looks at tso requests
first, prepares the descriptor and stops at this.
It won't look at tcp checksum flags.
https://git.dpdk.org/dpdk-stable/tree/drivers/net/iavf/iavf_rxtx.c?h=v22.11.3#n2623
https://git.dpdk.org/dpdk-stable/tree/drivers/net/iavf/iavf_rxtx.c?h=v22.11.3#n2637
As far as the vector tx handlers are concerned, I think they are not usable
with TSO requests, and I think the iavf_tx_vec_queue_default() check prevents
such requests from the application.
Can you perhaps double check which tx handler is in use (gdb is the only option
to retrieve this information on a running application using dpdk 22.11)?
--
David Marchand
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev