lkml.org 
[lkml]   [2017]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next 2/2] net: dsa: lan9303: Add fdb/mdb manipulation
From
Date
On 18. okt. 2017 16:38, Vivien Didelot wrote:
> Hi Egil,
>
> Egil Hjelmeland <privat@egil-hjelmeland.no> writes:
>
>> +/* Delete static port from ALR entry, delete entry if last port */
>> +static int lan9303_alr_del_port(struct lan9303 *chip, const u8 *mac,
>> + int port)
>> +{
>> + struct lan9303_alr_cache_entry *entr;
>> +
>> + entr = lan9303_alr_cache_find_mac(chip, mac);
>> + if (!entr)
>> + return 0; /* no static entry found */
>> + /* Question: Should we delete any learned entry?
>> + * { lan9303_alr_set_entry(chip, mac, 0, false); return 0; }
>
> .port_fdb_del is meant to remove the association between a port and a
> MAC address in a given forwarding database. Deleting any learned entry
> is therefore out of scope of this function.
>
> Please mark such patchset as RFC next time so that the maintainer knows
> that it is not meant to be applied.
>
Thanks. And I will keep the RFC remark in mind.

>> + */
>> +
>> + entr->port_map &= ~BIT(port);
>> + if (entr->port_map == 0) /* zero means its free again */
>> + eth_zero_addr(&entr->port_map);
>> + lan9303_alr_set_entry(chip, mac, entr->port_map, entr->stp_override);
>> + return 0;
>> +}
>
> ...
>
>> +static int lan9303_port_fdb_add(struct dsa_switch *ds, int port,
>> + const unsigned char *addr, u16 vid)
>> +{
>> + struct lan9303 *chip = ds->priv;
>> +
>> + dev_dbg(chip->dev, "%s(%d, %pM, %d)\n", __func__, port, addr, vid);
>> + if (vid)
>> + return -EOPNOTSUPP;
>> + return lan9303_alr_add_port(chip, addr, port, false);
>> +}
>> +
>> +static int lan9303_port_fdb_del(struct dsa_switch *ds, int port,
>> + const unsigned char *addr, u16 vid)
>> +
>> +{
>> + struct lan9303 *chip = ds->priv;
>> +
>> + dev_dbg(chip->dev, "%s(%d, %pM, %d)\n", __func__, port, addr, vid);
>> + if (vid)
>> + return -EOPNOTSUPP;
>> + lan9303_alr_del_port(chip, addr, port);
>> + return 0;
>> +}
>
> I don't remember, this chip has a single forwarding database for the
> whole switch, is that correct?
>
Correct.

And the forwarding database (ALR) does not handle VLAN.
VLAN filtering is a separate step, with its own table.

>
> Thanks,
>
> Vivien
>

\
 
 \ /
  Last update: 2017-10-22 17:15    [W:0.070 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site