Subject: Re: [PATCH net-next 09/13] bnx2x: add pri_map module parameter

From: John Fastabend <[email-masked]>
Date: Thu, 10 Nov 2011 12:34:50 -0800

On 11/10/2011 12:21 PM, Dmitry Kravkov wrote:
> Resending for netdev
> On Thu, Nov 10, 2011 at 10:18 PM, Dmitry Kravkov <[email-masked]> wrote:
>>
>> On Thu, Nov 10, 2011 at 7:39 PM, Ben Hutchings <[email-masked]> wrote:
>>>
>>> On Thu, 2011-11-10 at 17:14 +0200, Dmitry Kravkov wrote:
>>>> From: Ariel Elior <[email-masked]>
>>>>
>>>> The optional parameter pri_map is used to map the
>>>> skb->priority to a Class Of Service (CoS) in the HW.
>>>> This 32 bit parameter is evaluated by the  driver as 8
>>>> values of 4 bits each. Each nibble sets the desired
>>>> HW queue number for that priority.
>>> [...]
>>>
>>> You should implement ndo_tc_setup instead of adding a driver-specific
>>> parameter (that should be per-device anyway).
>>
>> bnx2x has ndo_setup_tc, but the callback configures device for number of traffic
>> only, when actual mapping of priority to cos is done according to DCB negotiation.
>> The parameter allow user to force mapping if the link partner is not DCB capable.
>>
> --

Use 'tc' to configure the mapping explicitly then. Or allow DCBnl
set commands to be sent down either ieee_setets() or setpgtccfgtx()
are used to configure priority to traffic class mappings. Then you
could use a user space tool to set up all your DCB attributes without
DCBX running (e.g. dcbtool/lldptol but I'm partial).

For example 'tc' commands,

# tc qdisc add dev eth3 root mqprio map 0 1 2 3 
# tc qdisc add dev eth3 root mqprio help
Usage: ... mqprio [num_tc NUMBER] [map P0 P1 ...]
                  [queues count1@offset1 count2@offset2 ...] [hw 1|0]

It might be nice to add the ability to change the mapping after the tc
has been created though. Maybe I'll get to this in the next week or
two.

John.