From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Yongseok Koh <yskoh@mellanox.com>,
Adrien Mazarguil <adrien.mazarguil@6wind.com>
Subject: [dpdk-dev] [PATCH 6/6] net/mlx5: fix allmulti mode
Date: Thu, 19 Oct 2017 14:51:34 +0200 [thread overview]
Message-ID: <e8d03f676b83a4e380f5890c6984f96ca4085648.1508417257.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <cover.1508417257.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <cover.1508417257.git.nelio.laranjeiro@6wind.com>
All multi is not adding unicast flows which cause unicast packets to be
dropped by the NIC.
Fixes: 6a6b6828fe6a ("net/mlx5: use flow to enable all multi mode")
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
drivers/net/mlx5/mlx5_trigger.c | 131 ++++++++++++++++++++--------------------
1 file changed, 66 insertions(+), 65 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 29167badd..edbed2f99 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -251,6 +251,30 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
int
priv_dev_traffic_enable(struct priv *priv, struct rte_eth_dev *dev)
{
+ struct rte_flow_item_eth bcast = {
+ .dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+ };
+ struct rte_flow_item_eth ipv6_multi_spec = {
+ .dst.addr_bytes = "\x33\x33\x00\x00\x00\x00",
+ };
+ struct rte_flow_item_eth ipv6_multi_mask = {
+ .dst.addr_bytes = "\xff\xff\x00\x00\x00\x00",
+ };
+ struct rte_flow_item_eth unicast = {
+ .src.addr_bytes = "\x00\x00\x00\x00\x00\x00",
+ };
+ struct rte_flow_item_eth unicast_mask = {
+ .dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+ };
+ const unsigned int vlan_filter_n = priv->vlan_filter_n;
+ const struct ether_addr cmp = {
+ .addr_bytes = "\x00\x00\x00\x00\x00\x00",
+ };
+ unsigned int i;
+ unsigned int j;
+ unsigned int unicast_flow = 0;
+ int ret;
+
if (priv->isolated)
return 0;
if (dev->data->promiscuous) {
@@ -261,82 +285,59 @@ priv_dev_traffic_enable(struct priv *priv, struct rte_eth_dev *dev)
};
claim_zero(mlx5_ctrl_flow(dev, &promisc, &promisc));
- } else if (dev->data->all_multicast) {
+ return 0;
+ }
+ if (dev->data->all_multicast) {
struct rte_flow_item_eth multicast = {
.dst.addr_bytes = "\x01\x00\x00\x00\x00\x00",
- .src.addr_bytes = "\x01\x00\x00\x00\x00\x00",
+ .src.addr_bytes = "\x00\x00\x00\x00\x00\x00",
.type = 0,
};
claim_zero(mlx5_ctrl_flow(dev, &multicast, &multicast));
- } else {
- struct rte_flow_item_eth bcast = {
- .dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
- };
- struct rte_flow_item_eth ipv6_multi_spec = {
- .dst.addr_bytes = "\x33\x33\x00\x00\x00\x00",
- };
- struct rte_flow_item_eth ipv6_multi_mask = {
- .dst.addr_bytes = "\xff\xff\x00\x00\x00\x00",
- };
- struct rte_flow_item_eth unicast = {
- .src.addr_bytes = "\x00\x00\x00\x00\x00\x00",
- };
- struct rte_flow_item_eth unicast_mask = {
- .dst.addr_bytes = "\xff\xff\xff\xff\xff\xff",
- };
- const unsigned int vlan_filter_n = priv->vlan_filter_n;
- const struct ether_addr cmp = {
- .addr_bytes = "\x00\x00\x00\x00\x00\x00",
- };
- unsigned int i;
- unsigned int j;
- unsigned int unicast_flow = 0;
- int ret;
-
- for (i = 0; i != MLX5_MAX_MAC_ADDRESSES; ++i) {
- struct ether_addr *mac = &dev->data->mac_addrs[i];
+ }
+ for (i = 0; i != MLX5_MAX_MAC_ADDRESSES; ++i) {
+ struct ether_addr *mac = &dev->data->mac_addrs[i];
- if (!memcmp(mac, &cmp, sizeof(*mac)))
- continue;
- memcpy(&unicast.dst.addr_bytes,
- mac->addr_bytes,
- ETHER_ADDR_LEN);
- for (j = 0; j != vlan_filter_n; ++j) {
- uint16_t vlan = priv->vlan_filter[j];
+ if (!memcmp(mac, &cmp, sizeof(*mac)))
+ continue;
+ memcpy(&unicast.dst.addr_bytes,
+ mac->addr_bytes,
+ ETHER_ADDR_LEN);
+ for (j = 0; j != vlan_filter_n; ++j) {
+ uint16_t vlan = priv->vlan_filter[j];
- struct rte_flow_item_vlan vlan_spec = {
- .tci = rte_cpu_to_be_16(vlan),
- };
- struct rte_flow_item_vlan vlan_mask = {
- .tci = 0xffff,
- };
+ struct rte_flow_item_vlan vlan_spec = {
+ .tci = rte_cpu_to_be_16(vlan),
+ };
+ struct rte_flow_item_vlan vlan_mask = {
+ .tci = 0xffff,
+ };
- ret = mlx5_ctrl_flow_vlan(dev, &unicast,
- &unicast_mask,
- &vlan_spec,
- &vlan_mask);
- if (ret)
- goto error;
- unicast_flow = 1;
- }
- if (!vlan_filter_n) {
- ret = mlx5_ctrl_flow(dev, &unicast,
- &unicast_mask);
- if (ret)
- goto error;
- unicast_flow = 1;
- }
+ ret = mlx5_ctrl_flow_vlan(dev, &unicast,
+ &unicast_mask,
+ &vlan_spec,
+ &vlan_mask);
+ if (ret)
+ goto error;
+ unicast_flow = 1;
+ }
+ if (!vlan_filter_n) {
+ ret = mlx5_ctrl_flow(dev, &unicast,
+ &unicast_mask);
+ if (ret)
+ goto error;
+ unicast_flow = 1;
}
- if (!unicast_flow)
- return 0;
- ret = mlx5_ctrl_flow(dev, &bcast, &bcast);
- if (ret)
- goto error;
- ret = mlx5_ctrl_flow(dev, &ipv6_multi_spec, &ipv6_multi_mask);
- if (ret)
- goto error;
}
+ if (!unicast_flow)
+ return 0;
+ ret = mlx5_ctrl_flow(dev, &bcast, &bcast);
+ if (ret)
+ goto error;
+ ret = mlx5_ctrl_flow(dev, &ipv6_multi_spec, &ipv6_multi_mask);
+ if (ret)
+ goto error;
return 0;
error:
return rte_errno;
--
2.11.0
next prev parent reply other threads:[~2017-10-19 12:51 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 12:51 [dpdk-dev] [PATCH 0/6] net/mlx5: fixes Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 1/6] net/mlx5: fix segfault on flow creation Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 2/6] net/mlx5: fix work queue array size Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 3/6] net/mlx5: fix drop flows when port is stopped Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 4/6] net/mlx5: fix flow director drop action Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 5/6] net/mlx5: fix mark action with " Nelio Laranjeiro
2017-10-19 12:51 ` Nelio Laranjeiro [this message]
2017-10-19 19:36 ` [dpdk-dev] [PATCH 0/6] net/mlx5: fixes Yongseok Koh
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 0/7] " Nelio Laranjeiro
2017-10-24 15:18 ` [dpdk-dev] [PATCH v3 " Nelio Laranjeiro
2017-10-24 19:07 ` Ferruh Yigit
2017-10-24 15:18 ` [dpdk-dev] [PATCH v3 1/7] net/mlx5: fix segfault on flow creation Nelio Laranjeiro
2017-10-24 15:18 ` [dpdk-dev] [PATCH v3 2/7] net/mlx5: fix work queue array size Nelio Laranjeiro
2017-10-24 15:18 ` [dpdk-dev] [PATCH v3 3/7] net/mlx5: fix drop flows when port is stopped Nelio Laranjeiro
2017-10-24 15:18 ` [dpdk-dev] [PATCH v3 4/7] net/mlx5: fix flow director drop action Nelio Laranjeiro
2017-10-24 15:18 ` [dpdk-dev] [PATCH v3 5/7] net/mlx5: fix mark action with " Nelio Laranjeiro
2017-10-24 15:18 ` [dpdk-dev] [PATCH v3 6/7] net/mlx5: fix reception when VLAN is added Nelio Laranjeiro
2017-10-24 17:34 ` Yongseok Koh
2017-10-24 15:18 ` [dpdk-dev] [PATCH v3 7/7] net/mlx5: fix flow director flow add Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 1/7] net/mlx5: fix segfault on flow creation Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 2/7] net/mlx5: fix work queue array size Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 3/7] net/mlx5: fix drop flows when port is stopped Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 4/7] net/mlx5: fix flow director drop action Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 5/7] net/mlx5: fix mark action with " Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 6/7] net/mlx5: fix reception when VLAN is added Nelio Laranjeiro
2017-10-23 19:25 ` Yongseok Koh
2017-10-24 7:11 ` Nélio Laranjeiro
2017-10-24 7:34 ` Nélio Laranjeiro
2017-10-24 13:41 ` Yongseok Koh
2017-10-24 14:19 ` Nélio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 7/7] net/mlx5: fix flow director flow add Nelio Laranjeiro
2017-10-23 20:48 ` Yongseok Koh
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=e8d03f676b83a4e380f5890c6984f96ca4085648.1508417257.git.nelio.laranjeiro@6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=yskoh@mellanox.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).