Hi Olivier,

> -----Original Message-----
> From: Olivier Matz [mailto:[email protected]]
> Sent: Tuesday, January 16, 2018 6:43 PM
> To: Wang, Xiao W <[email protected]>
> Cc: [email protected]; [email protected]; Bie, Tiwei
> <[email protected]>; [email protected]; [email protected];
> [email protected]
> Subject: Re: [dpdk-dev] [PATCH v10 3/5] net: add a helper for making RARP
> packet
> 
> Hi Xiao,
> 
> On Tue, Jan 16, 2018 at 09:43:43AM +0000, Wang, Xiao W wrote:
> > Hi Olivier,
> > > You can also use rte_pktmbuf_append() to check for the tailroom and
> > > update data_len/pkt_len:
> > >
> > >   m = rte_pktmbuf_alloc();

I just realized that if we let this function to allocate mbuf, it may restrict 
this api's applicability.
E.g. the caller just has a mbuf, without a mempool.
How do you think?

> > >   if (m == NULL)
> > >           return NULL;
> > >   eth_hdr = rte_pktmbuf_append(m, RARP_PKT_SIZE);
> >
> > When data_len is not enough, we need to rte_pktmbuf_append(m,
> RARP_PKT_SIZE - m->data_len);
> 
> Sorry, I don't get your point here.

I mean we just need to extend the data_len by "RARP_PKT_SIZE - m->data_len" 
when the room is not big enough.

BRs,
Xiao

Reply via email to