DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org, Jedrzej Jagielski <jedrzej.jagielski@intel.com>,
	Stefan Wegrzyn <stefan.wegrzyn@intel.com>,
	Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Subject: [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions
Date: Thu, 29 Aug 2024 10:00:07 +0100	[thread overview]
Message-ID: <15a202bbc980f323ee6c8b83482ad3ad7393a95c.1724921977.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <a16bd1264adbd56fefbf1413f27cde338959f61c.1724921977.git.anatoly.burakov@intel.com>

When adding Admin Command Interface and E610 device support, some ACI
capabilities definition code was missed due to the way shared driver code
snapshot was generated. Add missing code paths.

Fixes: 25b48e569f2f ("net/ixgbe/base: add E610 Admin Command Interface")
Fixes: 7c3bfffda43d ("net/ixgbe/base: detect E610 device capabilities")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c      | 49 ++++++++++++++++++++++++
 drivers/net/ixgbe/base/ixgbe_type_e610.h |  4 ++
 2 files changed, 53 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index 3e2be07731..1f3a4532da 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -671,6 +671,9 @@ ixgbe_parse_common_caps(struct ixgbe_hw *hw, struct ixgbe_hw_common_caps *caps,
 	case IXGBE_ACI_CAPS_VALID_FUNCTIONS:
 		caps->valid_functions = number;
 		break;
+	case IXGBE_ACI_CAPS_SRIOV:
+		caps->sr_iov_1_1 = (number == 1);
+		break;
 	case IXGBE_ACI_CAPS_VMDQ:
 		caps->vmdq = (number == 1);
 		break;
@@ -833,6 +836,25 @@ ixgbe_parse_valid_functions_cap(struct ixgbe_hw *hw,
 	hw->logical_pf_id = ixgbe_func_id_to_logical_id(number, hw->pf_id);
 }
 
+/**
+ * ixgbe_parse_vf_dev_caps - Parse IXGBE_ACI_CAPS_VF device caps
+ * @hw: pointer to the HW struct
+ * @dev_p: pointer to device capabilities structure
+ * @cap: capability element to parse
+ *
+ * Parse IXGBE_ACI_CAPS_VF for device capabilities.
+ */
+static void ixgbe_parse_vf_dev_caps(struct ixgbe_hw *hw,
+				    struct ixgbe_hw_dev_caps *dev_p,
+				    struct ixgbe_aci_cmd_list_caps_elem *cap)
+{
+	u32 number = IXGBE_LE32_TO_CPU(cap->number);
+
+	UNREFERENCED_1PARAMETER(hw);
+
+	dev_p->num_vfs_exposed = number;
+}
+
 /**
  * ixgbe_parse_vsi_dev_caps - Parse IXGBE_ACI_CAPS_VSI device caps
  * @hw: pointer to the HW struct
@@ -944,6 +966,9 @@ static void ixgbe_parse_dev_caps(struct ixgbe_hw *hw,
 			ixgbe_parse_valid_functions_cap(hw, dev_p,
 							&cap_resp[i]);
 			break;
+		case IXGBE_ACI_CAPS_VF:
+			ixgbe_parse_vf_dev_caps(hw, dev_p, &cap_resp[i]);
+			break;
 		case IXGBE_ACI_CAPS_VSI:
 			ixgbe_parse_vsi_dev_caps(hw, dev_p, &cap_resp[i]);
 			break;
@@ -962,6 +987,27 @@ static void ixgbe_parse_dev_caps(struct ixgbe_hw *hw,
 
 }
 
+/**
+ * ixgbe_parse_vf_func_caps - Parse IXGBE_ACI_CAPS_VF function caps
+ * @hw: pointer to the HW struct
+ * @func_p: pointer to function capabilities structure
+ * @cap: pointer to the capability element to parse
+ *
+ * Extract function capabilities for IXGBE_ACI_CAPS_VF.
+ */
+static void ixgbe_parse_vf_func_caps(struct ixgbe_hw *hw,
+				     struct ixgbe_hw_func_caps *func_p,
+				     struct ixgbe_aci_cmd_list_caps_elem *cap)
+{
+	u32 logical_id = IXGBE_LE32_TO_CPU(cap->logical_id);
+	u32 number = IXGBE_LE32_TO_CPU(cap->number);
+
+	UNREFERENCED_1PARAMETER(hw);
+
+	func_p->num_allocd_vfs = number;
+	func_p->vf_base_id = logical_id;
+}
+
 /**
  * ixgbe_get_num_per_func - determine number of resources per PF
  * @hw: pointer to the HW structure
@@ -1073,6 +1119,9 @@ static void ixgbe_parse_func_caps(struct ixgbe_hw *hw,
 					&cap_resp[i], "func caps");
 
 		switch (cap) {
+		case IXGBE_ACI_CAPS_VF:
+			ixgbe_parse_vf_func_caps(hw, func_p, &cap_resp[i]);
+			break;
 		case IXGBE_ACI_CAPS_VSI:
 			ixgbe_parse_vsi_func_caps(hw, func_p, &cap_resp[i]);
 			break;
diff --git a/drivers/net/ixgbe/base/ixgbe_type_e610.h b/drivers/net/ixgbe/base/ixgbe_type_e610.h
index 9e72053e2a..dcb874e42e 100644
--- a/drivers/net/ixgbe/base/ixgbe_type_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_type_e610.h
@@ -672,6 +672,8 @@ struct ixgbe_aci_cmd_list_caps_elem {
 	__le16 cap;
 #define IXGBE_ACI_CAPS_VALID_FUNCTIONS			0x0005
 #define IXGBE_ACI_MAX_VALID_FUNCTIONS			0x8
+#define IXGBE_ACI_CAPS_SRIOV				0x0012
+#define IXGBE_ACI_CAPS_VF				0x0013
 #define IXGBE_ACI_CAPS_VMDQ				0x0014
 #define IXGBE_ACI_CAPS_VSI				0x0017
 #define IXGBE_ACI_CAPS_DCB				0x0018
@@ -1954,6 +1956,8 @@ struct ixgbe_hw_common_caps {
 #define IXGBE_MAX_SUPPORTED_GPIO_SDP	8
 	u8 led[IXGBE_MAX_SUPPORTED_GPIO_LED];
 	u8 sdp[IXGBE_MAX_SUPPORTED_GPIO_SDP];
+	/* SR-IOV virtualization */
+	u8 sr_iov_1_1;			/* SR-IOV enabled */
 	/* VMDQ */
 	u8 vmdq;			/* VMDQ supported */
 
-- 
2.43.5


  reply	other threads:[~2024-08-29  9:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
2024-08-29  9:00 ` Anatoly Burakov [this message]
2024-09-03 10:32   ` [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions Bruce Richardson
2024-08-29  9:00 ` [PATCH v1 03/15] net/ixgbe/base: add missing E610 definitions Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 04/15] net/ixgbe/base: add missing legacy mailbox API Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 05/15] net/ixgbe/base: add E610 VF HV macro Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 06/15] net/ixgbe/base: fix unchecked return value Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 07/15] net/ixgbe/base: fix media type handling for E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 08/15] net/ixgbe/base: fix speed autonegotiation on E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 09/15] net/ixgbe/base: FW API version update Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 10/15] net/ixgbe/base: handle 5G link speed for E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 11/15] net/ixgbe/base: remove FW API version check Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 12/15] net/ixgbe/base: disable thermal sensor ops for E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 13/15] net/ixgbe/base: fix mailbox ACK handling Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 14/15] net/ixgbe/base: correct NVM access type for EEPROM writes on E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 15/15] net/ixgbe: add PCI IDs for new device variants Anatoly Burakov
2024-09-03 14:08 ` [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK 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=15a202bbc980f323ee6c8b83482ad3ad7393a95c.1724921977.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jedrzej.jagielski@intel.com \
    --cc=piotr.kwapulinski@intel.com \
    --cc=stefan.wegrzyn@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).