From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH v2 11/11] net/sfc: add unknown unicast/multicast match in flow API
Date: Thu, 9 Mar 2017 15:26:33 +0000 [thread overview]
Message-ID: <1489073193-2920-12-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1489073193-2920-1-git-send-email-arybchenko@solarflare.com>
From: Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Support individual/group destination address match (unknown unicast
and all-multicast correspondingly in terms of firmware).
Signed-off-by: Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
---
doc/guides/nics/sfc_efx.rst | 11 ++++++++++-
drivers/net/sfc/sfc_flow.c | 17 +++++++++++++++--
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst
index 4d91b1d..8229d7d 100644
--- a/doc/guides/nics/sfc_efx.rst
+++ b/doc/guides/nics/sfc_efx.rst
@@ -127,7 +127,8 @@ Supported pattern items:
- VOID
-- ETH (exact match of source/destination addresses, EtherType)
+- ETH (exact match of source/destination addresses, individual/group match
+ of destination address, EtherType)
- VLAN (exact match of VID, double-tagging is supported)
@@ -149,6 +150,14 @@ Supported actions:
Validating flow rules depends on the firmware variant.
+Ethernet destinaton individual/group match
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ethernet item supports I/G matching, if only the corresponding bit is set
+in the mask of destination address. If destinaton address in the spec is
+multicast, it matches all multicast (and broadcast) packets, oherwise it
+matches unicast packets that are not filtered by other flow rules.
+
Supported NICs
--------------
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index ae36934..fe352c0 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -205,8 +205,10 @@ sfc_flow_parse_void(__rte_unused const struct rte_flow_item *item,
*
* @param item[in]
* Item specification. Only source and destination addresses and
- * Ethernet type fields are supported. If the mask is NULL, default
- * mask will be used. Ranging is not supported.
+ * Ethernet type fields are supported. In addition to full and
+ * empty masks of destination address, individual/group mask is
+ * also supported. If the mask is NULL, default mask will be used.
+ * Ranging is not supported.
* @param efx_spec[in, out]
* EFX filter specification to update.
* @param[out] error
@@ -225,6 +227,9 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
.src.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
.type = 0xffff,
};
+ const uint8_t ig_mask[EFX_MAC_ADDR_LEN] = {
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
rc = sfc_flow_parse_init(item,
(const void **)&spec,
@@ -244,6 +249,14 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
efx_spec->efs_match_flags |= EFX_FILTER_MATCH_LOC_MAC;
rte_memcpy(efx_spec->efs_loc_mac, spec->dst.addr_bytes,
EFX_MAC_ADDR_LEN);
+ } else if (memcmp(mask->dst.addr_bytes, ig_mask,
+ EFX_MAC_ADDR_LEN) == 0) {
+ if (is_unicast_ether_addr(&spec->dst))
+ efx_spec->efs_match_flags |=
+ EFX_FILTER_MATCH_UNKNOWN_UCAST_DST;
+ else
+ efx_spec->efs_match_flags |=
+ EFX_FILTER_MATCH_UNKNOWN_MCAST_DST;
} else if (!is_zero_ether_addr(&mask->dst)) {
goto fail_bad_mask;
}
--
2.9.3
next prev parent reply other threads:[~2017-03-09 15:30 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-02 16:03 [dpdk-dev] [PATCH 00/11] Support flow API in Solarflare PMD Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 01/11] net/sfc/base: split local MAC I/G back into separate flags Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 02/11] net/sfc/base: improve API to get supported filter matches Andrew Rybchenko
2017-03-07 13:25 ` Ferruh Yigit
2017-03-07 14:47 ` Andrew Rybchenko
2017-03-07 14:56 ` Ferruh Yigit
2017-03-02 16:03 ` [dpdk-dev] [PATCH 03/11] net/sfc: implement dummy filter control callback Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 04/11] net/sfc: provide a way to check if filter is supported Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 05/11] net/sfc: add flow API filters support Andrew Rybchenko
2017-03-07 13:21 ` Ferruh Yigit
2017-03-09 15:29 ` Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 06/11] net/sfc: add VLAN in " Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 07/11] net/sfc: add IPV4 " Andrew Rybchenko
2017-03-07 13:21 ` Ferruh Yigit
2017-03-02 16:03 ` [dpdk-dev] [PATCH 08/11] net/sfc: add IPV6 " Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 09/11] net/sfc: add TCP " Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 10/11] net/sfc: add UDP " Andrew Rybchenko
2017-03-02 16:03 ` [dpdk-dev] [PATCH 11/11] net/sfc: add unknown unicast/multicast match in flow API Andrew Rybchenko
2017-03-07 13:27 ` [dpdk-dev] [PATCH 00/11] Support flow API in Solarflare PMD Ferruh Yigit
2017-03-07 14:56 ` Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 " Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 01/11] net/sfc/base: split local MAC I/G back into separate flags Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 02/11] net/sfc/base: improve API to get supported filter matches Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 03/11] net/sfc: implement dummy filter control callback Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 04/11] net/sfc: provide a way to check if filter is supported Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 05/11] net/sfc: add flow API filters support Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 06/11] net/sfc: add VLAN in " Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 07/11] net/sfc: add IPV4 " Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 08/11] net/sfc: add IPV6 " Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 09/11] net/sfc: add TCP " Andrew Rybchenko
2017-03-09 15:26 ` [dpdk-dev] [PATCH v2 10/11] net/sfc: add UDP " Andrew Rybchenko
2017-03-09 15:26 ` Andrew Rybchenko [this message]
2017-03-09 17:28 ` [dpdk-dev] [PATCH v2 00/11] Support flow API in Solarflare PMD Ferruh Yigit
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=1489073193-2920-12-git-send-email-arybchenko@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=Roman.Zhukov@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).