Subject: Re: [PATCH v3 5/8] net: dsa: hellcreek: Add TAPRIO offloading support

From: Vinicius Costa Gomes <[email-masked]>
Date: Mon, 24 Aug 2020 16:45:50 -0700

Hi Kurt,

Kurt Kanzenbach <[email-masked]> writes:

>>> +static void hellcreek_setup_tc_mapping(struct hellcreek *hellcreek,
>>> +				       struct net_device *netdev)
>>> +{
>>> +	int i, j;
>>> +
>>> +	/* Setup mapping between traffic classes and port queues. */
>>> +	for (i = 0; i < netdev_get_num_tc(netdev); ++i) {
>>> +		for (j = 0; j < netdev->tc_to_txq[i].count; ++j) {
>>> +			const int queue = j + netdev->tc_to_txq[i].offset;
>>> +
>>> +			hellcreek_select_prio(hellcreek, i);
>>> +			hellcreek_write(hellcreek,
>>> +					queue << HR_PRTCCFG_PCP_TC_MAP_SHIFT,
>>> +					HR_PRTCCFG);
>>> +		}
>>> +	}
>>> +}
>>
>> What other driver have you seen that does this?
>>
>
> Probably none.
>
> With TAPRIO traffic classes and the mapping to queues can be
> configured. The switch can also map traffic classes. That sounded like a
> good match to me.

The only reason I could think that you would need this that *right now*
taprio has pretty glaring oversight: that in the offload parameters each entry
'gate_mask' reference the "Traffic Class" (i.e. bit 0 is Traffic Class
0), and it really should be the HW queue.

I have a patch that does the conversion on taprio before talking to the
driver. Do you think it would help you avoid doing this on the driver
side?

> Thanks,
> Kurt

Cheers,
-- 
Vinicius