From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 74837A034C for ; Sat, 26 Mar 2022 09:13:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19557410F3; Sat, 26 Mar 2022 09:13:27 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 214954014F for ; Sat, 26 Mar 2022 09:13:24 +0100 (CET) Received: from kwepemi500011.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KQWtG2mbSz1GCxh for ; Sat, 26 Mar 2022 16:13:10 +0800 (CST) Received: from kwepeml500002.china.huawei.com (7.221.188.128) by kwepemi500011.china.huawei.com (7.221.188.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 26 Mar 2022 16:13:22 +0800 Received: from dggpemm500020.china.huawei.com (7.185.36.49) by kwepeml500002.china.huawei.com (7.221.188.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Sat, 26 Mar 2022 16:13:22 +0800 Received: from dggpemm500020.china.huawei.com ([7.185.36.49]) by dggpemm500020.china.huawei.com ([7.185.36.49]) with mapi id 15.01.2308.021; Sat, 26 Mar 2022 16:13:21 +0800 From: "jiangheng (H)" To: "users@dpdk.org" Subject: [dpdk-users] DPDK RX TCP checksum failed Thread-Topic: [dpdk-users] DPDK RX TCP checksum failed Thread-Index: AdhA6QKUGskwiuTFTOWojyhhlQQdHQ== Date: Sat, 26 Mar 2022 08:13:21 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.136.117.195] Content-Type: multipart/alternative; boundary="_000_cb53d6174669407b96a0f6a09d6bf134huaweicom_" MIME-Version: 1.0 X-CFilter-Loop: Reflected X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --_000_cb53d6174669407b96a0f6a09d6bf134huaweicom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, I tried using the checksum offloads feature in DPDK and it did not see work= ing under virtual machine. Port only support TCP checksum and do not support IP checksum: rx_offload_capa =3D DEV_RX_OFFLOAD_TCP_CKSUM tx_offload_capa =3D DEV_TX_OFFLOAD_TCP_CKSUM so I config rxmode.offload txmode.offloads as below: rxmode.offloads =3D DEV_RX_OFFLOAD_TCP_CKSUM txmode.offloads =3D DEV_TX_OFFLOAD_TCP_CKSUM For TX, I set the following parameters, it works good. mbuf->l2_len =3D sizeof(*ethhdr) mbuf->l3_len =3D ip header len mbuf-ol_flags =3D RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_TCP_CKSUM For RX, It will execute the following code: In drivers/net/virtio/virtio_rxtx.c virtio_rx_offload function : if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { hdrlen =3D hdr_lens.l2_len + hdr_lens.l3_len + hdr_lens.l4_len; if (hdr->csum_start <=3D hdrlen && l4_supported) { m->ol_flags |=3D RTE_MBUF_F_RX_L4_CKSUM_NONE; } else { m->ol_flags set to RTE_MBUF_F_RX_L4_CKSUM_NONE, causing the TCP RX checksum= failed. How do I avoid the above code going into this branch? Thanks, Jinag. --_000_cb53d6174669407b96a0f6a09d6bf134huaweicom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi all,

 

I tried using the checksum offl= oads feature in DPDK and it did not see working under virtual machine.=

 

Port only support TCP checksum = and do not support IP checksum:

rx_offload_capa =3D DEV_RX_OFFL= OAD_TCP_CKSUM

tx_offload_capa =3D DEV_TX_OFFL= OAD_TCP_CKSUM

 

so I config rxmode.offload txmo= de.offloads as below:

rxmode.offloads =3D DEV_RX_OFFL= OAD_TCP_CKSUM

txmode.offloads =3D DEV_TX_OFFL= OAD_TCP_CKSUM

 

For TX, I set the following par= ameters, it works good.

mbuf->l2_len =3D sizeof(*eth= hdr)

mbuf->l3_len =3D ip header l= en

mbuf-ol_flags =3D RTE_MBUF_F_TX= _IPV4 | RTE_MBUF_F_TX_TCP_CKSUM

 

 =

For RX, It will execute the fol= lowing code:

In drivers/net/virtio/virtio_rx= tx.c  virtio_rx_offload function :

    if (hdr->= flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {

     &= nbsp;  hdrlen =3D hdr_lens.l2_len + hdr_lens.l3_len + hdr_lens= .l4_len;

     &= nbsp;  if (hdr->csum_start <=3D hdrlen && l4_supported) = {

     &= nbsp;      m->ol_flags |=3D RTE_MBUF_F_RX_L4_CK= SUM_NONE;

     &= nbsp;  } else {

 

m->ol_flags set to RTE_MBUF_= F_RX_L4_CKSUM_NONE, causing the TCP RX checksum failed.

How do I avoid the above code g= oing into this branch?

 

Thanks,

Jinag.

 

 

 

 

 

 

 

--_000_cb53d6174669407b96a0f6a09d6bf134huaweicom_--