DPDK usage discussions
 help / color / mirror / Atom feed
From: Nubin Stanley <nubinstanley@gmail.com>
To: users@dpdk.org
Subject: [dpdk-users] Usage of "rte_pktmbuf_attach"
Date: Tue, 20 Dec 2016 17:34:13 +0530	[thread overview]
Message-ID: <CAL53N-kEn1iLz=V+1vN0OP1uerFbRC78BM8GcFQqUmc+JYgmBw@mail.gmail.com> (raw)

Hi All

I have a doubt regarding the usage of :

static inline void rte_pktmbuf_attach(struct rte_mbuf **mi*, struct
rte_mbuf **m*)

Say "mi" is a newly allocated buffer. "m" is a multi-segment buffer (say
with 2 segments). Now, within the attach API, I see that "mi->nb_segs" is
always set to 1.

attach_frames(in_pkt)      // in_pkt has 2 segments
{
     pkt_1 = alloc();    // single segment
     pkt_2 = alloc();    // single segment

     rte_pktmbuf_attach(pkt_2, in_pkt);

     <<Update pkt_2 fields so that only part of in_pkt is used>>

     rte_pktmbuf_chain(pkt_1, pkt_2);
}

1) Will the attach ensure that whatever pkt_2 points to has the 2 segments
in in_pkt ? Or should I somehow loop and allocate new buffers and do
multiple attaches ?
2) Say, attach is properly done, the "chain" API should work as usual ?

Regards
Nubin Stanley

                 reply	other threads:[~2016-12-20 12:04 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='CAL53N-kEn1iLz=V+1vN0OP1uerFbRC78BM8GcFQqUmc+JYgmBw@mail.gmail.com' \
    --to=nubinstanley@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).