Re: [RFC PATCH v4 net-next 06/11] net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac

From: grygorii
Date: Wed Jun 26 2019 - 10:48:12 EST




On 26/06/2019 12:58, Ivan Khoronzhuk wrote:
Hi Grygorii

Too much code, but I've tried pass thru.
Probably expectation the devlink to be reviewed, but several
common replies that should be reflected in non RFC v.

On Fri, Jun 21, 2019 at 09:13:09PM +0300, Grygorii Strashko wrote:
From: Ilias Apalodimas <ilias.apalodimas@xxxxxxxxxx>

Part 1:
Introduce basic CPSW dual_mac driver (cpsw_new.c) which is operating in
dual-emac mode by default, thus working as 2 individual network interfaces.
Main differences from legacy CPSW driver are:

- optimized promiscuous mode: The P0_UNI_FLOOD (both ports) is enabled in
addition to ALLMULTI (current port) instead of ALE_BYPASS. So, Ports in
promiscuous mode will keep possibility of mcast and vlan filtering, which
is provides significant benefits when ports are joined to the same bridge,
but without enabling "switch" mode, or to different bridges.
- learning disabled on ports as it make not too much sense for
 segregated ports - no forwarding in HW.
- enabled basic support for devlink.

ÂÂÂÂdevlink dev show
ÂÂÂÂÂÂÂ platform/48484000.ethernet_switch

ÂÂÂÂdevlink dev param show
ÂÂÂÂ platform/48484000.ethernet_switch:
ÂÂÂÂname ale_bypass type driver-specific
ÂÂÂÂ values:
ÂÂÂÂÂÂÂ cmode runtime value false

- "ale_bypass" devlink driver parameter allows to enable
ALE_CONTROL(4).BYPASS mode for debug purposes.
- updated DT bindings.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@xxxxxxxxxx>
Signed-off-by: Murali Karicheri <m-karicheri2@xxxxxx>


[...]

+
+ÂÂÂ /* setup host port priority mapping */
+ÂÂÂ writel_relaxed(CPDMA_TX_PRIORITY_MAP,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ &cpsw->host_port_regs->cpdma_tx_pri_map);
+ÂÂÂ writel_relaxed(0, &cpsw->host_port_regs->cpdma_rx_chan_map);

----
+
+ÂÂÂ /* disable priority elevation */
+ÂÂÂ writel_relaxed(0, &cpsw->regs->ptype);
+
+ÂÂÂ /* enable statistics collection only on all ports */
+ÂÂÂ writel_relaxed(0x7, &cpsw->regs->stat_port_en);
+
+ÂÂÂ /* Enable internal fifo flow control */
+ÂÂÂ writel(0x7, &cpsw->regs->flow_control);
---

Would be nice to do the same in old driver.
I mean moving it from ndo_open
Also were thoughts about this.

I have no plans to perform any kind of optimization in old driver any more.

Agree with other comments.

[...]

Thank you.

--
Best regards,
grygorii