From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH v2 07/12] net/bnxt: add support for trusted VF
Date: Fri, 21 Sep 2018 21:55:54 -0700 [thread overview]
Message-ID: <20180922045559.27438-8-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20180922045559.27438-1-ajit.khaparde@broadcom.com>
In the current model, VFs are not trusted.
So it is not allowed to send many HWRM commands.
Newer firmware has added support to allow VF to be trusted.
Now the VF queries if it is a trusted entity and based on that
it can send HWRM commands to the firmware.
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 2 ++
drivers/net/bnxt/bnxt_cpr.c | 1 +
drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
drivers/net/bnxt/bnxt_hwrm.c | 8 ++++++++
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 996b195a2..44c3747f2 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -260,6 +260,7 @@ struct bnxt {
#define BNXT_FLAG_EXT_RX_PORT_STATS (1 << 8)
#define BNXT_FLAG_EXT_TX_PORT_STATS (1 << 9)
#define BNXT_FLAG_KONG_MB_EN (1 << 10)
+#define BNXT_FLAG_TRUSTED_VF_EN (1 << 11)
#define BNXT_FLAG_NEW_RM (1 << 30)
#define BNXT_FLAG_INIT_DONE (1 << 31)
#define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF))
@@ -269,6 +270,7 @@ struct bnxt {
#define BNXT_SINGLE_PF(bp) (BNXT_PF(bp) && !BNXT_NPAR(bp) && !BNXT_MH(bp))
#define BNXT_USE_CHIMP_MB 0 //For non-CFA commands, everything uses Chimp.
#define BNXT_USE_KONG(bp) ((bp)->flags & BNXT_FLAG_KONG_MB_EN)
+#define BNXT_VF_IS_TRUSTED(bp) ((bp)->flags & BNXT_FLAG_TRUSTED_VF_EN)
unsigned int rx_nr_rings;
unsigned int rx_cp_nr_rings;
diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index ff20b6fdf..0fd6e51e5 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -35,6 +35,7 @@ void bnxt_handle_async_event(struct bnxt *bp,
break;
case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE:
PMD_DRV_LOG(INFO, "Async event: VF config changed\n");
+ bnxt_hwrm_func_qcfg(bp);
break;
case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED:
PMD_DRV_LOG(INFO, "Port conn async event\n");
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e96ee649a..e1b684c2e 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -755,7 +755,7 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
struct bnxt_vnic_info *vnic = &bp->vnic_info[pool];
struct bnxt_filter_info *filter;
- if (BNXT_VF(bp)) {
+ if (BNXT_VF(bp) & !BNXT_VF_IS_TRUSTED(bp)) {
PMD_DRV_LOG(ERR, "Cannot add MAC address to a VF interface\n");
return -ENOTSUP;
}
@@ -1447,7 +1447,7 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, struct ether_addr *addr)
struct bnxt_filter_info *filter;
int rc;
- if (BNXT_VF(bp))
+ if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp))
return -EPERM;
memcpy(bp->mac_addr, addr, sizeof(bp->mac_addr));
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 16f2c2ccc..62da254b9 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -909,6 +909,9 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
bp->flags |= BNXT_FLAG_KONG_MB_EN;
PMD_DRV_LOG(DEBUG, "Kong mailbox channel enabled\n");
}
+ if (dev_caps_cfg &
+ HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED)
+ PMD_DRV_LOG(DEBUG, "FW supports Trusted VFs\n");
error:
HWRM_UNLOCK();
@@ -2458,6 +2461,11 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp)
if (BNXT_PF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST))
bp->flags |= BNXT_FLAG_MULTI_HOST;
+ if (BNXT_VF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {
+ bp->flags |= BNXT_FLAG_TRUSTED_VF_EN;
+ PMD_DRV_LOG(INFO, "Trusted VF cap enabled\n");
+ }
+
switch (resp->port_partition_type) {
case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0:
case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5:
--
2.17.1 (Apple Git-112)
next prev parent reply other threads:[~2018-09-22 4:56 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180901043254.51000-1-ajit.khaparde@broadcom.com>
2018-09-01 4:32 ` [dpdk-dev] [PATCH 1/7] net/bnxt: get rid of ff pools array and use the vnic info array Ajit Khaparde
2018-09-19 9:05 ` Ferruh Yigit
2018-09-19 9:21 ` Ferruh Yigit
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset Ajit Khaparde
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 01/12] net/bnxt: get rid of ff pools array and use the vnic info array instead Ajit Khaparde
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 02/12] net/bnxt: fix uninitialized ptr access in transmit handler Ajit Khaparde
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 03/12] net/bnxt: fix MTU setting Ajit Khaparde
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 04/12] net/bnxt: update HWRM version Ajit Khaparde
2018-09-25 11:39 ` Ferruh Yigit
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 05/12] net/bnxt: add support for extended port counters Ajit Khaparde
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 06/12] net/bnxt: add support to enable new mailbox channel Ajit Khaparde
2018-09-22 4:55 ` Ajit Khaparde [this message]
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 08/12] net/bnxt: use correct macro to register VF async event completion ring Ajit Khaparde
2018-09-25 11:30 ` Ferruh Yigit
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 09/12] net/bnxt: set MAC filtering as outer for non tunnel frames Ajit Khaparde
2018-09-25 11:33 ` Ferruh Yigit
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 10/12] net/bnxt: set a VNIC as default only once Ajit Khaparde
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 11/12] net/bnxt: set VLAN strip mode before default vnic cfg Ajit Khaparde
2018-09-25 11:34 ` Ferruh Yigit
2018-09-22 4:55 ` [dpdk-dev] [PATCH v2 12/12] net/bnxt: remove excess log messages Ajit Khaparde
2018-09-25 11:35 ` Ferruh Yigit
2018-09-25 11:37 ` [dpdk-dev] [PATCH v2 00/12] bnxt patchset Ferruh Yigit
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 00/15] " Ajit Khaparde
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 01/15] net/bnxt: get rid of ff pools and use VNIC info array Ajit Khaparde
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 02/15] net/bnxt: fix uninitialized ptr access in transmit handler Ajit Khaparde
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 03/15] net/bnxt: fix MTU setting Ajit Khaparde
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 04/15] net/bnxt: update HWRM version Ajit Khaparde
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 05/15] net/bnxt: update HWRM version part 2 Ajit Khaparde
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 06/15] net/bnxt: update HWRM version part 3 Ajit Khaparde
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 07/15] net/bnxt: add support for extended port counters Ajit Khaparde
2018-09-29 1:59 ` [dpdk-dev] [PATCH v3 08/15] net/bnxt: add support to enable new mailbox channel Ajit Khaparde
2018-09-29 2:00 ` [dpdk-dev] [PATCH v3 09/15] net/bnxt: add support for trusted VF Ajit Khaparde
2018-09-29 2:00 ` [dpdk-dev] [PATCH v3 10/15] net/bnxt: fix registration of VF async event completion ring Ajit Khaparde
2018-09-29 2:00 ` [dpdk-dev] [PATCH v3 11/15] net/bnxt: set MAC filtering as outer for non tunnel frames Ajit Khaparde
2018-09-29 2:00 ` [dpdk-dev] [PATCH v3 12/15] net/bnxt: set a VNIC as default only once Ajit Khaparde
2018-09-29 2:00 ` [dpdk-dev] [PATCH v3 13/15] net/bnxt: set VLAN strip mode before default VNIC cfg Ajit Khaparde
2018-09-29 2:00 ` [dpdk-dev] [PATCH v3 14/15] net/bnxt: remove excess log messages Ajit Khaparde
2018-09-29 2:00 ` [dpdk-dev] [PATCH v3 15/15] net/bnxt: reduce the polling interval for valid bit Ajit Khaparde
2018-10-02 8:25 ` [dpdk-dev] [PATCH v3 00/15] bnxt patchset Ferruh Yigit
2018-10-02 16:44 ` Ajit Khaparde
2018-10-03 9:48 ` Ferruh Yigit
2018-09-01 4:32 ` [dpdk-dev] [PATCH 2/7] net/bnxt: fix uninitialized ptr access in transmit handler Ajit Khaparde
2018-09-19 9:23 ` Ferruh Yigit
2018-09-01 4:32 ` [dpdk-dev] [PATCH 3/7] net/bnxt: fix MTU setting Ajit Khaparde
2018-09-01 4:32 ` [dpdk-dev] [PATCH 4/7] net/bnxt: update HWRM version Ajit Khaparde
2018-09-01 4:32 ` [dpdk-dev] [PATCH 5/7] net/bnxt: add support for extended port counters Ajit Khaparde
2018-09-01 4:32 ` [dpdk-dev] [PATCH 6/7] net/bnxt: add support to enable new mailbox channel Ajit Khaparde
2018-09-01 4:32 ` [dpdk-dev] [PATCH 7/7] net/bnxt: add support for trusted VF Ajit Khaparde
2018-09-19 9:26 ` [dpdk-dev] [PATCH 0/7] bnxt patchset 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=20180922045559.27438-8-ajit.khaparde@broadcom.com \
--to=ajit.khaparde@broadcom.com \
--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).