DPDK usage discussions
 help / color / mirror / Atom feed
From: Sungho Hong <maverickjin88@gmail.com>
To: users@dpdk.org
Subject: [dpdk-users] Correct way to free the received packets after ip-assembly
Date: Tue, 6 Nov 2018 20:45:20 -0700	[thread overview]
Message-ID: <CAK8vx=gKsRgddYbFM7itFHJrzgxoai_BSWaEJxVhQ1U91ZZ_dw@mail.gmail.com> (raw)

Hello DPDK experts,

I was wondering, when to free the received packets after we have assembled
the packets.

For example, I just want to receive the assembled packets and not forward
to any other ports. just want to free it right away.

However when we try to free the packets after assemble, I face segmentation
error.
here is the basic example of *examples/ip_reassembly/main.c*
Assuming that we do not forward the packets and just free the packets
ourselves, would it be possible to know the correct location to free the
packets?

Because I think the packets that I have freed are referenced some where
else, and causing the segmentation fault.

Locations that I have tried to free the assembled packets
-----------
for (i = 0; i < qconf->n_rx_queue; ++i) {

  portid = qconf->rx_queue_list[i].portid;

  nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst,
    MAX_PKT_BURST);

  /* Prefetch first packets */
  for (j = 0; j < PREFETCH_OFFSET && j < nb_rx; j++) {
    rte_prefetch0(rte_pktmbuf_mtod(
        pkts_burst[j], void *));
  }

  /* Prefetch and forward already prefetched packets */
  for (j = 0; j < (nb_rx - PREFETCH_OFFSET); j++) {
    rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[
      j + PREFETCH_OFFSET], void *));
    reassemble(pkts_burst[j], portid,
      i, qconf, cur_tsc);
*  // attempted to free from here but failed *
  }

  /* Forward remaining prefetched packets */
  for (; j < nb_rx; j++) {
    reassemble(pkts_burst[j], portid,
      i, qconf, cur_tsc);
*  // attempted to free from here ** but failed *

  }

*// attempted to free from here ** but failed *

  rte_ip_frag_free_death_row(&qconf->death_row,
    PREFETCH_OFFSET);
}

*// attempted to free from here ** but failed *
-----

Any insight on this issue would be greatly appreciated.

Best
Sungho Hong

             reply	other threads:[~2018-11-07  3:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07  3:45 Sungho Hong [this message]
2018-11-07  5:55 ` Muhammad Zain-ul-Abideen

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='CAK8vx=gKsRgddYbFM7itFHJrzgxoai_BSWaEJxVhQ1U91ZZ_dw@mail.gmail.com' \
    --to=maverickjin88@gmail.com \
    --cc=users@dpdk.org \
    /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).