1. 27 2月, 2021 6 次提交
  2. 25 2月, 2021 2 次提交
  3. 17 2月, 2021 7 次提交
    • L
      net: dsa: tag_rtl4_a: Support also egress tags · 86dd9868
      Linus Walleij 提交于
      Support also transmitting frames using the custom "8899 A"
      4 byte tag.
      
      Qingfang came up with the solution: we need to pad the
      ethernet frame to 60 bytes using eth_skb_pad(), then the
      switch will happily accept frames with custom tags.
      
      Cc: Mauri Sandberg <sandberg@mailfence.com>
      Reported-by: NDENG Qingfang <dqfext@gmail.com>
      Fixes: efd7fe68 ("net: dsa: tag_rtl4_a: Implement Realtek 4 byte A tag")
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86dd9868
    • V
      net: sched: fix police ext initialization · 396d7f23
      Vlad Buslov 提交于
      When police action is created by cls API tcf_exts_validate() first
      conditional that calls tcf_action_init_1() directly, the action idr is not
      updated according to latest changes in action API that require caller to
      commit newly created action to idr with tcf_idr_insert_many(). This results
      such action not being accessible through act API and causes crash reported
      by syzbot:
      
      ==================================================================
      BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:71 [inline]
      BUG: KASAN: null-ptr-deref in atomic_read include/asm-generic/atomic-instrumented.h:27 [inline]
      BUG: KASAN: null-ptr-deref in __tcf_idr_release net/sched/act_api.c:178 [inline]
      BUG: KASAN: null-ptr-deref in tcf_idrinfo_destroy+0x129/0x1d0 net/sched/act_api.c:598
      Read of size 4 at addr 0000000000000010 by task kworker/u4:5/204
      
      CPU: 0 PID: 204 Comm: kworker/u4:5 Not tainted 5.11.0-rc7-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: netns cleanup_net
      Call Trace:
       __dump_stack lib/dump_stack.c:79 [inline]
       dump_stack+0x107/0x163 lib/dump_stack.c:120
       __kasan_report mm/kasan/report.c:400 [inline]
       kasan_report.cold+0x5f/0xd5 mm/kasan/report.c:413
       check_memory_region_inline mm/kasan/generic.c:179 [inline]
       check_memory_region+0x13d/0x180 mm/kasan/generic.c:185
       instrument_atomic_read include/linux/instrumented.h:71 [inline]
       atomic_read include/asm-generic/atomic-instrumented.h:27 [inline]
       __tcf_idr_release net/sched/act_api.c:178 [inline]
       tcf_idrinfo_destroy+0x129/0x1d0 net/sched/act_api.c:598
       tc_action_net_exit include/net/act_api.h:151 [inline]
       police_exit_net+0x168/0x360 net/sched/act_police.c:390
       ops_exit_list+0x10d/0x160 net/core/net_namespace.c:190
       cleanup_net+0x4ea/0xb10 net/core/net_namespace.c:604
       process_one_work+0x98d/0x15f0 kernel/workqueue.c:2275
       worker_thread+0x64c/0x1120 kernel/workqueue.c:2421
       kthread+0x3b1/0x4a0 kernel/kthread.c:292
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
      ==================================================================
      Kernel panic - not syncing: panic_on_warn set ...
      CPU: 0 PID: 204 Comm: kworker/u4:5 Tainted: G    B             5.11.0-rc7-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: netns cleanup_net
      Call Trace:
       __dump_stack lib/dump_stack.c:79 [inline]
       dump_stack+0x107/0x163 lib/dump_stack.c:120
       panic+0x306/0x73d kernel/panic.c:231
       end_report+0x58/0x5e mm/kasan/report.c:100
       __kasan_report mm/kasan/report.c:403 [inline]
       kasan_report.cold+0x67/0xd5 mm/kasan/report.c:413
       check_memory_region_inline mm/kasan/generic.c:179 [inline]
       check_memory_region+0x13d/0x180 mm/kasan/generic.c:185
       instrument_atomic_read include/linux/instrumented.h:71 [inline]
       atomic_read include/asm-generic/atomic-instrumented.h:27 [inline]
       __tcf_idr_release net/sched/act_api.c:178 [inline]
       tcf_idrinfo_destroy+0x129/0x1d0 net/sched/act_api.c:598
       tc_action_net_exit include/net/act_api.h:151 [inline]
       police_exit_net+0x168/0x360 net/sched/act_police.c:390
       ops_exit_list+0x10d/0x160 net/core/net_namespace.c:190
       cleanup_net+0x4ea/0xb10 net/core/net_namespace.c:604
       process_one_work+0x98d/0x15f0 kernel/workqueue.c:2275
       worker_thread+0x64c/0x1120 kernel/workqueue.c:2421
       kthread+0x3b1/0x4a0 kernel/kthread.c:292
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
      Kernel Offset: disabled
      
      Fix the issue by calling tcf_idr_insert_many() after successful action
      initialization.
      
      Fixes: 0fedc63f ("net_sched: commit action insertions together")
      Reported-by: syzbot+151e3e714d34ae4ce7e8@syzkaller.appspotmail.com
      Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
      Reviewed-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      396d7f23
    • H
      net: dsa: felix: Add support for MRP · a026c50b
      Horatiu Vultur 提交于
      Implement functions 'port_mrp_add', 'port_mrp_del',
      'port_mrp_add_ring_role' and 'port_mrp_del_ring_role' to call the mrp
      functions from ocelot.
      
      Also all MRP frames that arrive to CPU on queue number OCELOT_MRP_CPUQ
      will be forward by the SW.
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a026c50b
    • H
      net: dsa: add MRP support · c595c433
      Horatiu Vultur 提交于
      Add support for offloading MRP in HW. Currently implement the switchdev
      calls 'SWITCHDEV_OBJ_ID_MRP', 'SWITCHDEV_OBJ_ID_RING_ROLE_MRP',
      to allow to create MRP instances and to set the role of these instances.
      
      Add DSA_NOTIFIER_MRP_ADD/DEL and DSA_NOTIFIER_MRP_ADD/DEL_RING_ROLE
      which calls to .port_mrp_add/del and .port_mrp_add/del_ring_role in the
      DSA driver for the switch.
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c595c433
    • H
      bridge: mrp: Update br_mrp to use new return values of br_mrp_switchdev · cd605d45
      Horatiu Vultur 提交于
      Check the return values of the br_mrp_switchdev function.
      In case of:
      - BR_MRP_NONE, return the error to userspace,
      - BR_MRP_SW, continue with SW implementation,
      - BR_MRP_HW, continue without SW implementation,
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd605d45
    • H
      bridge: mrp: Extend br_mrp_switchdev to detect better the errors · 1a3ddb0b
      Horatiu Vultur 提交于
      This patch extends the br_mrp_switchdev functions to be able to have a
      better understanding what cause the issue and if the SW needs to be used
      as a backup.
      
      There are the following cases:
      - when the code is compiled without CONFIG_NET_SWITCHDEV. In this case
        return success so the SW can continue with the protocol. Depending
        on the function, it returns 0 or BR_MRP_SW.
      - when code is compiled with CONFIG_NET_SWITCHDEV and the driver doesn't
        implement any MRP callbacks. In this case the HW can't run MRP so it
        just returns -EOPNOTSUPP. So the SW will stop further to configure the
        node.
      - when code is compiled with CONFIG_NET_SWITCHDEV and the driver fully
        supports any MRP functionality. In this case the SW doesn't need to do
        anything. The functions will return 0 or BR_MRP_HW.
      - when code is compiled with CONFIG_NET_SWITCHDEV and the HW can't run
        completely the protocol but it can help the SW to run it. For
        example, the HW can't support completely MRM role(can't detect when it
        stops receiving MRP Test frames) but it can redirect these frames to
        CPU. In this case it is possible to have a SW fallback. The SW will
        try initially to call the driver with sw_backup set to false, meaning
        that the HW should implement completely the role. If the driver returns
        -EOPNOTSUPP, the SW will try again with sw_backup set to false,
        meaning that the SW will detect when it stops receiving the frames but
        it needs HW support to redirect the frames to CPU. In case the driver
        returns 0 then the SW will continue to configure the node accordingly.
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a3ddb0b
    • H
      bridge: mrp: Add 'enum br_mrp_hw_support' · e1bd99d0
      Horatiu Vultur 提交于
      Add the enum br_mrp_hw_support that is used by the br_mrp_switchdev
      functions to allow the SW to detect the cases where HW can't implement
      the functionality or when SW is used as a backup.
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e1bd99d0
  4. 16 2月, 2021 8 次提交
  5. 15 2月, 2021 11 次提交
    • V
      net: dsa: propagate extack to .port_vlan_filtering · 89153ed6
      Vladimir Oltean 提交于
      Some drivers can't dynamically change the VLAN filtering option, or
      impose some restrictions, it would be nice to propagate this info
      through netlink instead of printing it to a kernel log that might never
      be read. Also netlink extack includes the module that emitted the
      message, which means that it's easier to figure out which ones are
      driver-generated errors as opposed to command misuse.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      89153ed6
    • V
      net: dsa: propagate extack to .port_vlan_add · 31046a5f
      Vladimir Oltean 提交于
      Allow drivers to communicate their restrictions to user space directly,
      instead of printing to the kernel log. Where the conversion would have
      been lossy and things like VLAN ID could no longer be conveyed (due to
      the lack of support for printf format specifier in netlink extack), I
      chose to keep the messages in full form to the kernel log only, and
      leave it up to individual driver maintainers to move more messages to
      extack.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31046a5f
    • V
      net: bridge: propagate extack through switchdev_port_attr_set · dcbdf135
      Vladimir Oltean 提交于
      The benefit is the ability to propagate errors from switchdev drivers
      for the SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING and
      SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL attributes.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dcbdf135
    • V
      net: bridge: propagate extack through store_bridge_parm · 9e781401
      Vladimir Oltean 提交于
      The bridge sysfs interface stores parameters for the STP, VLAN,
      multicast etc subsystems using a predefined function prototype.
      Sometimes the underlying function being called supports a netlink
      extended ack message, and we ignore it.
      
      Let's expand the store_bridge_parm function prototype to include the
      extack, and just print it to console, but at least propagate it where
      applicable. Where not applicable, create a shim function in the
      br_sysfs_br.c file that discards the extra function argument.
      
      This patch allows us to propagate the extack argument to
      br_vlan_set_default_pvid, br_vlan_set_proto and br_vlan_filter_toggle,
      and from there, further up in br_changelink from br_netlink.c.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9e781401
    • V
      net: bridge: remove __br_vlan_filter_toggle · 7a572964
      Vladimir Oltean 提交于
      This function is identical with br_vlan_filter_toggle.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a572964
    • V
      net: dsa: tag_ocelot_8021q: add support for PTP timestamping · 0a6f17c6
      Vladimir Oltean 提交于
      For TX timestamping, we use the felix_txtstamp method which is common
      with the regular (non-8021q) ocelot tagger. This method says that skb
      deferral is needed, prepares a timestamp request ID, and puts a clone of
      the skb in a queue waiting for the timestamp IRQ.
      
      felix_txtstamp is called by dsa_skb_tx_timestamp() just before the
      tagger's xmit method. In the tagger xmit, we divert the packets
      classified by dsa_skb_tx_timestamp() as PTP towards the MMIO-based
      injection registers, and we declare them as dead towards dsa_slave_xmit.
      If not PTP, we proceed with normal tag_8021q stuff.
      
      Then the timestamp IRQ fires, the clone queued up from felix_txtstamp is
      matched to the TX timestamp retrieved from the switch's FIFO based on
      the timestamp request ID, and the clone is delivered to the stack.
      
      On RX, thanks to the VCAP IS2 rule that redirects the frames with an
      EtherType for 1588 towards two destinations:
      - the CPU port module (for MMIO based extraction) and
      - if the "no XTR IRQ" workaround is in place, the dsa_8021q CPU port
      the relevant data path processing starts in the ptp_classify_raw BPF
      classifier installed by DSA in the RX data path (post tagger, which is
      completely unaware that it saw a PTP packet).
      
      This time we can't reuse the same implementation of .port_rxtstamp that
      also works with the default ocelot tagger. That is because felix_rxtstamp
      is given an skb with a freshly stripped DSA header, and it says "I don't
      need deferral for its RX timestamp, it's right in it, let me show you";
      and it just points to the header right behind skb->data, from where it
      unpacks the timestamp and annotates the skb with it.
      
      The same thing cannot happen with tag_ocelot_8021q, because for one
      thing, the skb did not have an extraction frame header in the first
      place, but a VLAN tag with no timestamp information. So the code paths
      in felix_rxtstamp for the regular and 8021q tagger are completely
      independent. With tag_8021q, the timestamp must come from the packet's
      duplicate delivered to the CPU port module, but there is potentially
      complex logic to be handled [ and prone to reordering ] if we were to
      just start reading packets from the CPU port module, and try to match
      them to the one we received over Ethernet and which needs an RX
      timestamp. So we do something simple: we tell DSA "give me some time to
      think" (we request skb deferral by returning false from .port_rxtstamp)
      and we just drop the frame we got over Ethernet with no attempt to match
      it to anything - we just treat it as a notification that there's data to
      be processed from the CPU port module's queues. Then we proceed to read
      the packets from those, one by one, which we deliver up the stack,
      timestamped, using netif_rx - the same function that any driver would
      use anyway if it needed RX timestamp deferral. So the assumption is that
      we'll come across the PTP packet that triggered the CPU extraction
      notification eventually, but we don't know when exactly. Thanks to the
      VCAP IS2 trap/redirect rule and the exclusion of the CPU port module
      from the flooding replicators, only PTP frames should be present in the
      CPU port module's RX queues anyway.
      
      There is just one conflict between the VCAP IS2 trapping rule and the
      semantics of the BPF classifier. Namely, ptp_classify_raw() deems
      general messages as non-timestampable, but still, those are trapped to
      the CPU port module since they have an EtherType of ETH_P_1588. So, if
      the "no XTR IRQ" workaround is in place, we need to run another BPF
      classifier on the frames extracted over MMIO, to avoid duplicates being
      sent to the stack (once over Ethernet, once over MMIO). It doesn't look
      like it's possible to install VCAP IS2 rules based on keys extracted
      from the 1588 frame headers.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0a6f17c6
    • V
      net: dsa: felix: setup MMIO filtering rules for PTP when using tag_8021q · c8c0ba4f
      Vladimir Oltean 提交于
      Since the tag_8021q tagger is software-defined, it has no means by
      itself for retrieving hardware timestamps of PTP event messages.
      
      Because we do want to support PTP on ocelot even with tag_8021q, we need
      to use the CPU port module for that. The RX timestamp is present in the
      Extraction Frame Header. And because we can't use NPI mode which redirects
      the CPU queues to an "external CPU" (meaning the ARM CPU running Linux),
      then we need to poll the CPU port module through the MMIO registers to
      retrieve TX and RX timestamps.
      
      Sadly, on NXP LS1028A, the Felix switch was integrated into the SoC
      without wiring the extraction IRQ line to the ARM GIC. So, if we want to
      be notified of any PTP packets received on the CPU port module, we have
      a problem.
      
      There is a possible workaround, which is to use the Ethernet CPU port as
      a notification channel that packets are available on the CPU port module
      as well. When a PTP packet is received by the DSA tagger (without timestamp,
      of course), we go to the CPU extraction queues, poll for it there, then
      we drop the original Ethernet packet and masquerade the packet retrieved
      over MMIO (plus the timestamp) as the original when we inject it up the
      stack.
      
      Create a quirk in struct felix is selected by the Felix driver (but not
      by Seville, since that doesn't support PTP at all). We want to do this
      such that the workaround is minimally invasive for future switches that
      don't require this workaround.
      
      The only traffic for which we need timestamps is PTP traffic, so add a
      redirection rule to the CPU port module for this. Currently we only have
      the need for PTP over L2, so redirection rules for UDP ports 319 and 320
      are TBD for now.
      
      Note that for the workaround of matching of PTP-over-Ethernet-port with
      PTP-over-MMIO queues to work properly, both channels need to be
      absolutely lossless. There are two parts to achieving that:
      - We keep flow control enabled on the tag_8021q CPU port
      - We put the DSA master interface in promiscuous mode, so it will never
        drop a PTP frame (for the profiles we are interested in, these are
        sent to the multicast MAC addresses of 01-80-c2-00-00-0e and
        01-1b-19-00-00-00).
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c8c0ba4f
    • V
      net: dsa: tag_ocelot: create separate tagger for Seville · 7c4bb540
      Vladimir Oltean 提交于
      The ocelot tagger is a hot mess currently, it relies on memory
      initialized by the attached driver for basic frame transmission.
      This is against all that DSA tagging protocols stand for, which is that
      the transmission and reception of a DSA-tagged frame, the data path,
      should be independent from the switch control path, because the tag
      protocol is in principle hot-pluggable and reusable across switches
      (even if in practice it wasn't until very recently). But if another
      driver like dsa_loop wants to make use of tag_ocelot, it couldn't.
      
      This was done to have common code between Felix and Ocelot, which have
      one bit difference in the frame header format. Quoting from commit
      67c24049 ("net: dsa: felix: create a template for the DSA tags on
      xmit"):
      
          Other alternatives have been analyzed, such as:
          - Create a separate tag_seville.c: too much code duplication for just 1
            bit field difference.
          - Create a separate DSA_TAG_PROTO_SEVILLE under tag_ocelot.c, just like
            tag_brcm.c, which would have a separate .xmit function. Again, too
            much code duplication for just 1 bit field difference.
          - Allocate the template from the init function of the tag_ocelot.c
            module, instead of from the driver: couldn't figure out a method of
            accessing the correct port template corresponding to the correct
            tagger in the .xmit function.
      
      The really interesting part is that Seville should have had its own
      tagging protocol defined - it is not compatible on the wire with Ocelot,
      even for that single bit. In principle, a packet generated by
      DSA_TAG_PROTO_OCELOT when booted on NXP LS1028A would look in a certain
      way, but when booted on NXP T1040 it would look differently. The reverse
      is also true: a packet generated by a Seville switch would be
      interpreted incorrectly by Wireshark if it was told it was generated by
      an Ocelot switch.
      
      Actually things are a bit more nuanced. If we concentrate only on the
      DSA tag, what I said above is true, but Ocelot/Seville also support an
      optional DSA tag prefix, which can be short or long, and it is possible
      to distinguish the two taggers based on an integer constant put in that
      prefix. Nonetheless, creating a separate tagger is still justified,
      since the tag prefix is optional, and without it, there is again no way
      to distinguish.
      
      Claiming backwards binary compatibility is a bit more tough, since I've
      already changed the format of tag_ocelot once, in commit 5124197c
      ("net: dsa: tag_ocelot: use a short prefix on both ingress and egress").
      Therefore I am not very concerned with treating this as a bugfix and
      backporting it to stable kernels (which would be another mess due to the
      fact that there would be lots of conflicts with the other DSA_TAG_PROTO*
      definitions). It's just simpler to say that the string values of the
      taggers have ABI value starting with kernel 5.12, which will be when the
      changing of tag protocol via /sys/class/net/<dsa-master>/dsa/tagging
      goes live.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c4bb540
    • V
      net: dsa: tag_ocelot: single out PTP-related transmit tag processing · 62bf5fde
      Vladimir Oltean 提交于
      There is one place where we cannot avoid accessing driver data, and that
      is 2-step PTP TX timestamping, since the switch wants us to provide a
      timestamp request ID through the injection header, which naturally must
      come from a sequence number kept by the driver (it is generated by the
      .port_txtstamp method prior to the tagger's xmit).
      
      However, since other drivers like dsa_loop do not claim PTP support
      anyway, the DSA_SKB_CB(skb)->clone will always be NULL anyway, so if we
      move all PTP-related dereferences of struct ocelot and struct ocelot_port
      into a separate function, we can effectively ensure that this is dead
      code when the ocelot tagger is attached to non-ocelot switches, and the
      stateful portion of the tagger is more self-contained.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62bf5fde
    • V
      net: mscc: ocelot: use common tag parsing code with DSA · 40d3f295
      Vladimir Oltean 提交于
      The Injection Frame Header and Extraction Frame Header that the switch
      prepends to frames over the NPI port is also prepended to frames
      delivered over the CPU port module's queues.
      
      Let's unify the handling of the frame headers by making the ocelot
      driver call some helpers exported by the DSA tagger. Among other things,
      this allows us to get rid of the strange cpu_to_be32 when transmitting
      the Injection Frame Header on ocelot, since the packing API uses
      network byte order natively (when "quirks" is 0).
      
      The comments above ocelot_gen_ifh talk about setting pop_cnt to 3, and
      the cpu extraction queue mask to something, but the code doesn't do it,
      so we don't do it either.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      40d3f295
    • V
      net: dsa: tag_ocelot: avoid accessing ds->priv in ocelot_rcv · 8a678bb2
      Vladimir Oltean 提交于
      Taggers should be written to do something valid irrespective of the
      switch driver that they are attached to. This is even more true now,
      because since the introduction of the .change_tag_protocol method, a
      certain tagger is not necessarily strictly associated with a driver any
      longer, and I would like to be able to test all taggers with dsa_loop in
      the future.
      
      In the case of ocelot, it needs to move the classified VLAN from the DSA
      tag into the skb if the port is VLAN-aware. We can allow it to do that
      by looking at the dp->vlan_filtering property, no need to invoke
      structures which are specific to ocelot.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a678bb2
  6. 14 2月, 2021 6 次提交