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 A49C2A00C2 for ; Thu, 8 Dec 2022 10:33:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95EF140E28; Thu, 8 Dec 2022 10:33:07 +0100 (CET) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by mails.dpdk.org (Postfix) with ESMTP id 1CD0F40DDC for ; Thu, 8 Dec 2022 10:33:06 +0100 (CET) Received: by mail-qk1-f169.google.com with SMTP id c23so3043qkl.9 for ; Thu, 08 Dec 2022 01:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jDux3xVP8jauoIyOzW2QBco42c4WcTtsq15rxXiDpBk=; b=YpKPorMUrgKW86AXFiyHpmkk2kfsTWVt513ZfKzK+XShNoQNMft8/9qV5PdtIU6VLy LSshJiHdUYW5rO8oc/WKNj2T0RAfRem68yhgzfTT+rvIrUpl10KnMp2QAb71BlEOaLXF BYSJLRgaSk54Pj63nDhDWLeqH14qrHBHOxhofsmJOoI96ECrI0o6b5TtzagHAwX5SL0L Je4/cR8jLRcS27+puA5PHRInXnbjAIitBDncvBvlSO+EB+kKP0FxsTJFF+10nODRpQQB oOPTSpu8wdPmfK93lyd1DZxyJkyG+jlKTb+PmzFKPzNE3NKfs/TuF3SeNLjbOO/6ab3s eATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jDux3xVP8jauoIyOzW2QBco42c4WcTtsq15rxXiDpBk=; b=itHfUGqsQvm4V0nqdqzqo5Zxv9r0u+EIgJVHX2xGHm10FTbBtefeOEEh5GuvUPdxCe XJ04xvbh6o4KK6RZgoVoWfR3tUArGlc06BNtdRnvcNTdqyNiEPMUWf2FbrQtJDUO/WQB HTHolvNObJBRbbmQ3JDAm1S1RZoYn8appdoxfcLD3L7inlQ1BQeQYCUrQzOyyhtieNcd z+3IWzCeTlB7Wt4PrqVEig3TlLM2sTJIaIZf+qktiIOASQ5fvkVX5ordm5ukpkQ2uzUH xWiEtIAoEK9eNlN2BhDjiPrtENptWpcna340ghBTmEl48O5LDt+YmOdege6DL5L20r2j dVWg== X-Gm-Message-State: ANoB5pkmWB50780FNlhiM0oryS1vUEqnXM6fh7lhylnshpSQNVpzWxmE N6VL6pLJ2DssaWNbTDVydy9DtWE1h6br5SRNLTTCtDfb X-Google-Smtp-Source: AA0mqf61mMQMycIHOILxfSLE0r+KgvVJ04sFM0ReLwb4XJXOmKhXI7QFyteRoHGRpf04pKpW/N9wU7VfJaeRxXBLYkQ= X-Received: by 2002:a37:5e83:0:b0:6fa:43e1:2d48 with SMTP id s125-20020a375e83000000b006fa43e12d48mr64921704qkb.12.1670491985540; Thu, 08 Dec 2022 01:33:05 -0800 (PST) MIME-Version: 1.0 References: <2779611670484222@mail.yandex.ru> <2792611670489137@mail.yandex.ru> <1213751670491758@mail.yandex.ru> In-Reply-To: <1213751670491758@mail.yandex.ru> From: Pavel Vazharov Date: Thu, 8 Dec 2022 11:32:53 +0200 Message-ID: Subject: Re: How to debug receiving error or "rte_eth_stats.ierrors" ... To: "Ruslan R. Laishev" Cc: "users@dpdk.org" Content-Type: multipart/alternative; boundary="00000000000065faf005ef4db9d4" 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 --00000000000065faf005ef4db9d4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Glad it helped. On Thu, Dec 8, 2022 at 11:31 AM Ruslan R. Laishev wrote: > Hello, Paul! > > Thanks a lot for u great help! > > I did changes in the code as u have advised and 'ierrors' went away! > > > 08.12.2022, 12:17, "Pavel Vazharov" : > > Hi, > > I see you configure the device so I assume it has the capabilities to do > the checksum offloading. > > However, do you "tell" the device to calculate the checksums for every > packet. I mean, point 2 from my previous email where certain flags are se= t > in the `ol_flags` for every Tx packet. > I think this is needed in order to tell the device whether you want it to > calculate the checksum for the given packet or you want it to skip the > checksum calculation. > You need something like this for every packet before calling > `rte_eth_tx_burst` for the packet(s). > > pkt->ol_flags |=3D PKT_TX_IP_CKSUM | PKT_TX_IPV4 | PKT_TX_UDP_CKSUM; > pkt->l2_len =3D RTE_ETHER_HDR_LEN; > pkt->l3_len =3D ; // ((hdr.version_ihl & 0x0F) * 4U); > > > These comments from lib/librte_mbuf/rte_mbuf_core.h explain the flags > /** > > * Bits 52+53 used for L4 packet type with checksum enabled: 00: Reserved= , > > * 01: TCP checksum, 10: SCTP checksum, 11: UDP checksum. To use hardware > > * L4 checksum offload, the user needs to: > > * - fill l2_len and l3_len in mbuf > > * - set the flags PKT_TX_TCP_CKSUM, PKT_TX_SCTP_CKSUM or > PKT_TX_UDP_CKSUM > * - set the flag PKT_TX_IPV4 or PKT_TX_IPV6 > > */ > /** > > * Offload the IP checksum in the hardware. The flag PKT_TX_IPV4 should > > * also be set by the application, although a PMD will only check > > * PKT_TX_IP_CKSUM. > > * - fill the mbuf offload information: l2_len, l3_len > > */ > > On Thu, Dec 8, 2022 at 10:57 AM Ruslan R. Laishev wrote= : > > Hello, Paul! > > Thanks for the answer. > > > I set offloads as follows: > ... > > #define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM RTE_BIT64(1) > > #define RTE_ETH_TX_OFFLOAD_UDP_CKSUM RTE_BIT64(2) > > #define RTE_ETH_TX_OFFLOAD_TCP_CKSUM RTE_BIT64(3) > > ... > > *static* uint64_t s_offloads =3D { > > RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | RTE_ETH_TX_OFFLOAD_UDP_CKSUM | RTE_ETH_= TX_OFFLOAD_TCP_CKSUM}; > > > > *if* ( l_dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE ) > > l_port_conf.txmode.offloads |=3D RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; > > > > l_port_conf.txmode.offloads |=3D s_offloads; > > > l_dev_info.tx_offload_capa =3D 0x000080bf > l_port_conf.txmode.offloads =3D 0x0000000e - it's before rte_eth_dev_conf= igure( > ( ... &l_port_conf ...) > > > > The receiver - is DPDK application. Do I'm need set offloads at receiver > site to eliminate "ierrors" ? > > > > > > 08.12.2022, 10:54, "Pavel Vazharov" : > > Few questions: > 1. Does the sending NIC support IP and TCP/UDP checksum offloading? I > mean, if these flags set? > struct rte_eth_dev_info dev_info; > > rte_eth_dev_info_get(cfg.nic_port_id_, &dev_info); > constexpr auto rxcsum =3D DEV_RX_OFFLOAD_CHECKSUM; > > constexpr auto l3csum =3D DEV_TX_OFFLOAD_IPV4_CKSUM; > > constexpr auto l4csum =3D DEV_TX_OFFLOAD_TCP_CKSUM | > DEV_TX_OFFLOAD_UDP_CKSUM; > dev_rx_csum_ =3D ((dev_info.tx_offload_capa & rxcsum) =3D=3D > rxcsum); > dev_tx_csum_l3_ =3D ((dev_info.tx_offload_capa & l3csum) =3D=3D > l3csum); > dev_tx_csum_l4_ =3D ((dev_info.tx_offload_capa & l4csum) =3D=3D > l4csum); > > 2. Do you "tell" the sending NIC to do the checksum calculations before > sending the packets? I mean, do you do something like this for outgoing > packets? > if (offl.ip_csum) { > > pkt->ol_flags |=3D PKT_TX_IP_CKSUM | PKT_TX_IPV4; > > pkt->l2_len =3D RTE_ETHER_HDR_LEN; > > pkt->l3_len =3D ih_len; > > } > > if (offl.tcp_csum) { > > pkt->ol_flags |=3D PKT_TX_TCP_CKSUM; > > pkt->l2_len =3D RTE_ETHER_HDR_LEN; > > pkt->l3_len =3D ih_len; > > } > > if (offl.udp_csum) { > > pkt->ol_flags |=3D PKT_TX_UDP_CKSUM; > > pkt->l2_len =3D RTE_ETHER_HDR_LEN; > > pkt->l3_len =3D ih_len; > > } > > 3. Is the receiving side also a DPDK application? If it is, and if the NI= C > there supports checksum offloading you can check the flags of the receive= d > packets to see if the receiving NIC has detected checksum errors. > pkt->ol_flags & (PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD) > > Hope some of the above helps. > > On Thu, Dec 8, 2022 at 9:36 AM Ruslan R. Laishev wrote: > > Hello ! > > I wrote too small apps to send and receive ethernet/ip/udp > frame/packet/dg, so on received side I see next situation: > number of in errors is equally a number of received packets. The test > packet I made manually, set offloads IP/UDP checkusm. > Is there what I'm need to check additionally ? > > > > > --- > =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC, > Ruslan R. Laishev > OpenVMS bigot, natural born system/network progger, C contractor. > +79013163222 > +79910009922 > > > > > --- > =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC, > Ruslan R. Laishev > OpenVMS bigot, natural born system/network progger, C contractor. > +79013163222 > +79910009922 > > --00000000000065faf005ef4db9d4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Glad it helped.

