DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Question regarding multi-segment packet forwarding
@ 2014-03-25 12:28 Jain, Neeraj 3. (NSN - IN/Bangalore)
  0 siblings, 0 replies; only message in thread
From: Jain, Neeraj 3. (NSN - IN/Bangalore) @ 2014-03-25 12:28 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-25 12:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-25 12:28 [dpdk-dev] Question regarding multi-segment packet forwarding Jain, Neeraj 3. (NSN - IN/Bangalore)

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).