[dpdk-dev] [PATCH v2] ether: use a default for max Rx frame size in configure()

Thomas Monjalon thomas.monjalon at 6wind.com
Fri Apr 7 10:34:48 CEST 2017


2017-04-07 10:09, Andriy Berestovskyy:
> Hi Thomas,
> 
> On 06.04.2017 22:48, Thomas Monjalon wrote:
> > Anyway, why not fixing it in the reverse way: returning error for
> > out of range of non-jumbo frames?
> 
> I guess we need to fix most of the examples then, since most of them 
> just pass 0 for normal frames. And there is no default for jumbo frames, 
> so an app must first get this info from the NIC...

Yes, I would vote to return the NIC capabilities to the app.

> > I am not sure setting a default value in the back of the caller is really
> > a good behaviour.
> 
>  From app perspective, any working default is better that a non-working 
> app, which you have to fix and recompile on each PMD/platform.

Right
That's why there should be a capabilities API for this need.

> What if we use 0 for a default value both for normal and jumbo frames 
> (i.e. ETHER_MAX_LEN and dev_info.max_rx_pktlen) and an error if user 
> passed a non-zero max_rx_pkt_len?

We can set the right default value if the app input is 0,
as a special case.
For any other value, we must try to set it or return an error.

> It will make it consistent, we will not need to fix the existing apps 
> and we will have a default both for normal and jumbo frames. Win-win? ;)



More information about the dev mailing list