DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Jain, Neeraj 3. (NSN - IN/Bangalore)" <neeraj.3.jain@nsn.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] Question regarding multi-segment packet forwarding
Date: Tue, 25 Mar 2014 12:28:37 +0000	[thread overview]
Message-ID: <2AA69572D8087D4FA7345FB70631D59A1FD79E20@SGSIMBX007.nsn-intra.net> (raw)

Hi,
I have a question regarding sending of multi-segment packets. I have modified the l2fwd sample application to send a multi-segment packet on tx queue whenever the application receives any packet on Rx queue. Pseudo-code is as below

Function l2fwd_simple_forward(.....)
{
Allocate new mbuf with "rte_pktmbuf_alloc"
Copy Ethernet, IP and UDP Headers into this new mbuf
Remove the Ethernet, ip and udp header from the beginning of received mbuf by calling rte_pktmbuf_adj api
Join the received buffer with new mbuf as follows:
        {
                new_mbuf->pkt.next = mbuf
                /* accumulate number of segments and total length. */
            new_mbuf ->pkt.nb_segs = new_mbuf->pkt.nb_segs + mbuf->pkt.nb_segs;
            new_mbuf ->pkt.pkt_len += mbuf->pkt.pkt_len;

            /* reset pkt_len and nb_segs for chained fragment. */
            mbuf->pkt.pkt_len = mbuf->pkt.data_len;
            mbuf->pkt.nb_segs = 1;
        }
}


When I call rte_pktmbuf_dump on the new_mbuf, it shows both the segments. Also l2fwd_send_packet (which eventually calls rte_eth_tx_burst) returns 1 indicating that packet was sent successfully. But I do not receive any packet on the other end.
However, instead of multi-segment packet, if I try sending only the new_mbuf that was created, then the packet is sent successfully.

So, Can you please advice if I am correct in the way multi-segment packets are created or if I am missing something here. Thanks


~Neeraj

                 reply	other threads:[~2014-03-25 12:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=2AA69572D8087D4FA7345FB70631D59A1FD79E20@SGSIMBX007.nsn-intra.net \
    --to=neeraj.3.jain@nsn.com \
    --cc=dev@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).