From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Cc: Helin Zhang <helin.zhang@intel.com>
Subject: [dpdk-dev] [PATCH 06/15] i40e/base: expose mirroring config
Date: Thu, 5 May 2016 16:53:35 +0800 [thread overview]
Message-ID: <1462438424-22574-7-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1462438424-22574-1-git-send-email-helin.zhang@intel.com>
It exposes the configuration of mirroring or not egress
traffic to VSIs in promiscuous mode, as latest firmware
supports that from API version 1.5.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
drivers/net/i40e/base/i40e_common.c | 9 ++++++---
drivers/net/i40e/base/i40e_prototype.h | 4 ++--
drivers/net/i40e/i40e_ethdev.c | 4 ++--
drivers/net/i40e/i40e_pf.c | 2 +-
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index e958099..ace5b84 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -2214,10 +2214,12 @@ enum i40e_status_code i40e_aq_set_default_vsi(struct i40e_hw *hw,
* @seid: vsi number
* @set: set unicast promiscuous enable/disable
* @cmd_details: pointer to command details structure or NULL
+ * @rx_only_promisc: flag to decide if egress traffic gets mirrored in promisc
**/
enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
u16 seid, bool set,
- struct i40e_asq_cmd_details *cmd_details)
+ struct i40e_asq_cmd_details *cmd_details,
+ bool rx_only_promisc)
{
struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
@@ -2230,8 +2232,9 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
if (set) {
flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
- if (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) ||
- (hw->aq.api_maj_ver > 1))
+ if (rx_only_promisc &&
+ (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) ||
+ (hw->aq.api_maj_ver > 1)))
flags |= I40E_AQC_SET_VSI_PROMISC_TX;
}
diff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h
index 48a08fd..03dda93 100644
--- a/drivers/net/i40e/base/i40e_prototype.h
+++ b/drivers/net/i40e/base/i40e_prototype.h
@@ -166,7 +166,8 @@ enum i40e_status_code i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
u16 vsi_id, bool set_filter,
struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
- u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
+ u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details,
+ bool rx_only_promisc);
enum i40e_status_code i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
@@ -404,7 +405,6 @@ enum i40e_status_code i40e_aq_remove_cloud_filters(struct i40e_hw *hw,
u16 vsi,
struct i40e_aqc_add_remove_cloud_filters_element_data *filters,
u8 filter_count);
-
enum i40e_status_code i40e_aq_alternate_read(struct i40e_hw *hw,
u32 reg_addr0, u32 *reg_val0,
u32 reg_addr1, u32 *reg_val1);
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index bc28d3c..b1765fe 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1661,7 +1661,7 @@ i40e_dev_promiscuous_enable(struct rte_eth_dev *dev)
int status;
status = i40e_aq_set_vsi_unicast_promiscuous(hw, vsi->seid,
- true, NULL);
+ true, NULL, true);
if (status != I40E_SUCCESS)
PMD_DRV_LOG(ERR, "Failed to enable unicast promiscuous");
@@ -1681,7 +1681,7 @@ i40e_dev_promiscuous_disable(struct rte_eth_dev *dev)
int status;
status = i40e_aq_set_vsi_unicast_promiscuous(hw, vsi->seid,
- false, NULL);
+ false, NULL, true);
if (status != I40E_SUCCESS)
PMD_DRV_LOG(ERR, "Failed to disable unicast promiscuous");
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 5afd61a..b549caa 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -810,7 +810,7 @@ i40e_pf_host_process_cmd_config_promisc_mode(
if (promisc->flags & I40E_FLAG_VF_UNICAST_PROMISC)
unicast = TRUE;
ret = i40e_aq_set_vsi_unicast_promiscuous(hw,
- vf->vsi->seid, unicast, NULL);
+ vf->vsi->seid, unicast, NULL, true);
if (ret != I40E_SUCCESS)
goto send_msg;
--
2.5.0
next prev parent reply other threads:[~2016-05-05 8:54 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-05 8:53 [dpdk-dev] [PATCH 00/15] i40e base driver update Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 01/15] i40e/base: remove HMC AQ APIs Helin Zhang
2016-05-09 16:14 ` Bruce Richardson
2016-05-09 16:16 ` Bruce Richardson
2016-05-05 8:53 ` [dpdk-dev] [PATCH 02/15] i40e/base: refactor NVM update status info Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 03/15] i40e/base: refactor NVM update event handling Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 04/15] i40e/base: code style fixes Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 05/15] i40e/base: fixup Geneve VNI for HW use Helin Zhang
2016-05-10 15:53 ` Bruce Richardson
2016-05-05 8:53 ` Helin Zhang [this message]
2016-05-05 8:53 ` [dpdk-dev] [PATCH 07/15] i40e/base: fix problematic mirror rule ID check Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 08/15] i40e/base: add new devices Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 09/15] i40e/base: fix the number of MSIX vector Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 10/15] i40e/base: fix debug output Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 11/15] i40e/base: add more device capabilities Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 12/15] i40e/base: increase supported AQ API version Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 13/15] i40e/base: add input set mask definitions Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 14/15] i40e/base: add RSS config to virtual channel Helin Zhang
2016-05-05 8:53 ` [dpdk-dev] [PATCH 15/15] i40e/base: add capability of disabling all link Helin Zhang
2016-05-24 6:22 ` [dpdk-dev] [PATCH v2 00/15] i40e base driver update Helin Zhang
2016-05-24 6:22 ` [dpdk-dev] [PATCH v2 01/15] i40e/base: remove HMC AQ APIs Helin Zhang
2016-06-02 2:08 ` Gu, YongjieX
2016-06-14 10:14 ` Bruce Richardson
2016-05-24 6:22 ` [dpdk-dev] [PATCH v2 02/15] i40e/base: move field of NVM update status info Helin Zhang
2016-05-24 6:22 ` [dpdk-dev] [PATCH v2 03/15] i40e/base: refactor NVM update command processing Helin Zhang
2016-05-24 6:22 ` [dpdk-dev] [PATCH v2 04/15] i40e/base: trim the code Helin Zhang
2016-06-14 10:16 ` Bruce Richardson
2016-05-24 6:22 ` [dpdk-dev] [PATCH v2 05/15] i40e/base: fixup Geneve VNI for HW use Helin Zhang
2016-06-14 10:25 ` Bruce Richardson
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 06/15] i40e/base: expose mirroring config Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 07/15] i40e/base: fix problematic mirror rule ID check Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 08/15] i40e/base: add new devices Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 09/15] i40e/base: fix the number of MSIX vector Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 10/15] i40e/base: fix debug output Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 11/15] i40e/base: add more device capabilities Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 12/15] i40e/base: increase supported AQ API version Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 13/15] i40e/base: add input set mask definitions Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 14/15] i40e/base: add RSS config to virtual channel Helin Zhang
2016-05-24 6:23 ` [dpdk-dev] [PATCH v2 15/15] i40e/base: add capability of disabling all link Helin Zhang
2016-06-14 13:48 ` Bruce Richardson
2016-06-06 7:53 ` [dpdk-dev] [PATCH v2 00/15] i40e base driver update Lu, Wenzhuo
2016-06-14 14:01 ` Bruce Richardson
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=1462438424-22574-7-git-send-email-helin.zhang@intel.com \
--to=helin.zhang@intel.com \
--cc=dev@dpdk.org \
/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).