Thread (44 messages) flat view 44 messages, 9 authors, 2020-09-01

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

From: Kurt Kanzenbach <kurt@linutronix.de>
Date: 2020-08-25 09:42:08
Also in: linux-devicetree

On Mon Aug 24 2020, Vinicius Costa Gomes wrote:
Hi Kurt,

Kurt Kanzenbach [off-list ref] writes:
quoted
quoted
quoted
+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?
I think so. As Vladimir pointed out, the driver should setup an identity
mapping which I already did by default.

Can you point me your patch?

Thanks,
Kurt

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help