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 EEE01427E1; Mon, 20 Mar 2023 12:36:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 867C340A7F; Mon, 20 Mar 2023 12:36:10 +0100 (CET) Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by mails.dpdk.org (Postfix) with ESMTP id 02E94406BC for ; Mon, 20 Mar 2023 12:36:07 +0100 (CET) X-QQ-mid: bizesmtp78t1679312163tlmnv8yq Received: from DESKTOPGF9TM7H ( [125.42.32.4]) by bizesmtp.qq.com (ESMTP) with SMTP id 0 for ; Mon, 20 Mar 2023 19:36:02 +0800 (CST) X-QQ-SSF: 00000000000000C0H000000A0000000 X-QQ-FEAT: 90EFqYDyPxBOaoNZFIixbrf4LnH06SjvpSnxykWfdVKyo5Gygv2DQxpvk/xjm t4lolN/fyHfaP0JQVNfQCyH/PYksEsegxqnG7bC0QwHxY8dOXH/4Kpobjba89Y7GEzWrzI+ h4Vme51XXcLyIzogYZbHqwbRvHHrBUNSSMBBynHKv9OiDBqL0s32LwZbv1lsgQNHrwYNor5 5LPcFXazgwDByj5AmZuvBsRngvwA+s1ipgBFsDrADIdpceuXLpBLU+cUfbQL3DXgzKEzby6 hndGxB2Cu0pk12RqgJyo9wL3y1GEqTw4/z3WSOuoVr8Q6VfAjQTbtyobyyGAniyKvlE4ILy XQY7xrUP0GXaAOv8MW7RyZJqDvoc5t5/nA54X5+/I7lv+LqUuRYc8Wc1+IK+Q== X-QQ-GoodBg: 0 From: To: References: In-Reply-To: Subject: =?gb2312?B?u9i4tDogYWZfcGFja2V0IGNhbid0IHNlbmQgcGFja2V0IG1vcmUgdGhhbiA=?= =?gb2312?B?ZnJhbWVjbnQ=?= Date: Mon, 20 Mar 2023 19:36:02 +0800 Message-ID: <1CCF1B14C9842CED+002501d95b20$272f1b60$758d5220$@netitest.com> MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: Adla2/m2oFOUykYESnWhnhHdvVELggAQ+sAw Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:netitest.com:qybglogicsvr:qybglogicsvr5 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi, The issue has been resolved when I patched new code from dpdk 22.12, my = dpdk version is 19.11 Index: rte_eth_af_packet.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- rte_eth_af_packet.c (=B0=E6=B1=BE 44115) +++ rte_eth_af_packet.c (=B0=E6=B1=BE 44128) @@ -169,6 +169,29 @@ } =20 /* + * Check if there is an available frame in the ring + */ +static inline int +tx_ring_status_available(uint32_t tp_status) +{ + /* + * We eliminate the timestamp status from the packet status. + * This should only matter if timestamping is enabled on the = socket, + * but there is a bug in the kernel which is fixed in newer releases. + * + * See the following kernel commit for reference: + * commit 171c3b151118a2fe0fc1e2a9d1b5a1570cfe82d2 + * net: packetmmap: fix only tx timestamp on request + */ + tp_status &=3D ~(TP_STATUS_TS_SOFTWARE | = TP_STATUS_TS_RAW_HARDWARE); + + if (tp_status =3D=3D TP_STATUS_AVAILABLE) + return 1; + + return 0; +} + +/* * Callback to handle sending packets through a real NIC. */ static uint16_t @@ -213,7 +236,7 @@ } =20 /* point at the next incoming frame */ - if (ppd->tp_status !=3D TP_STATUS_AVAILABLE) { + if (!tx_ring_status_available(ppd->tp_status)) { if (poll(&pfd, 1, -1) < 0) break; =20 @@ -236,7 +259,7 @@ * * This results in poll() returning POLLOUT. */ - if (ppd->tp_status !=3D TP_STATUS_AVAILABLE) + if (!tx_ring_status_available(ppd->tp_status)) break; =20 /* copy the tx frame data */ Thanks, Haifeng -----=D3=CA=BC=FE=D4=AD=BC=FE----- =B7=A2=BC=FE=C8=CB: hfli@netitest.com =20 =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA3=D4=C220=C8=D5 11:32 =CA=D5=BC=FE=C8=CB: 'dev@dpdk.org' =D6=F7=CC=E2: af_packet can't send packet more than framecnt Hi, I used af_packet interface, but found only can send packets successfully less than framecnt argument.=20 E.g. if I pass = =A1=B0--vdev=3Deth_af_packet0,iface=3Dtap0,blocksz=3D4096,framesz=3D2048,= framecnt=3D512,qpairs=3D1,qdisc_bypass=3D0=A1=B1 to DPDK, the = rte_eth_tx_burst only return 1 for 512 times, after that it always return 0. If I pass =A1=B0--vdev=3Deth_af_packet0,iface=3Dtap0,blocksz=3D4096,framesz=3D2048,= framecnt=3D1024,q pairs=3D1,qdisc_bypass=3D0=A1=B1 to DPDK, the rte_eth_tx_burst only = return 1 for 1024 times, after that it always return 0. BTW, I use busy loop mode in project, Is there any help for this? Thanks so much Haifeng