Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ioana Ciornei <ciorneiioana@gmail.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: corbet@lwn.net, netdev@vger.kernel.org,
	linux-doc@vger.kernel.org, Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: [PATCH net-next 9/9] docs: networking: dpaa2: document mirroring support on the switch
Date: Thu, 29 Jul 2021 20:19:01 +0300	[thread overview]
Message-ID: <20210729171901.3211729-10-ciorneiioana@gmail.com> (raw)
In-Reply-To: <20210729171901.3211729-1-ciorneiioana@gmail.com>

From: Ioana Ciornei <ioana.ciornei@nxp.com>

Document the mirroring capabilities of the dpaa2-switch driver,
any restrictions that are imposed and some example commands.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 .../freescale/dpaa2/switch-driver.rst         | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/Documentation/networking/device_drivers/ethernet/freescale/dpaa2/switch-driver.rst b/Documentation/networking/device_drivers/ethernet/freescale/dpaa2/switch-driver.rst
index 863ca6bd8318..8bf411b857d4 100644
--- a/Documentation/networking/device_drivers/ethernet/freescale/dpaa2/switch-driver.rst
+++ b/Documentation/networking/device_drivers/ethernet/freescale/dpaa2/switch-driver.rst
@@ -172,3 +172,46 @@ Example 4: Use a single shared filter block on both eth5 and eth6::
                 action trap
         $ tc filter add block 1 ingress protocol ipv4 flower src_ip 192.168.1.1 skip_sw \
                 action mirred egress redirect dev eth3
+
+Mirroring
+~~~~~~~~~
+
+The DPAA2 switch supports only per port mirroring and per VLAN mirroring.
+Adding mirroring filters in shared blocks is also supported.
+
+When using the tc-flower classifier with the 802.1q protocol, only the
+''vlan_id'' key will be accepted. Mirroring based on any other fields from the
+802.1q protocol will be rejected::
+
+        $ tc qdisc add dev eth8 ingress_block 1 clsact
+        $ tc filter add block 1 ingress protocol 802.1q flower skip_sw vlan_prio 3 action mirred egress mirror dev eth6
+        Error: fsl_dpaa2_switch: Only matching on VLAN ID supported.
+        We have an error talking to the kernel
+
+If a mirroring VLAN filter is requested on a port, the VLAN must to be
+installed on the switch port in question either using ''bridge'' or by creating
+a VLAN upper device if the switch port is used as a standalone interface::
+
+        $ tc qdisc add dev eth8 ingress_block 1 clsact
+        $ tc filter add block 1 ingress protocol 802.1q flower skip_sw vlan_id 200 action mirred egress mirror dev eth6
+        Error: VLAN must be installed on the switch port.
+        We have an error talking to the kernel
+
+        $ bridge vlan add vid 200 dev eth8
+        $ tc filter add block 1 ingress protocol 802.1q flower skip_sw vlan_id 200 action mirred egress mirror dev eth6
+
+        $ ip link add link eth8 name eth8.200 type vlan id 200
+        $ tc filter add block 1 ingress protocol 802.1q flower skip_sw vlan_id 200 action mirred egress mirror dev eth6
+
+Also, it should be noted that the mirrored traffic will be subject to the same
+egress restrictions as any other traffic. This means that when a mirrored
+packet will reach the mirror port, if the VLAN found in the packet is not
+installed on the port it will get dropped.
+
+The DPAA2 switch supports only a single mirroring destination, thus multiple
+mirror rules can be installed but their ''to'' port has to be the same::
+
+        $ tc filter add block 1 ingress protocol 802.1q flower skip_sw vlan_id 200 action mirred egress mirror dev eth6
+        $ tc filter add block 1 ingress protocol 802.1q flower skip_sw vlan_id 100 action mirred egress mirror dev eth7
+        Error: fsl_dpaa2_switch: Multiple mirror ports not supported.
+        We have an error talking to the kernel
-- 
2.31.1


  parent reply	other threads:[~2021-07-29 17:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 17:18 [PATCH net-next 0/9] dpaa2-switch: add mirroring support Ioana Ciornei
2021-07-29 17:18 ` [PATCH net-next 1/9] dpaa2-switch: rename dpaa2_switch_tc_parse_action to specify the ACL Ioana Ciornei
2021-07-29 17:18 ` [PATCH net-next 2/9] dpaa2-switch: rename dpaa2_switch_acl_tbl into filter_block Ioana Ciornei
2021-07-29 17:18 ` [PATCH net-next 3/9] dpaa2-switch: reorganize dpaa2_switch_cls_flower_replace Ioana Ciornei
2021-07-29 17:18 ` [PATCH net-next 4/9] dpaa2-switch: reorganize dpaa2_switch_cls_matchall_replace Ioana Ciornei
2021-07-29 17:18 ` [PATCH net-next 5/9] dpaa2-switch: add API for setting up mirroring Ioana Ciornei
2021-07-29 17:18 ` [PATCH net-next 6/9] dpaa2-switch: add support for port mirroring Ioana Ciornei
2021-07-29 17:18 ` [PATCH net-next 7/9] dpaa2-switch: add VLAN based mirroring Ioana Ciornei
2021-07-29 17:19 ` [PATCH net-next 8/9] dpaa2-switch: offload shared block mirror filters when binding to a port Ioana Ciornei
2021-07-29 17:19 ` Ioana Ciornei [this message]
2021-07-29 20:40 ` [PATCH net-next 0/9] dpaa2-switch: add mirroring support patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210729171901.3211729-10-ciorneiioana@gmail.com \
    --to=ciorneiioana@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=ioana.ciornei@nxp.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH net-next 9/9] docs: networking: dpaa2: document mirroring support on the switch' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox