> -----Original Message----- > From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Vamsi > Attunuru > Sent: Thursday, July 13, 2017 11:54 AM > To: lng-odp@lists.linaro.org > Cc: macha...@cavium.com; pathr...@cavium.com; vattun...@cavium.com; > sve...@cavium.com > Subject: [lng-odp] [PATCH v1 1/1] pktio APIs to modify the MAC address or > the MTU size of the given packet IO handler. > > --- > include/odp/api/spec/packet_io.h | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/include/odp/api/spec/packet_io.h > b/include/odp/api/spec/packet_io.h > index c7373fd..a950267 100644 > --- a/include/odp/api/spec/packet_io.h > +++ b/include/odp/api/spec/packet_io.h > @@ -382,6 +382,10 @@ typedef union odp_pktio_set_op_t { > struct { > /** Promiscuous mode */ > uint32_t promisc_mode : 1; > + /** mac addr */ > + uint32_t mac : 1; > + /** mtu addr */ > + uint32_t mtu : 1; > } op; > /** All bits of the bit field structure. > * This field can be used to set/clear all flags, or bitwise > @@ -413,6 +417,9 @@ typedef struct odp_pktio_capability_t { > * A boolean to denote whether loop back mode is supported on > this > * specific interface. */ > odp_bool_t loop_supported; > + > + /* max mtu size supported */ > + uint32_t max_mtu_size; > } odp_pktio_capability_t; > > /** > @@ -843,6 +850,16 @@ int odp_pktout_send(odp_pktout_queue_t queue, const > odp_packet_t packets[], > uint32_t odp_pktio_mtu(odp_pktio_t pktio); > > /** > + * Set MTU value of a packet IO interface. > + * > + * @param[in] pktio Packet IO handle.
[in] is not needed, by default all params are "in" and we mark only those that are "out" or "in and out" @param mtu documentation is missing. Run 'make doxygen-doc' and correct all warnings before posting. > + * > + * @return 0 on success > + * @retval -1 on failure > + */ > +int odp_pktio_mtu_set(odp_pktio_t pktio, int mtu); mtu should be uint32_t > + > +/** > * Enable/Disable promiscuous mode on a packet IO interface. > * > * @param[in] pktio Packet IO handle. > @@ -877,6 +894,18 @@ int odp_pktio_promisc_mode(odp_pktio_t pktio); > int odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, int size); > > /** > + * Set the MAC address of a packet IO interface. > + * > + * @param pktio Packet IO handle > + * @param[in] mac_addr Input buffer Remove [in] "Input buffer" is too generic. "Pointer to MAC address to be set on the interface" or similar > + * @param size Size of output buffer > + * > + * @return Number of bytes written (actual size of MAC address) Return success or fail, since application would not want to write partial MAC address. Read side API offer a way to get address size of application is uncertain. On write side application should know the size. > + * @retval <0 on failure > + */ > +int odp_pktio_mac_addr_set(odp_pktio_t pktio, void *mac_addr, int size); const void *mac_addr, since it's read only data for the implementation. -Petri