A firm believer in helping yourself, when you can, and hopefully @guidosarducci as well:
[PATCH] net: essedma: disable default vlan tagging
Is close to applying on Linux 4.14. The second "hunk" is now at around line 1400 and is clearly recognizable, with mainly the addition of the unlikely()
branch helper macro.
That section now is also wrapped with if (!adapter->edma_cinfo->is_single_phy)
(which appears to be be case with the two Linksys devices.
Edit: Setting the first value in the vlan_tag property to zero for the two gmac devices may have the same impact as the chunkeey patch (causing the conditionals change the behavior similarly to the patch). Assuming no other, adverse impacts, and that it improves the situation this may be a non-patch way to move forward.
I don't have enough information to understand the vlan_tag
properties of the gmac
nodes (Edit: see later in this post for "decoding" of this), though changing from qcom,num_gmac = <2>;
to <1>
as that patch did for single-phy devices probably isn't the proper approach for dual-mac devices.`
There is an "interesting" correspondence between some of the ess-switch
properties and the two gmac
properties:
switch_cpu_bmp = <0x1>;
switch_lan_bmp = <0x1e>;
switch_wan_bmp = <0x20>;
gmac0: gmac0 {
local-mac-address = [00 00 00 00 00 00];
vlan_tag = <1 0x1f>;
};
gmac1: gmac1 {
local-mac-address = [00 00 00 00 00 00];
[...]
vlan_tag = <2 0x20>;
};
Edit: The three *_bmp
seem to be which physical ports are associated with each of two VLANs see drivers/net/phy/ar40xx.c: ar40xx_vlan_init()
0x01 0000 0001 -- CPU
0x1e 0001 1110 -- LAN
0x20 0010 0000 -- WAN
drivers/net/ethernet/qualcomm/essedma/edma_axi.c
as amended by patches/platform/710-net-add-qualcomm-essedma-ethernet-driver.patch
should reveal what vlan_tag
does.
First number is the adapter[idx]->default_vlan_tag
(which, as I recall, the chunkeey patch "defangs"Edit: as likely would setting it to 0, though full impact of that not evaluated yet.)
Second number is the ->dp_bmp
and is also used as portid_bmp
bitmap (after shifting off the CPU bit) for populating edma_cinfo->portid_netdev_lookup_tbl[<port index>]
(chasing this down now -- though that there can only be one value per port is "going to be interesting")
Yep, the netdev instances appear "hard wired" to ports through that map in drivers/net/ethernet/qualcomm/essedma/edma.c
So it looks like with two phys, one gets to be "permanently" associated with one port or set of ports, and the other with "the rest" of them (short of modifying the DT and re-initializing the driver).
(TBD if one phy can transmit out a port typically associated with the other phy, but that doesn't seem to be too practical for most applications.)
Both seem to go through a single, logical switch port, making me wonder if that pathway is limited to 1 Gbps, or if it is actually faster. Hmmm, wonder how (and how well) that OEM "bonding" feature works.
Going to have to sleep on this, as well as hope that there are magically more than two phys in there.