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 0BD0DA00C2 for ; Thu, 8 Dec 2022 10:17:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF67C40E28; Thu, 8 Dec 2022 10:17:37 +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 CF16240DDC for ; Thu, 8 Dec 2022 10:17:36 +0100 (CET) Received: by mail-qk1-f169.google.com with SMTP id x24so413855qkf.5 for ; Thu, 08 Dec 2022 01:17:36 -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=O40pCZnV5+R8190f98RGjQ/V9NxYGCSIXh9DZJLyHmg=; b=pz3Spi2sl61rRGsbfFkJIduhVto+Op9hmvwdSeMRQoVkr2BlvN+zWIu9ysn3adNSw/ fmE9nAOfSVYscpXLSukJB/6zU2aBtPpQOKF4LXgoqE4XbUFQyq+uRTK6jzM7JP1DURcT 19M68S6T5rpXqCtYFkwP/sJNkWsQnXbEiHProJZlbT8S8Gm7kunRIP/OFxICiO4TgN0D pkO9XxthL558dNdtvrOp5YN1KOMy4Jirokip4q2INSnYhrDVQD5LEGudsfCMbJSIRlE/ NLPjgWuS5ekeIFhMupZeZgzMLlokIv3d3UMNhr3xiuSpSgnmHyQKVVYcpbZphgVQw1U4 NwLA== 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=O40pCZnV5+R8190f98RGjQ/V9NxYGCSIXh9DZJLyHmg=; b=Vitj1hrkVy7FG78izspquetpsiKf+4q+i2Sd4NTi/9O9DSUuiVRzr6LQGaOmj5P8p1 L2jXInaD7zihWkrpl3AgmYqBjrpEsKMQB2YNm6/47Dx30c2mzorQ6whUlfeqRpeUAh/n 3PFdDsj67TXpbfh2NVWxqvgkzNRylLWds9TKpqElnqaknlKRfv8DdclgYQaeXbE2QGyF EEs4CZ30d5VOY2RWctOJYNxc9R2acuSFVqLelvuyV8w6vKycq13aGYvHPjYwMrqNmfb6 adRUR42UqcDP956SPVlAXWpol/XlKK+j7RhQbVbP4OGHCqFyKj+mQ6OY0FOBOzCQsy0l eApQ== X-Gm-Message-State: ANoB5pmQhL2XCVlXSmeK1UVbgLSN4JkclwIkoSd0+E3/m3YSlPu4xQJy WmLGcBHMMmq2t1tqKbe87h8NDRPOlrt3bvgNuR8Q2+sFzZ0= X-Google-Smtp-Source: AA0mqf54try6PYo6k55v1xVtQZqe17zjHp/B+UWlvmD30a9LyrAbXU5+SbNaKbiFmFanvzSN2OPWRlhJHlZl1VVRHkw= X-Received: by 2002:a37:5e83:0:b0:6fa:43e1:2d48 with SMTP id s125-20020a375e83000000b006fa43e12d48mr64905911qkb.12.1670491056248; Thu, 08 Dec 2022 01:17:36 -0800 (PST) MIME-Version: 1.0 References: <2779611670484222@mail.yandex.ru> <2792611670489137@mail.yandex.ru> In-Reply-To: <2792611670489137@mail.yandex.ru> From: Pavel Vazharov Date: Thu, 8 Dec 2022 11:17:24 +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="000000000000021e3c05ef4d826e" 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 --000000000000021e3c05ef4d826e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 set 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 > > --000000000000021e3c05ef4d826e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I see you configure t= he 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 c= ertain flags are set in the `ol_flags` for every Tx packet.
I thin= k this is needed in order to tell the device whether you want it to calcula= te the checksum for the given packet or you want it to skip the checksum ca= lculation.
You need something like this for every packet before ca= lling `rte_eth_tx_burst` for the packet(s).

pkt->= ol_flags |=3D PKT_TX_IP_CKSUM | PKT_TX_IPV4 | PKT_TX_UDP_CKSUM;
pkt-&g= t;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);


These comments from lib/librte_mbuf/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 use= d for L4 packet type with checksum enabled: 00: Reserved, =C2=A0 =C2=A0 =C2= =A0 =C2=A0
=C2=A0* 01: TCP checksum, 10: SCTP checksum, 11: UDP checksu= m. To use hardware =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0* L4 checksu= m 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- fill 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 be set by the application, although a PMD w= ill 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 the mbuf offload information: l2_len, l3_le= n =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 &l= t;zator@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_UDP_CKSUM<=
/span> =C2=A0 =C2=A0 =C2=A0 =C2=A0RTE_BIT64(2)
#define RTE_ET=
H_TX_OFFLOAD_TCP_CKSUM =C2=A0=
 =C2=A0 =C2=A0 =C2=A0RTE_BIT6=
4(3)
...=
static uint64_t s_offloads =3D=
 {
		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | RTE_ETH_TX_OFFLOAD_UDP_CKSUM=
 | RTE_ETH_TX_OFFLOAD_TC=
P_CKSUM};
=C2=A0
		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;
=C2=A0
		l_port_conf.txmode.offloads =
|=3D s_offloads;
=C2=A0
<= div>
l_de= v_info.tx_offload_capa =3D 0x000080bf
l_port_conf.txmode.offloads =3D 0= x0000000e - it's before rte_eth_dev_configure( ( ... &l_port_conf ...)

=C2=A0
=C2=A0
The receiver - is =C2=A0DPDK= application. Do I'm need set offloads at receiver site to eliminate &q= uot;ierrors" ?
=C2=A0
=C2=A0
=C2= =A0
=C2=A0
=C2=A0
08.12.2022, 10:54, "Pa= vel Vazharov" <freakpv@gmail.com>:
Few= questions:
1. Does the sending NIC support IP and TCP/UDP checksum of= floading? I mean, if these flags set?
=C2=A0 =C2=A0 struct rte_eth_dev_i= nfo 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_eth_dev_info_get(cfg.nic_port_id_, &= dev_info);
=C2=A0 =C2=A0 constexpr auto rxcsum =3D DEV_RX_OFFLOAD_CHECKS= UM; =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 l4cs= um =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_cs= um_ =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 l3csu= m); =C2=A0 =C2=A0
=C2=A0 =C2=A0 dev_tx_csum_l4_ =C2=A0 =C2=A0 =C2=A0 =3D= ((dev_info.tx_offload_capa & l4csum) =3D=3D l4csum);
=C2=A0
2.= Do you "tell" the sending NIC to do the checksum calculations be= fore sending the packets? I mean, do you do something like this for outgoin= g 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 P= KT_TX_IP_CKSUM | PKT_TX_IPV4; =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-&= gt;l2_len =3D RTE_ETHER_HDR_LEN; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=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2=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_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
=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
3. Is the receiving side also a DPDK applicatio= n? If it is, and if the NIC there supports checksum offloading you can chec= k the flags of the received packets to see if the receiving NIC has detecte= d checksum errors.
pkt->ol_flags & (PKT_RX_IP_CKSUM_BAD | PKT_RX_= L4_CKSUM_BAD)
=C2=A0
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/packet/dg, so on received side I =C2=A0see next si= tuation:
number of in errors is equally a number of received pack= ets. The test packet I made manually, =C2=A0set offloads =C2=A0IP/UDP check= usm.
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. Laishev
OpenVMS bigot, natural born s= ystem/network progger,=C2=A0C contractor.
+79013163222
+79910009922
=C2=A0
--000000000000021e3c05ef4d826e--