On Thu, Dec 8, 2022 at 11:31 AM Ruslan = R. Laishev <zator@yandex.ru> w= rote:
Hello= , Paul!
=C2=A0
Thanks a lot for u great help!
=C2=A0
I did changes in the code as u have advised and 'ierr= ors' went away!
=C2=A0
=C2=A0
08.12.2022,= 12:17, "Pavel Vazharov" <freakpv@gmail.com>:
Hi,

I see you configure the device so I assume it has= the capabilities to do the checksum offloading.
=C2=A0
However, do= you "tell" the device to calculate the checksums for every packe= t. I mean, point 2 from my previous email where certain flags are set in th= e `ol_flags` for every Tx packet.
I think this is needed in order to t= ell the device whether you want it to calculate the checksum for the given = packet or you want it to skip the checksum calculation.
You need somet= hing like this for every packet before calling `rte_eth_tx_burst` for the p= acket(s).
=C2=A0
pkt->ol_flags |=3D PKT_TX_IP_CKSUM | PKT_= TX_IPV4 | PKT_TX_UDP_CKSUM;
pkt->l2_len =3D RTE_ETHER_HDR_LEN; =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
pkt->= l3_len =3D <ip header length>; // ((hdr.version_ihl & 0x0F) * 4U)= ;
=C2=A0
=C2=A0
These comments from lib/librte_mbu= f/rte_mbuf_core.h explain the flags
/** =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0
=C2=A0* Bits 52+53 used for L4 packet type with checksum e= nabled: 00: Reserved, =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0* 01: TCP checks= um, 10: SCTP checksum, 11: UDP checksum. To use hardware =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0
=C2=A0* L4 checksum offload, the user needs to: =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0* =C2=A0- fil= l l2_len and l3_len in mbuf =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0* =C2=A0- set the flags PKT_TX_= TCP_CKSUM, PKT_TX_SCTP_CKSUM or PKT_TX_UDP_CKSUM =C2=A0 =C2=A0 =C2=A0 =C2= =A0
=C2=A0* =C2=A0- set the flag PKT_TX_IPV4 or PKT_TX_IPV6 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0*/
/** =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0* Offload the IP checksum in the hardware= . The flag PKT_TX_IPV4 should =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0* also b= e set by the application, although a PMD will only check =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0* PKT_TX_IP_CKSUM. =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0* =C2=A0- fill th= e mbuf offload information: l2_len, l3_len =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0*/=C2= =A0
On Thu, Dec 8, 2022 at 10:57 AM Ruslan R. Laishev <z= ator@yandex.ru> wrote:
Hello, = Paul!
=C2=A0
Thanks for the answer.
=C2=A0
=C2=A0
I set offloads as follows:
...
#define RTE_ETH_TX_OFFLOAD_IPV4_CKSUM =C2=A0 =C2=A0 =C2=A0 RTE_BIT64(1)
#define RTE_ETH_TX_OFFLOAD_U=
DP_CKSUM =C2=A0 =C2=A0 =C2=A0=
 =C2=A0RTE_BIT64(2)
