On Tue, Aug 29, 2017 at 3:36 PM, Vamsi Attunuru <vamsi.cav...@gmail.com> wrote:
> Signed-off-by: Vamsi Attunuru <vattun...@cavium.com> > Signed-off-by: Shally Verma <sve...@cavium.com> > Signed-off-by: Mahipal Challa <mcha...@cavium.com> > > --- > include/odp/api/spec/packet_io.h | 43 +++++++++++++++++++++--------- > ---------- > 1 file changed, 23 insertions(+), 20 deletions(-) > > diff --git a/include/odp/api/spec/packet_io.h > b/include/odp/api/spec/packet_io.h > index be81c3d..c372a2a 100644 > --- a/include/odp/api/spec/packet_io.h > +++ b/include/odp/api/spec/packet_io.h > @@ -440,6 +440,29 @@ typedef struct odp_pktio_config_t { > */ > odp_bool_t outbound_ipsec; > > + /** MTU size of the pktio interface. > + * > + * It's the frame size which the pktio can transmit without > fragmentation. > + * And it does not count L2 header bytes, FCS and VLAN tag bytes. > Discussion on the number of bytes accounted for MTU size calculation was not concluded in last public call. I am wondering how ODP is different from other implementations, where most of the implementations (which facilitate networking applications to send over the pkts) are not considering L2 headers & checksum as part of it MTU size calculations,( it does consider those for frame size calculations) and there also, the application pushes the entire ethernet frame(1500+14 bytes) to the underneath implementation. any other suggestions are welcome. > + * > + * pktio interface must be able to send and receive packets up to > + * this MTU size successfully. Trying to send or receive packets > larger > + * than these MTU results in undefined behavior. > + * > + * By default, pktio is configured with max support MTU size. > + * > Will take care of explaining default value. > + * Max supported MTU can be read through these parameter > + * as part of odp_pktio_capability() routine. > + * > + * MTU can be modified by passing valid > odp_pktio_config_t:mtu_size value > + * as part of odp_pktio_config() routine. > + * > + * Valid MTU value should be greater than 0 and less than or equal > to the > + * value get through odp_pktio_capability(), > + * i.e. 0 < mtu_size <= capability provided mtu value. > + */ > + uint32_t mtu_size; > Do we really need MRU as well. + > } odp_pktio_config_t; > > /** > @@ -452,9 +475,6 @@ typedef union odp_pktio_set_op_t { > struct { > /** Promiscuous mode */ > uint32_t promisc_mode : 1; > - > - /** Allow app to set MTU size */ > - uint32_t mtu_set : 1; > } op; > /** All bits of the bit field structure. > * This field can be used to set/clear all flags, or bitwise > @@ -484,8 +504,6 @@ typedef struct odp_pktio_capability_t { > /** @deprecated Use enable_loop inside odp_pktin_config_t */ > odp_bool_t ODP_DEPRECATE(loop_supported); > > - /** Maximum MTU size supported */ > - uint32_t max_mtu_size; > } odp_pktio_capability_t; > > /** > @@ -916,21 +934,6 @@ 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. > - * > - * Application should pass value upto max_mtu_size as indicated by > - * odp_pktio_capability_t:max_mtu_size. Any value beyond max_mtu_size > - * limit will result in failure. mtu value < 68 also results in failure. > - * > - * @param pktio Packet IO handle. > - * @param mtu MTU value to be set. > - * > - * @return 0 on success > - * @retval <0 on failure > - */ > -int odp_pktio_mtu_set(odp_pktio_t pktio, uint32_t mtu); > - > -/** > * Enable/Disable promiscuous mode on a packet IO interface. > * > * @param[in] pktio Packet IO handle. > -- > 1.9.3 > >