RE: [PATCH net-next 2/2] net: dsa: lan9303: Learn addresses on CPU port when bridged

2017-10-25 Thread Woojung.Huh
Hi Egil, > >> @@ -62,7 +80,10 @@ static struct sk_buff *lan9303_xmit(struct sk_buff > *skb, > >> struct net_device *dev) > >> > >>lan9303_tag = (u16 *)(skb->data + 2 * ETH_ALEN); > >>lan9303_tag[0] = htons(ETH_P_8021Q); > >> - lan9303_tag[1] = htons(dp->index | BIT(4)); > >> + lan9303_ta

Re: [PATCH net-next 2/2] net: dsa: lan9303: Learn addresses on CPU port when bridged

2017-10-25 Thread Egil Hjelmeland
Hi Woojung! On 24. okt. 2017 19:18, woojung@microchip.com wrote: Hi Egil, +static inline int lan9303_tx_use_arl(struct dsa_port *dp, u8 *dest_addr) +{ + struct lan9303 *chip = dp->ds->priv; + + return chip->is_bridged && !ether_addr_equal(dest_addr, eth_stp_addr); +} static

Re: [PATCH net-next 2/2] net: dsa: lan9303: Learn addresses on CPU port when bridged

2017-10-25 Thread Egil Hjelmeland
On 24. okt. 2017 18:33, Andrew Lunn wrote: On Tue, Oct 24, 2017 at 11:35:15AM +0200, Egil Hjelmeland wrote: + */ +static inline int lan9303_tx_use_arl(struct dsa_port *dp, u8 *dest_addr) Hi Egil There is no need for the inline. The compiler will do that anyway, for a function like this. > Wi

RE: [PATCH net-next 2/2] net: dsa: lan9303: Learn addresses on CPU port when bridged

2017-10-24 Thread Woojung.Huh
Hi Egil, > +static inline int lan9303_tx_use_arl(struct dsa_port *dp, u8 *dest_addr) > +{ > + struct lan9303 *chip = dp->ds->priv; > + > + return chip->is_bridged && !ether_addr_equal(dest_addr, > eth_stp_addr); > +} > > static struct sk_buff *lan9303_xmit(struct sk_buff *skb, struct net

Re: [PATCH net-next 2/2] net: dsa: lan9303: Learn addresses on CPU port when bridged

2017-10-24 Thread Andrew Lunn
On Tue, Oct 24, 2017 at 11:35:15AM +0200, Egil Hjelmeland wrote: > When CPU transmit directly to port using tag, the LAN9303 does not > learn MAC addresses received on the CPU port into the ALR. > ALR learning is performed only when transmitting using ALR lookup. > > Solution: > If the two externa

[PATCH net-next 2/2] net: dsa: lan9303: Learn addresses on CPU port when bridged

2017-10-24 Thread Egil Hjelmeland
When CPU transmit directly to port using tag, the LAN9303 does not learn MAC addresses received on the CPU port into the ALR. ALR learning is performed only when transmitting using ALR lookup. Solution: If the two external ports are bridged and the packet is not STP BPDU, then use ALR lookup to al