DPDK usage discussions
 help / color / mirror / Atom feed
From: Pavel Vazharov <freakpv@gmail.com>
To: "Ruslan R. Laishev" <zator@yandex.ru>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: How to debug receiving error or "rte_eth_stats.ierrors" ...
Date: Thu, 8 Dec 2022 09:54:39 +0200	[thread overview]
Message-ID: <CAK9EM1-weA=ZiHz1A=NNcNtd5c=RmbEfyFQPg+GdS9u1w3ohHQ@mail.gmail.com> (raw)
In-Reply-To: <2779611670484222@mail.yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 1945 bytes --]

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 = DEV_RX_OFFLOAD_CHECKSUM;

    constexpr auto l3csum = DEV_TX_OFFLOAD_IPV4_CKSUM;

    constexpr auto l4csum = DEV_TX_OFFLOAD_TCP_CKSUM |
DEV_TX_OFFLOAD_UDP_CKSUM;
    dev_rx_csum_          = ((dev_info.tx_offload_capa & rxcsum) ==
rxcsum);
    dev_tx_csum_l3_       = ((dev_info.tx_offload_capa & l3csum) ==
l3csum);
    dev_tx_csum_l4_       = ((dev_info.tx_offload_capa & l4csum) == 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 |= PKT_TX_IP_CKSUM | PKT_TX_IPV4;

        pkt->l2_len = RTE_ETHER_HDR_LEN;

        pkt->l3_len = ih_len;

    }

    if (offl.tcp_csum) {

        pkt->ol_flags |= PKT_TX_TCP_CKSUM;

        pkt->l2_len = RTE_ETHER_HDR_LEN;

        pkt->l3_len = ih_len;

    }

    if (offl.udp_csum) {

        pkt->ol_flags |= PKT_TX_UDP_CKSUM;

        pkt->l2_len = RTE_ETHER_HDR_LEN;

        pkt->l3_len = ih_len;

    }

3. Is the receiving side also a DPDK application? If it is, and if the NIC
there supports checksum offloading you can check the flags of the received
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 <zator@yandex.ru> 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 ?
>
>

[-- Attachment #2: Type: text/html, Size: 3769 bytes --]

  reply	other threads:[~2022-12-08  7:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  7:36 Ruslan R. Laishev
2022-12-08  7:54 ` Pavel Vazharov [this message]
2022-12-08  8:57   ` Ruslan R. Laishev
2022-12-08  9:17     ` Pavel Vazharov
2022-12-08  9:31       ` Ruslan R. Laishev
2022-12-08  9:32         ` Pavel Vazharov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK9EM1-weA=ZiHz1A=NNcNtd5c=RmbEfyFQPg+GdS9u1w3ohHQ@mail.gmail.com' \
    --to=freakpv@gmail.com \
    --cc=users@dpdk.org \
    --cc=zator@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).