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 D35B0A00C2 for ; Wed, 28 Sep 2022 03:52:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CEFB40E25; Wed, 28 Sep 2022 03:52:06 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id F020840694 for ; Wed, 28 Sep 2022 03:52:04 +0200 (CEST) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4McfWv1Nj6zWh0P for ; Wed, 28 Sep 2022 09:47:55 +0800 (CST) Received: from kwepemm000002.china.huawei.com (7.193.23.144) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 28 Sep 2022 09:52:00 +0800 Received: from dggpeml500020.china.huawei.com (7.185.36.88) by kwepemm000002.china.huawei.com (7.193.23.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 28 Sep 2022 09:52:00 +0800 Received: from dggpeml500020.china.huawei.com ([7.185.36.88]) by dggpeml500020.china.huawei.com ([7.185.36.88]) with mapi id 15.01.2375.031; Wed, 28 Sep 2022 09:51:59 +0800 From: "jiangheng (G)" To: "users@dpdk.org" Subject: [i40e] can i40e NIC send tcp packets split by rte_gso_segment Thread-Topic: [i40e] can i40e NIC send tcp packets split by rte_gso_segment Thread-Index: AdjS2wPuyNHM/1mwQr+RARJ8ipqAyA== Date: Wed, 28 Sep 2022 01:51:59 +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: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 Hello I coded a dameon based on dpdk, and I am using GSO(generic segment offload)= feature in dpdk19.11, however this feature does not work on i40e NIC. belo= w is some of my code: struct rte_gso_ctx gso_ctx; int gso_ctx_setup(struct rte_gso_ctx *gso_ctx, int port_id) { struct rte_mempool *mp =3D rte_mempool_lookup("gso_pool", 128 * 10, 4, = 0, RTE_PKTMBUF_HEADROOM + 128, SOCKET_ID_ANY); gso_ctx->direct_pool =3D mp; gso_ctx->indirect_pool =3D mp; gso_ctx->gso_types =3D DEV_TX_OFFLOAD_TCP_TSO; gso_ctx->gso_szie =3D 1514; gso_ctx->flag =3D 0; return 0; } then I use the following function to split and send the input large tcp pac= kets: #define GSO_MAX_PKT_BURST 128 // pkt have 3 nb_segs, pkt_len is 1514 + 1460 + 1460 .... tx_xmit (struct rte_mbuf *pkt) { uint32_t sent_pkts =3D 0; struct rte_mbuf *gso_segments[GSO_MAX_PKT_BURST]; uint16_t nb_segments =3D 0; int ret; ret =3D rte_gso_segment(pkt, &gso_ctx, &gso_segments[nb_segments], GSO_= MAX_PKT_BURST - nb_segments); if (ret > 0) { nb_segments +=3D ret; } else { printf("unable to segment packet\n"); rte_pktmbuf_free(pkt); } rte_eth_tx_burst(port_id, queue_id, &gso_segments[0], nb_segments) } mbuf initialization: struct rte_mbuf *head =3D m; for (int i =3D0; i < head->nb_segs; i++) { // head->nb_segs =3D 3 m->ol_flags =3D PKT_TX_IPV4 | PKT_TX_TCP_CKSUM | PKT_TX_IP_CKSUM | PKT_= TX_TCP_SEG | DEV_TX_OFFLOAD_TCP_TSO; // 0xd4000000000020 // i am sure the tcp header and data are correct m->data_len =3D 1514 or 1460; m->pkt_len =3D 1514 + 1460 + 1460; m->l2_len =3D 14; m->l3_len =3D 20; m->l4_len =3D 20; m =3D m->next; } tx_xmit(head); The tcp package split by rte_gso_segment can transfer to i40e_xmit_pkts fun= ction:=20 nb_segments =3D 3; gso_segments[i]->nb_segs =3D 2; gso_segments[0]->pkt_len =3D 1514; gso_segments[0]->data_len =3D 54, gso_segments[0]->next->data_len =3D 1460; gso_segments[0]->ol_flags =3D 0xd0000000000020 i40e_xmit_pkts returns ok, but the tcp data cannot be sent out. The same code can sent tcp data correctly if the hinic NIC is used.=20 please help check whether the above configuration are correct if used i40e = NIC? By the way, how do i enable TSO feature for i40e NIC in dpdk19.11 ?=20