1. 15 12月, 2020 1 次提交
  2. 06 12月, 2020 1 次提交
    • V
      net: mscc: ocelot: fix dropping of unknown IPv4 multicast on Seville · edd2410b
      Vladimir Oltean 提交于
      The current assumption is that the felix DSA driver has flooding knobs
      per traffic class, while ocelot switchdev has a single flooding knob.
      This was correct for felix VSC9959 and ocelot VSC7514, but with the
      introduction of seville VSC9953, we see a switch driven by felix.c which
      has a single flooding knob.
      
      So it is clear that we must do what should have been done from the
      beginning, which is not to overwrite the configuration done by ocelot.c
      in felix, but instead to teach the common ocelot library about the
      differences in our switches, and set up the flooding PGIDs centrally.
      
      The effect that the bogus iteration through FELIX_NUM_TC has upon
      seville is quite dramatic. ANA_FLOODING is located at 0x00b548, and
      ANA_FLOODING_IPMC is located at 0x00b54c. So the bogus iteration will
      actually overwrite ANA_FLOODING_IPMC when attempting to write
      ANA_FLOODING[1]. There is no ANA_FLOODING[1] in sevile, just ANA_FLOODING.
      
      And when ANA_FLOODING_IPMC is overwritten with a bogus value, the effect
      is that ANA_FLOODING_IPMC gets the value of 0x0003CF7D:
      	MC6_DATA = 61,
      	MC6_CTRL = 61,
      	MC4_DATA = 60,
      	MC4_CTRL = 0.
      Because MC4_CTRL is zero, this means that IPv4 multicast control packets
      are not flooded, but dropped. An invalid configuration, and this is how
      the issue was actually spotted.
      Reported-by: NEldar Gasanov <eldargasanov2@gmail.com>
      Reported-by: NMaxim Kochetkov <fido_max@inbox.ru>
      Tested-by: NEldar Gasanov <eldargasanov2@gmail.com>
      Fixes: 84705fc1 ("net: dsa: felix: introduce support for Seville VSC9953 switch")
      Fixes: 3c7b51bd ("net: dsa: felix: allow flooding for all traffic classes")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Link: https://lore.kernel.org/r/20201204175416.1445937-1-vladimir.oltean@nxp.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      edd2410b
  3. 03 11月, 2020 6 次提交
    • V
      net: mscc: ocelot: deny changing the native VLAN from the prepare phase · 2f0402fe
      Vladimir Oltean 提交于
      Put the preparation phase of switchdev VLAN objects to some good use,
      and move the check we already had, for preventing the existence of more
      than one egress-untagged VLAN per port, to the preparation phase of the
      addition.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      2f0402fe
    • V
      net: mscc: ocelot: move the logic to drop 802.1p traffic to the pvid deletion · be0576fe
      Vladimir Oltean 提交于
      Currently, the ocelot_port_set_native_vlan() function starts dropping
      untagged and prio-tagged traffic when the native VLAN is removed?
      
      What is the native VLAN? It is the only egress-untagged VLAN that ocelot
      supports on a port. If the port is a trunk with 100 VLANs, one of those
      VLANs can be transmitted as egress-untagged, and that's the native VLAN.
      
      Is it wrong to drop untagged and prio-tagged traffic if there's no
      native VLAN? Yes and no.
      
      In this case, which is more typical, it's ok to apply that drop
      configuration:
      $ bridge vlan add dev swp0 vid 1 pvid untagged <- this is the native VLAN
      $ bridge vlan add dev swp0 vid 100
      $ bridge vlan add dev swp0 vid 101
      $ bridge vlan del dev swp0 vid 1 <- delete the native VLAN
      But only because the pvid and the native VLAN have the same ID.
      
      In this case, it isn't:
      $ bridge vlan add dev swp0 vid 1 pvid
      $ bridge vlan add dev swp0 vid 100 untagged <- this is the native VLAN
      $ bridge vlan del dev swp0 vid 101
      $ bridge vlan del dev swp0 vid 100 <- delete the native VLAN
      
      It's wrong, because the switch will drop untagged and prio-tagged
      traffic now, despite having a valid pvid of 1.
      
      The confusion seems to stem from the fact that the native VLAN is an
      egress setting, while the PVID is an ingress setting. It would be
      correct to drop untagged and prio-tagged traffic only if there was no
      pvid on the port. So let's do just that.
      
      Background:
      https://lore.kernel.org/netdev/CA+h21hrRMrLH-RjBGhEJSTZd6_QPRSd3RkVRQF-wNKkrgKcRSA@mail.gmail.com/#tSigned-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      be0576fe
    • V
      net: mscc: ocelot: add a "valid" boolean to struct ocelot_vlan · e2b2e83e
      Vladimir Oltean 提交于
      Currently we are checking in some places whether the port has a native
      VLAN on egress or not, by comparing the ocelot_port->vid value with zero.
      
      That works, because VID 0 can never be a native VLAN configured by the
      bridge, but now we want to make similar checks for the pvid. That won't
      work, because there are cases when we do have the pvid set to 0 (not by
      the bridge, by ourselves, but still.. it's confusing). And we can't
      encode a negative value into an u16, so add a bool to the structure.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e2b2e83e
    • V
      net: mscc: ocelot: transform the pvid and native vlan values into a structure · c3e58a75
      Vladimir Oltean 提交于
      This is a mechanical patch only.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      c3e58a75
    • V
      net: mscc: ocelot: don't reset the pvid to 0 when deleting it · 110e847c
      Vladimir Oltean 提交于
      I have no idea why this code is here, but I have 2 hypotheses:
      
      1.
      A desperate attempt to keep untagged traffic working when the bridge
      deletes the pvid on a port.
      
      There was a fairly okay discussion here:
      https://lore.kernel.org/netdev/CA+h21hrRMrLH-RjBGhEJSTZd6_QPRSd3RkVRQF-wNKkrgKcRSA@mail.gmail.com/#t
      which established that in vlan_filtering=1 mode, the absence of a pvid
      should denote that the ingress port should drop untagged and priority
      tagged traffic. While in vlan_filtering=0 mode, nothing should change.
      
      So in vlan_filtering=1 mode, we should simply let things happen, and not
      attempt to save the day. And in vlan_filtering=0 mode, the pvid is 0
      anyway, no need to do anything.
      
      2.
      The driver encodes the native VLAN (ocelot_port->vid) value of 0 as
      special, meaning "not valid". There are checks based on that. But there
      are no such checks for the ocelot_port->pvid value of 0. In fact, that's
      a perfectly valid value, which is used in standalone mode. Maybe there
      was some confusion and the author thought that 0 means "invalid" here as
      well.
      
      In conclusion, delete the code*.
      
      *in fact we'll add it back later, in a slightly different form, but for
      an entirely different reason than the one for which this exists now.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      110e847c
    • V
      net: mscc: ocelot: use the pvid of zero when bridged with vlan_filtering=0 · 75e5a554
      Vladimir Oltean 提交于
      Currently, mscc_ocelot ports configure pvid=0 in standalone mode, and
      inherit the pvid from the bridge when one is present.
      
      When the bridge has vlan_filtering=0, the software semantics are that
      packets should be received regardless of whether there's a pvid
      configured on the ingress port or not. However, ocelot does not observe
      those semantics today.
      
      Moreover, changing the PVID is also a problem with vlan_filtering=0.
      We are privately remapping the VID of FDB, MDB entries to the port's
      PVID when those are VLAN-unaware (i.e. when the VID of these entries
      comes to us as 0). But we have no logic of adjusting that remapping when
      the user changes the pvid and vlan_filtering is 0. So stale entries
      would be left behind, and untagged traffic will stop matching on them.
      
      And even if we were to solve that, there's an even bigger problem. If
      swp0 has pvid 1, and swp1 has pvid 2, and both are under a vlan_filtering=0
      bridge, they should be able to forward traffic between one another.
      However, with ocelot they wouldn't do that.
      
      The simplest way of fixing this is to never configure the pvid based on
      what the bridge is asking for, when vlan_filtering is 0. Only if there
      was a VLAN that the bridge couldn't mangle, that we could use as pvid....
      So, turns out, there's 0 just for that. And for a reason: IEEE
      802.1Q-2018, page 247, Table 9-2-Reserved VID values says:
      
      	The null VID. Indicates that the tag header contains only
      	priority information; no VID is present in the frame.
      	This VID value shall not be configured as a PVID or a member
      	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      	of a VID Set, or configured in any FDB entry, or used in any
      	Management operation.
      
      So, aren't we doing exactly what 802.1Q says not to? Well, in a way, but
      what we're doing here is just driver-level bookkeeping, all for the
      better. The fact that we're using a pvid of 0 is not observable behavior
      from the outside world: the network stack does not see the classified
      VLAN that the switch uses, in vlan_filtering=0 mode. And we're also more
      consistent with the standalone mode now.
      
      And now that we use the pvid of 0 in this mode, there's another advantage:
      we don't need to perform any VID remapping for FDB and MDB entries either,
      we can just use the VID of 0 that the bridge is passing to us.
      
      The only gotcha is that every time we change the vlan_filtering setting,
      we need to reapply the pvid (either to 0, or to the value from the bridge).
      A small side-effect visible in the patch is that ocelot_port_set_pvid
      needs to be moved above ocelot_port_vlan_filtering, so that it can be
      called from there without forward-declarations.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      75e5a554
  4. 31 10月, 2020 5 次提交
  5. 12 10月, 2020 1 次提交
    • V
      net: mscc: ocelot: offload VLAN mangle action to VCAP IS1 · 70edfae1
      Vladimir Oltean 提交于
      The VCAP_IS1_ACT_VID_REPLACE_ENA action, from the VCAP IS1 ingress TCAM,
      changes the classified VLAN.
      
      We are only exposing this ability for switch ports that are under VLAN
      aware bridges. This is because in standalone ports mode and under a
      bridge with vlan_filtering=0, the ocelot driver configures the switch to
      operate as VLAN-unaware, so the classified VLAN is not derived from the
      802.1Q header from the packet, but instead is always equal to the
      port-based VLAN ID of the ingress port. We _can_ still change the
      classified VLAN for packets when operating in this mode, but the end
      result will most likely be a drop, since both the ingress and the egress
      port need to be members of the modified VLAN. And even if we install the
      new classified VLAN into the VLAN table of the switch, the result would
      still not be as expected: we wouldn't see, on the output port, the
      modified VLAN tag, but the original one, even though the classified VLAN
      was indeed modified. This is because of how the hardware works: on
      egress, what is pushed to the frame is a "port tag", which gives us the
      following options:
      
      - Tag all frames with port tag (derived from the classified VLAN)
      - Tag all frames with port tag, except if the classified VLAN is 0 or
        equal to the native VLAN of the egress port
      - No port tag
      
      Needless to say, in VLAN-unaware mode we are disabling the port tag.
      Otherwise, the existing VLAN tag would be ignored, and a second VLAN
      tag (the port tag), holding the classified VLAN, would be pushed
      (instead of replacing the existing 802.1Q tag). This is definitely not
      what the user wanted when installing a "vlan modify" action.
      
      So it is simply not worth bothering with VLAN modify rules under other
      configurations except when the ports are fully VLAN-aware.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      70edfae1
  6. 06 10月, 2020 1 次提交
  7. 05 10月, 2020 1 次提交
    • V
      net: dsa: propagate switchdev vlan_filtering prepare phase to drivers · 2e554a7a
      Vladimir Oltean 提交于
      A driver may refuse to enable VLAN filtering for any reason beyond what
      the DSA framework cares about, such as:
      - having tc-flower rules that rely on the switch being VLAN-aware
      - the particular switch does not support VLAN, even if the driver does
        (the DSA framework just checks for the presence of the .port_vlan_add
        and .port_vlan_del pointers)
      - simply not supporting this configuration to be toggled at runtime
      
      Currently, when a driver rejects a configuration it cannot support, it
      does this from the commit phase, which triggers various warnings in
      switchdev.
      
      So propagate the prepare phase to drivers, to give them the ability to
      refuse invalid configurations cleanly and avoid the warnings.
      
      Since we need to modify all function prototypes and check for the
      prepare phase from within the drivers, take that opportunity and move
      the existing driver restrictions within the prepare phase where that is
      possible and easy.
      
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Cc: Woojung Huh <woojung.huh@microchip.com>
      Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
      Cc: Sean Wang <sean.wang@mediatek.com>
      Cc: Landen Chao <Landen.Chao@mediatek.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Vivien Didelot <vivien.didelot@gmail.com>
      Cc: Jonathan McDowell <noodles@earth.li>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Claudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e554a7a
  8. 03 10月, 2020 2 次提交
    • X
      net: mscc: ocelot: offload egress VLAN rewriting to VCAP ES0 · 2f17c050
      Xiaoliang Yang 提交于
      VCAP ES0 is an egress VCAP operating on all outgoing frames.
      This patch added ES0 driver to support vlan push action of tc filter.
      Usage:
      
      tc filter add dev swp1 egress protocol 802.1Q flower indev swp0 skip_sw \
              vlan_id 1 vlan_prio 1 action vlan push id 2 priority 2
      Signed-off-by: NXiaoliang Yang <xiaoliang.yang_1@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f17c050
    • X
      net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1 · 75944fda
      Xiaoliang Yang 提交于
      VCAP IS1 is a VCAP module which can filter on the most common L2/L3/L4
      Ethernet keys, and modify the results of the basic QoS classification
      and VLAN classification based on those flow keys.
      
      There are 3 VCAP IS1 lookups, mapped over chains 10000, 11000 and 12000.
      Currently the driver is hardcoded to use IS1_ACTION_TYPE_NORMAL half
      keys.
      
      Note that the VLAN_MANGLE has been omitted for now. In hardware, the
      VCAP_IS1_ACT_VID_REPLACE_ENA field replaces the classified VLAN
      (metadata associated with the frame) and not the VLAN from the header
      itself. There are currently some issues which need to be addressed when
      operating in standalone, or in bridge with vlan_filtering=0 modes,
      because in those cases the switch ports have VLAN awareness disabled,
      and changing the classified VLAN to anything other than the pvid causes
      the packets to be dropped. Another issue is that on egress, we expect
      port tagging to push the classified VLAN, but port tagging is disabled
      in the modes mentioned above, so although the classified VLAN is
      replaced, it is not visible in the packet transmitted by the switch.
      Signed-off-by: NXiaoliang Yang <xiaoliang.yang_1@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      75944fda
  9. 30 9月, 2020 1 次提交
    • V
      net: mscc: ocelot: automatically detect VCAP constants · 20968054
      Vladimir Oltean 提交于
      The numbers in struct vcap_props are not intuitive to derive, because
      they are not a straightforward copy-and-paste from the reference manual
      but instead rely on a fairly detailed level of understanding of the
      layout of an entry in the TCAM and in the action RAM. For this reason,
      bugs are very easy to introduce here.
      
      Ease the work of hardware porters and read from hardware the constants
      that were exported for this particular purpose. Note that this implies
      that struct vcap_props can no longer be const.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      20968054
  10. 27 9月, 2020 1 次提交
    • V
      net: mscc: ocelot: move NPI port configuration to DSA · 2d44b097
      Vladimir Oltean 提交于
      Remove the ocelot_configure_cpu() function, which was in fact bringing
      up 2 ports: the CPU port module, which both switchdev and DSA have, and
      the NPI port, which only DSA has.
      
      The (non-Ethernet) CPU port module is at a fixed index in the analyzer,
      whereas the NPI port is selected through the "ethernet" property in the
      device tree.
      
      Therefore, the function to set up an NPI port is DSA-specific, so we
      move it there, simplifying the ocelot switch library a little bit.
      
      Cc: Horatiu Vultur <horatiu.vultur@microchip.com>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: UNGLinuxDriver <UNGLinuxDriver@microchip.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d44b097
  11. 25 9月, 2020 1 次提交
  12. 19 9月, 2020 2 次提交
  13. 24 8月, 2020 1 次提交
  14. 28 7月, 2020 1 次提交
  15. 14 7月, 2020 5 次提交
  16. 23 6月, 2020 5 次提交
    • V
      net: mscc: ocelot: support IPv4, IPv6 and plain Ethernet mdb entries · 9403c158
      Vladimir Oltean 提交于
      The current procedure for installing a multicast address is hardcoded
      for IPv4. But, in the ocelot hardware, there are 3 different procedures
      for IPv4, IPv6 and for regular L2 multicast.
      
      For IPv6 (33-33-xx-xx-xx-xx), it's the same as for IPv4
      (01-00-5e-xx-xx-xx), except that the destination port mask is stuffed
      into first 2 bytes of the MAC address except into first 3 bytes.
      
      For plain Ethernet multicast, there's no port-in-address stuffing going
      on, instead the DEST_IDX (pointer to PGID) is used there, just as for
      unicast. So we have to use one of the nonreserved multicast PGIDs that
      the hardware has allocated for this purpose.
      
      This patch classifies the type of multicast address based on its first
      bytes, then redirects to one of the 3 different hardware procedures.
      
      Note that this gives us a really better way of redirecting PTP frames
      sent at 01-1b-19-00-00-00 to the CPU. Previously, Yangbo Lu tried to add
      a trapping rule for PTP EtherType but got a lot of pushback:
      
      https://patchwork.ozlabs.org/project/netdev/patch/20190813025214.18601-5-yangbo.lu@nxp.com/
      
      But right now, that isn't needed at all. The application stack (ptp4l)
      does this for the PTP multicast addresses it's interested in (which are
      configurable, and include 01-1b-19-00-00-00):
      
      	memset(&mreq, 0, sizeof(mreq));
      	mreq.mr_ifindex = index;
      	mreq.mr_type = PACKET_MR_MULTICAST;
      	mreq.mr_alen = MAC_LEN;
      	memcpy(mreq.mr_address, addr1, MAC_LEN);
      
      	err1 = setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, &mreq,
      			  sizeof(mreq));
      
      Into the kernel, this translates into a dev_mc_add on the switch network
      interfaces, and our drivers know that it means they should translate it
      into a host MDB address (make the CPU port be the destination).
      Previously, this was broken because all mdb addresses were treated as
      IPv4 (which 01-1b-19-00-00-00 obviously is not).
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9403c158
    • V
      net: mscc: ocelot: introduce macros for iterating over PGIDs · 96b029b0
      Vladimir Oltean 提交于
      The current iterators are impossible to understand at first glance
      without switching back and forth between the definitions and their
      actual use in the for loops.
      
      So introduce some convenience names to help readability.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96b029b0
    • V
      net: dsa: felix: call port mdb operations from ocelot · 209edf95
      Vladimir Oltean 提交于
      This adds the mdb hooks in felix and exports the mdb functions from
      ocelot.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      209edf95
    • V
      net: mscc: ocelot: make the NPI port a proper target for FDB and MDB · 471beb11
      Vladimir Oltean 提交于
      When used in DSA mode (as seen in Felix), the DEST_IDX in the MAC table
      should point to the PGID for the CPU port (PGID_CPU) and not for the
      Ethernet port where the CPU queues are redirected to (also known as Node
      Processor Interface - NPI).
      
      Because for Felix this distinction shouldn't really matter (from DSA
      perspective, the NPI port _is_ the CPU port), make the ocelot library
      act upon the CPU port when NPI mode is enabled. This has no effect for
      the mscc_ocelot driver for VSC7514, because that does not use NPI (and
      ocelot->npi is -1).
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      471beb11
    • V
      net: mscc: ocelot: fix encoding destination ports into multicast IPv4 address · 0897ecf7
      Vladimir Oltean 提交于
      The ocelot hardware designers have made some hacks to support multicast
      IPv4 and IPv6 addresses. Normally, the MAC table matches on MAC
      addresses and the destination ports are selected through the DEST_IDX
      field of the respective MAC table entry. The DEST_IDX points to a Port
      Group ID (PGID) which contains the bit mask of ports that frames should
      be forwarded to. But there aren't a lot of PGIDs (only 80 or so) and
      there are clearly many more IP multicast addresses than that, so it
      doesn't scale to use this PGID mechanism, so something else was done.
      Since the first portion of the MAC address is known, the hack they did
      was to use a single PGID for _flooding_ unknown IPv4 multicast
      (PGID_MCIPV4 == 62), but for known IP multicast, embed the destination
      ports into the first 3 bytes of the MAC address recorded in the MAC
      table.
      
      The VSC7514 datasheet explains it like this:
      
          3.9.1.5 IPv4 Multicast Entries
      
          MAC table entries with the ENTRY_TYPE = 2 settings are interpreted
          as IPv4 multicast entries.
          IPv4 multicasts entries match IPv4 frames, which are classified to
          the specified VID, and which have DMAC = 0x01005Exxxxxx, where
          xxxxxx is the lower 24 bits of the MAC address in the entry.
          Instead of a lookup in the destination mask table (PGID), the
          destination set is programmed as part of the entry MAC address. This
          is shown in the following table.
      
          Table 78: IPv4 Multicast Destination Mask
      
              Destination Ports            Record Bit Field
              ---------------------------------------------
              Ports 10-0                   MAC[34-24]
      
          Example: All IPv4 multicast frames in VLAN 12 with MAC 01005E112233 are
          to be forwarded to ports 3, 8, and 9. This is done by inserting the
          following entry in the MAC table entry:
          VALID = 1
          VID = 12
          MAC = 0x000308112233
          ENTRY_TYPE = 2
          DEST_IDX = 0
      
      But this procedure is not at all what's going on in the driver. In fact,
      the code that embeds the ports into the MAC address looks like it hasn't
      actually been tested. This patch applies the procedure described in the
      datasheet.
      
      Since there are many other fixes to be made around multicast forwarding
      until it works properly, there is no real reason for this patch to be
      backported to stable trees, or considered a real fix of something that
      should have worked.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0897ecf7
  17. 21 6月, 2020 3 次提交
    • V
      net: mscc: ocelot: generalize the "ACE/ACL" names · aae4e500
      Vladimir Oltean 提交于
      Access Control Lists (and their respective Access Control Entries) are
      specifically entries in the VCAP IS2, the security enforcement block,
      according to the documentation.
      Let's rename the structures and functions to something more generic, so
      that VCAP IS1 structures (which would otherwise have to be called
      Ingress Classification Entries) can reuse the same code without
      confusion.
      
      Some renaming that was done:
      
      struct ocelot_ace_rule -> struct ocelot_vcap_filter
      struct ocelot_acl_block -> struct ocelot_vcap_block
      enum ocelot_ace_type -> enum ocelot_vcap_key_type
      struct ocelot_ace_vlan -> struct ocelot_vcap_key_vlan
      enum ocelot_ace_action -> enum ocelot_vcap_action
      struct ocelot_ace_stats -> struct ocelot_vcap_stats
      enum ocelot_ace_type -> enum ocelot_vcap_key_type
      struct ocelot_ace_frame_* -> struct ocelot_vcap_key_*
      
      No functional change is intended.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aae4e500
    • V
      net: mscc: ocelot: rename ocelot_ace.{c, h} to ocelot_vcap.{c,h} · 3c83654f
      Vladimir Oltean 提交于
      Access Control Lists (and their respective Access Control Entries) are
      specifically entries in the VCAP IS2, the security enforcement block,
      according to the documentation.
      
      Let's rename the files that deal with generic operations on the VCAP
      TCAM, so that VCAP IS1 and ES0 can reuse the same code without
      confusion.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c83654f
    • V
      net: mscc: ocelot: move net_device related functions to ocelot_net.c · 9c90eea3
      Vladimir Oltean 提交于
      The ocelot hardware library shouldn't contain too much net_device
      specific code, since it is shared with DSA which abstracts that
      structure away. So much as much of this code as possible into the
      mscc_ocelot driver and outside of the common library.
      
      We're making an exception for MDB and LAG code. That is not yet exported
      to DSA, but when it will, most of the code that's already in ocelot.c
      will remain there. So, there's no point in moving code to ocelot_net.c
      just to move it back later.
      
      We could have moved all net_device code to ocelot_vsc7514.c directly,
      but let's operate under the assumption that if a new switchdev ocelot
      driver gets added, it'll define its SoC-specific stuff in a new
      ocelot_vsc*.c file and it'll reuse the rest of the code.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c90eea3
  18. 28 5月, 2020 2 次提交