<div dir="auto">Your right my test was crude. Just do build and look at symbol table of static linked binary.<div dir="auto">I was confused since pointer is exposed but not data structure</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 5, 2024, 07:40 David Marchand <<a href="mailto:david.marchand@redhat.com">david.marchand@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Dec 3, 2024 at 10:13 PM Stephen Hemminger<br>
<<a href="mailto:stephen@networkplumber.org" target="_blank" rel="noreferrer">stephen@networkplumber.org</a>> wrote:<br>
><br>
> On Mon, 21 Oct 2024 01:52:46 +0000<br>
> Wathsala Vithanage <<a href="mailto:wathsala.vithanage@arm.com" target="_blank" rel="noreferrer">wathsala.vithanage@arm.com</a>> wrote:<br>
><br>
> > Extend the ethdev library to enable the stashing of different data<br>
> > objects, such as the ones listed below, into CPU caches directly<br>
> > from the NIC.<br>
> ><br>
> > - Rx/Tx queue descriptors<br>
> > - Rx packets<br>
> > - Packet headers<br>
> > - packet payloads<br>
> > - Data of a packet at an offset from the start of the packet<br>
> ><br>
> > The APIs are designed in a hardware/vendor agnostic manner such that<br>
> > supporting PMDs could use any capabilities available in the underlying<br>
> > hardware for fine-grained stashing of data objects into a CPU cache<br>
> > (e.g., Steering Tags int PCIe TLP Processing Hints).<br>
> ><br>
> > The API provides an interface to query the availability of stashing<br>
> > capabilities, i.e., platform/NIC support, stashable object types, etc,<br>
> > via the rte_eth_dev_stashing_capabilities_get interface.<br>
> ><br>
> > The function pair rte_eth_dev_stashing_rx_config_set and<br>
> > rte_eth_dev_stashing_tx_config_set sets the stashing hint (the CPU,<br>
> > cache level, and data object types) on the Rx and Tx queues.<br>
> ><br>
> > PMDs that support stashing must register their implementations with the<br>
> > following eth_dev_ops callbacks, which are invoked by the ethdev<br>
> > functions listed above.<br>
> ><br>
> > - stashing_capabilities_get<br>
> > - stashing_rx_hints_set<br>
> > - stashing_tx_hints_set<br>
> ><br>
> > Signed-off-by: Wathsala Vithanage <<a href="mailto:wathsala.vithanage@arm.com" target="_blank" rel="noreferrer">wathsala.vithanage@arm.com</a>><br>
> > Reviewed-by: Honnappa Nagarahalli <<a href="mailto:honnappa.nagarahalli@arm.com" target="_blank" rel="noreferrer">honnappa.nagarahalli@arm.com</a>><br>
> > Reviewed-by: Dhruv Tripathi <<a href="mailto:dhruv.tripathi@arm.com" target="_blank" rel="noreferrer">dhruv.tripathi@arm.com</a>><br>
> ><br>
> > ---<br>
> >  lib/ethdev/ethdev_driver.h |  66 +++++++++++++++<br>
> >  lib/ethdev/rte_ethdev.c    | 120 +++++++++++++++++++++++++++<br>
> >  lib/ethdev/rte_ethdev.h    | 161 +++++++++++++++++++++++++++++++++++++<br>
> >  lib/ethdev/version.map     |   4 +<br>
> >  4 files changed, 351 insertions(+)<br>
> ><br>
> > diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h<br>
> > index 1fd4562b40..7caaea54a8 100644<br>
> > --- a/lib/ethdev/ethdev_driver.h<br>
> > +++ b/lib/ethdev/ethdev_driver.h<br>
> > @@ -1367,6 +1367,68 @@ enum rte_eth_dev_operation {<br>
> >  typedef uint64_t (*eth_get_restore_flags_t)(struct rte_eth_dev *dev,<br>
> >                                           enum rte_eth_dev_operation op);<br>
> ><br>
> > +/**<br>
> > + * @internal<br>
> > + * Set cache stashing hints in Rx queue.<br>
> > + *<br>
> > + * @param dev<br>
> > + *   Port (ethdev) handle.<br>
> > + * @param queue_id<br>
> > + *   Rx queue.<br>
> > + * @param config<br>
> > + *   Stashing hints configuration for the queue.<br>
> > + *<br>
> > + * @return<br>
> > + *   -ENOTSUP if the device or the platform does not support cache stashing.<br>
> > + *   -ENOSYS  if the underlying PMD hasn't implemented cache stashing feature.<br>
> > + *   -EINVAL  on invalid arguments.<br>
> > + *   0 on success.<br>
> > + */<br>
> > +typedef int (*eth_stashing_rx_hints_set_t)(struct rte_eth_dev *dev, uint16_t queue_id,<br>
> > +                                        struct rte_eth_stashing_config *config);<br>
> > +<br>
> > +/**<br>
> > + * @internal<br>
> > + * Set cache stashing hints in Tx queue.<br>
> > + *<br>
> > + * @param dev<br>
> > + *   Port (ethdev) handle.<br>
> > + * @param queue_id<br>
> > + *   Tx queue.<br>
> > + * @param config<br>
> > + *   Stashing hints configuration for the queue.<br>
> > + *<br>
> > + * @return<br>
> > + *   -ENOTSUP if the device or the platform does not support cache stashing.<br>
> > + *   -ENOSYS  if the underlying PMD hasn't implemented cache stashing feature.<br>
> > + *   -EINVAL  on invalid arguments.<br>
> > + *   0 on success.<br>
> > + */<br>
> > +typedef int (*eth_stashing_tx_hints_set_t)(struct rte_eth_dev *dev, uint16_t queue_id,<br>
> > +                                        struct rte_eth_stashing_config *config);<br>
> > +<br>
> > +/**<br>
> > + * @internal<br>
> > + * Get cache stashing object types supported in the ethernet device.<br>
> > + * The return value indicates availability of stashing hints support<br>
> > + * in the hardware and the PMD.<br>
> > + *<br>
> > + * @param dev<br>
> > + *   Port (ethdev) handle.<br>
> > + * @param objects<br>
> > + *   PMD sets supported bits on return.<br>
> > + *<br>
> > + * @return<br>
> > + *   -ENOTSUP if the device or the platform does not support cache stashing.<br>
> > + *   -ENOSYS  if the underlying PMD hasn't implemented cache stashing feature.<br>
> > + *   -EINVAL  on NULL values for types or hints parameters.<br>
> > + *   On return, types and hints parameters will have bits set for supported<br>
> > + *   object types and hints.<br>
> > + *   0 on success.<br>
> > + */<br>
> > +typedef int (*eth_stashing_capabilities_get_t)(struct rte_eth_dev *dev,<br>
> > +                                          uint16_t *objects);<br>
> > +<br>
> >  /**<br>
> >   * @internal A structure containing the functions exported by an Ethernet driver.<br>
> >   */<br>
> > @@ -1393,6 +1455,10 @@ struct eth_dev_ops {<br>
> >       eth_mac_addr_remove_t      mac_addr_remove; /**< Remove MAC address */<br>
> >       eth_mac_addr_add_t         mac_addr_add;  /**< Add a MAC address */<br>
> >       eth_mac_addr_set_t         mac_addr_set;  /**< Set a MAC address */<br>
> > +     eth_stashing_rx_hints_set_t   stashing_rx_hints_set; /**< Set Rx cache stashing*/<br>
> > +     eth_stashing_tx_hints_set_t   stashing_tx_hints_set; /**< Set Tx cache stashing*/<br>
> > +     /** Get supported stashing hints*/<br>
> > +     eth_stashing_capabilities_get_t stashing_capabilities_get;<br>
> >       /** Set list of multicast addresses */<br>
> >       eth_set_mc_addr_list_t     set_mc_addr_list;<br>
> >       mtu_set_t                  mtu_set;       /**< Set MTU */<br>
><br>
> Since eth_dev_ops is visible in application binary, it is part of the ABI.<br>
> Therefore it can not be changed until 25.11 release.<br>
<br>
The layout of eth_dev_ops is not exposed to applications as it is in a<br>
private header.<br>
Could you clarify where you see a breakage for an application?<br>
<br>
<br>
I see an ABI breakage for out of tree drivers though.<br>
This could be avoided by moving those added ops at the end of the struct?<br>
<br>
<br>
-- <br>
David Marchand<br>
<br>
</blockquote></div>