> > > > > > + > > > > > > +static inline char * > > > > > > +mbuf_append(struct rte_mbuf *m_head, struct rte_mbuf *m, > > > > > > +uint16_t > > > > > > +len) { > > > > > > + if (unlikely(len > rte_pktmbuf_tailroom(m))) > > > > > > + return NULL; > > > > > > + > > > > > > + char *tail = (char *)m->buf_addr + m->data_off + m- > > >data_len; > > > > > > + m->data_len = (uint16_t)(m->data_len + len); > > > > > > + m_head->pkt_len = (m_head->pkt_len + len); > > > > > > + return tail; > > > > > > +} > > > > > > > > > > Is it reasonable to direct add data_len of rte_mbuf? > > > > > > > > > > > > > Do you suggest to add directly without checking there is enough room > > > > in the mbuf? We cannot rely on the application providing mbuf with > > > > enough tailroom. > > > > > > What I mentioned is this changes about mbuf should move to librte_mbuf. > > > And it's better to align Olivier Matz. > > > > There is already rte_pktmbuf_append() inside rte_mbuf.h. > > Wouldn't it suit? > > > > Hi Ananyev, Rosen, > I agree that this can be confusing at first look and notably compared to > packet processing. > Note first that this same existing syntaxwhich is already used in all bbdev > PMDs when manipulating outbound mbufs in the context of base > band signal processing (not really a packet as for NIC or other devices). > Nothing new in that very PMD as this follows existing logic already in DPDK > bbdev PMDs. > > This function basically differs from the typical rte_pktmbuf_append() as this > is not appending data in the last mbuf but is used to potentially > update sequentially data for any mbufs in the middle from preallocated data > hence it takes 2 arguments for both the head and the current > mbuf segment in the list.
Ok, thanks for explanation. > There may be a more elegant way to do this down the line notably once there > is a proposal to handle gracefully large mbufs (another > usecase we have to handle in a slightly custom way). But I believe that is > orthogonal to that very PMD serie which keeps on reling on using > existing logic. > > > > > > > > > > > In case you ask about the 2 mbufs, this is because this function is > > > > used to also support segmented memory made of multiple mbufs segments. > > > > Note that this function is also used in other existing bbdev PMDs. > > > > In case you believe there is a better way to do this, we can > > > > certainly discuss and change these in several PMDs through another > > > > serie. > > > > > > > > Thanks for all the reviews and useful comments. > > > > Nic