[PATCH v9 2/4] ethdev: introduce protocol hdr based buffer split
Thomas Monjalon
thomas at monjalon.net
Mon Jul 11 12:12:53 CEST 2022
11/07/2022 11:54, Ding, Xuan:
> From: Thomas Monjalon <thomas at monjalon.net>
> > 13/06/2022 12:25, wenxuanx.wu at intel.com:
> > > --- a/lib/ethdev/rte_ethdev.h
> > > +++ b/lib/ethdev/rte_ethdev.h
> > > @@ -1176,6 +1176,9 @@ struct rte_eth_txmode {
> > > * specified in the first array element, the second buffer, from the
> > > * pool in the second element, and so on.
> > > *
> > > + * - The proto_hdrs in the elements define the split position of
> > > + * received packets.
> > > + *
> > > * - The offsets from the segment description elements specify
> > > * the data offset from the buffer beginning except the first mbuf.
> > > * The first segment offset is added with RTE_PKTMBUF_HEADROOM.
> > > @@ -1197,12 +1200,21 @@ struct rte_eth_txmode {
> > > * - pool from the last valid element
> > > * - the buffer size from this pool
> > > * - zero offset
> > > + *
> > > + * - Length based buffer split:
> > > + * - mp, length, offset should be configured.
> > > + * - The proto_hdr field should not be configured.
> > > + *
> > > + * - Protocol header based buffer split:
> > > + * - mp, offset, proto_hdr should be configured.
> > > + * - The length field should not be configured.
> > > */
> > > struct rte_eth_rxseg_split {
> > > struct rte_mempool *mp; /**< Memory pool to allocate segment
> > from. */
> > > uint16_t length; /**< Segment data length, configures split point. */
> > > uint16_t offset; /**< Data offset from beginning of mbuf data buffer.
> > */
> > > - uint32_t reserved; /**< Reserved field. */
> > > + /**< Supported ptypes mask of a specific pmd, configures split point.
> > */
> >
> > The doxygen syntax is wrong: remove the "<" which is for post-comment.
>
> Thanks for your catch.
>
> >
> > > + uint32_t proto_hdr;
> > > };
> >
> > How do we know it is a length or buffer split?
> > Is it based on checking some 0 value?
>
> Yes, as Andrew suggests, we introduced the API rte_eth_supported_hdrs_get() in v9.
> It will report the driver supported protocol headers to be split.
> If the API returns ENOTSUP, it means driver supports length based buffer split.
>
> Of course, no matter what kind of buffer split it is, we need to check
> RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT first.
So you need to talk about RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT in the comment of this struct.
More information about the dev
mailing list