On Wed, Jul 17, 2019 at 09:31:11PM +0000, René van Dorst wrote: > Hi, > > I am trying to enable flow control/pause on PHYLINK and fixed-link. > > My setup SOC mac (mt7621) <-> RGMII <-> SWITCH mac (mt7530). > > It seems that in fixed-link mode all the flow control/pause bits are cleared > in > phylink_parse_fixedlink(). If I read phylink_parse_fixedlink() [0] correctly, > I see that pl->link_config.advertising is AND with pl->supprted which has only > the PHY_SETTING() modes bits set. pl->link_config.advertising is losing Pause > bits. pl->link_config.advertising is used in phylink_resolve_flow() to set the > MLO_PAUSE_RX/TX BITS. > > I think this is an error. > Because in phylink_start() see this part [1]. > > /* Apply the link configuration to the MAC when starting. This allows > * a fixed-link to start with the correct parameters, and also > * ensures that we set the appropriate advertisement for Serdes links. > */ > phylink_resolve_flow(pl, &pl->link_config); > phylink_mac_config(pl, &pl->link_config); > > > If I add a this hacky patch below, flow control is enabled on the fixed-link. > if (s) { > __set_bit(s->bit, pl->supported); > + if (phylink_test(pl->link_config.advertising, Pause)) > + phylink_set(pl->supported, Pause); > } else { > > So is phylink_parse_fixedlink() broken or should it handled in a other way?
Quite simply, if the MAC says it doesn't support pause modes (i.o.w. the validate callback clears them) then pause modes aren't supported. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up