#define RTE_ETH_TX_OFFLOAD_TCP_CKSUM =C2=A0 =C2=A0 =C2=A0 =C2=A0RTE_BIT64(3)
...
static uint64_t s_offloads =3D {
	=
	RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | RTE_ETH_TX_OFFLOAD_UDP_CKSUM | RTE_ETH_=
TX_OFFLOAD_TCP_CKSUM};
=C2=A0
		if ( l_dev_info.=
tx_off=
load_capa & <=
span style=3D"color:rgb(255,106,173);font-family:"courier new",mo=
nospace">RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE )
			l_port_con=
f.txmo=
de.offloads |=3D RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
=C2=A0
		l_port_conf.txmode.<=
span style=3D"font-family:"courier new",monospace">offloads |=3D s_offloads;
= =C2=A0
l_dev_info.tx_offload_capa =3D 0x000080bf
l_port_conf.txmode.o= ffloads =3D 0x0000000e - it's before rte_eth_dev_configure( ( ..= . &l_port_conf ...)
=
=C2=A0
=C2=A0
=C2=A0
The receiver = - is =C2=A0DPDK application. Do I'm need set offloads at receiver site = to eliminate "ierrors" ?
=C2=A0
=C2=A0<= /div>
=C2=A0
=C2=A0
=C2=A0
08.12.2022, 10= :54, "Pavel Vazharov" <freakpv@gmail.com>:
Few questions:
1. Does the sendi= ng NIC support IP and TCP/UDP checksum offloading? I mean, if these flags s= et?
=C2=A0 =C2=A0 struct rte_eth_dev_info dev_info; =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 =C2=A0 rte_e= th_dev_info_get(cfg.nic_port_id_, &dev_info);
=C2=A0 =C2=A0 constexp= r auto rxcsum =3D DEV_RX_OFFLOAD_CHECKSUM; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2= =A0 =C2=A0 constexpr auto l3csum =3D DEV_TX_OFFLOAD_IPV4_CKSUM; =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0
=C2=A0 =C2=A0 constexpr auto l4csum =3D DEV_TX_OFFLOAD_TCP_CKSUM = | DEV_TX_OFFLOAD_UDP_CKSUM;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0
=C2=A0 =C2=A0 dev_rx_csum_ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=3D ((dev_info.tx_offload_capa & rxcsum) =3D=3D rxcsum); =C2=A0 = =C2=A0
=C2=A0 =C2=A0 dev_tx_csum_l3_ =C2=A0 =C2=A0 =C2=A0 =3D ((dev_info= .tx_offload_capa & l3csum) =3D=3D l3csum); =C2=A0 =C2=A0
=C2=A0 =C2= =A0 dev_tx_csum_l4_ =C2=A0 =C2=A0 =C2=A0 =3D ((dev_info.tx_offload_capa &am= p; l4csum) =3D=3D l4csum);
=C2=A0
2. Do you "tell" the se= nding NIC to do the checksum calculations before sending the packets? I mea= n, do you do something like this for outgoing packets?
=C2=A0 =C2=A0 if = (offl.ip_csum) { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 pkt->ol_flags |=3D PKT_TX_IP_CKSUM | PKT_TX_IPV= 4; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 pkt->l2_len =3D RTE_ETHER_H= DR_LEN; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 pkt->l3_len =3D ih_len; =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0
=C2=A0 =C2=A0 } =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 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0 =C2=A0 =C2=A0
=C2=A0 =C2=A0 }
=C2=A0
3.= Is the receiving side also a DPDK application? If it is, and if the NIC th= ere supports checksum offloading you can check the flags of the received pa= ckets to see if the receiving NIC has detected checksum errors.
pkt->= ol_flags & (PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD)
=C2=A0
<= div>Hope some of the above helps.
=C2=A0
On Thu, Dec 8,= 2022 at 9:36 AM Ruslan R. Laishev <zator@yandex.ru> wrote:=
Hello !
=C2=A0
I= wrote too small apps to send and receive =C2=A0ethernet/ip/udp frame/packe= t/dg, so on received side I =C2=A0see next situation:
number of i= n errors is equally a number of received packets. The test packet I made ma= nually, =C2=A0set offloads =C2=A0IP/UDP checkusm.
Is there what I= 'm need to check additionally ?
=C2=A0
=C2=A0
=C2=A0
---=C2=A0
= =D0=A1= =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC,
Ruslan R. Laish= ev
OpenVMS bigot, natural born system/network progger,=C2=A0C co= ntractor.
+79013163222
+79910009922
= =C2=A0
=C2=A0
=C2=A0
---=C2=A0
=D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0= =B5=D0=BC,
Ruslan R. Laishev
OpenVMS bigot, natural born syst= em/network progger,=C2=A0C contractor.
+79013163222
=
+= 79910009922
=C2=A0
--00000000000065faf005ef4db9d4--