Skip to contentSkip to conversation

net/ice: update share code

PATCH Superseded Qi Zhang 3 participants 21 messages Jan 15, 2019 – Jan 17, 2019

Subsystems (2)
lore
Share & tools
lore

Qi Zhang

author
#0 lore raw

cover net/ice: update share code

For ice family NICs, package processing pipe line can be configured in a package file should be downloaded into device by driver during init. The patch set add necessary share code APIs to support package download. Also some code clean is included.

Though package download will not be enabled in 19.02 as plan, but we hope the share code part could be merged early.

Meanwhile we will submit a seperate RFC patch for package download for customer early evelutation.

Qi Zhang (7):
net/ice/base: code clean
net/ice/base: add API to support resource allocate net/ice/base: add package download related data structure net/ice/base: add some help macros
net/ice/base: add flexible pipeline module net/ice/base: add flow module
net/ice/base: free flow profile entries

 drivers/net/ice/Makefile              |    2 +
 drivers/net/ice/base/ice_adminq_cmd.h |   85 +
 drivers/net/ice/base/ice_common.c     |   85 +-
 drivers/net/ice/base/ice_common.h     |   32 +-
 drivers/net/ice/base/ice_controlq.c   |    2 +-
 drivers/net/ice/base/ice_flex_pipe.c  | 5056 +++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_flex_pipe.h  |  107 +
 drivers/net/ice/base/ice_flex_type.h  |  685 +++++
 drivers/net/ice/base/ice_flow.c       | 2080 ++++++++++++++
 drivers/net/ice/base/ice_flow.h       |  337 +++
 drivers/net/ice/base/ice_osdep.h      |    2 +
 drivers/net/ice/base/ice_type.h       |   37 +-
 drivers/net/ice/base/meson.build      |    2 +
 13 files changed, 8479 insertions(+), 33 deletions(-)
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.c
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.h
 create mode 100644 drivers/net/ice/base/ice_flow.c
Signature · 1 line
2.13.6
author
#1 lore raw

PATCH 1/7 net/ice/base: code clean

Remove some unnecessary code.

---
 drivers/net/ice/base/ice_common.c   | 14 --------------
 drivers/net/ice/base/ice_common.h   | 17 -----------------
 drivers/net/ice/base/ice_controlq.c |  2 +-
 3 files changed, 1 insertion(+), 32 deletions(-)
drivers/net/ice/base/ice_common.c +0 -14
index d49264d14..2ccf58527 100644
@@ -60,16 +60,6 @@ static enum ice_status ice_set_mac_type(struct ice_hw *hw)
 	return status;
 }
 
-#if defined(FPGA_SUPPORT) || defined(CVL_A0_SUPPORT)
-void ice_dev_onetime_setup(struct ice_hw *hw)
-{
-	/* configure Rx - set non pxe mode */
-	wr32(hw, GLLAN_RCTL_0, 0x1);
-
-
-
-}
-#endif /* FPGA_SUPPORT || CVL_A0_SUPPORT */
 
 /**
  * ice_clear_pf_cfg - Clear PF configuration
@@ -830,10 +820,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
 	if (status)
 		goto err_unroll_sched;
 
-#if defined(FPGA_SUPPORT) || defined(CVL_A0_SUPPORT)
-	/* some of the register write workarounds to get Rx working */
-	ice_dev_onetime_setup(hw);
-#endif /* FPGA_SUPPORT || CVL_A0_SUPPORT */
 
 	/* Get MAC information */
 	/* A single port can report up to two (LAN and WoL) addresses */
drivers/net/ice/base/ice_common.h +0 -17
index 082ae66f9..0197fbfe3 100644
@@ -9,18 +9,6 @@
 
 #include "ice_switch.h"
 
-/* prototype for functions used for SW locks */
-void ice_free_list(struct LIST_HEAD_TYPE *list);
-void ice_init_lock(struct ice_lock *lock);
-void ice_acquire_lock(struct ice_lock *lock);
-void ice_release_lock(struct ice_lock *lock);
-void ice_destroy_lock(struct ice_lock *lock);
-
-void *ice_alloc_dma_mem(struct ice_hw *hw, struct ice_dma_mem *m, u64 size);
-void ice_free_dma_mem(struct ice_hw *hw, struct ice_dma_mem *m);
-
-bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq);
-
 enum ice_status ice_nvm_validate_checksum(struct ice_hw *hw);
 
 void
@@ -61,11 +49,6 @@ enum ice_status ice_get_caps(struct ice_hw *hw);
 
 
 
-#if defined(FPGA_SUPPORT) || defined(CVL_A0_SUPPORT)
-void ice_dev_onetime_setup(struct ice_hw *hw);
-#endif /* FPGA_SUPPORT || CVL_A0_SUPPORT */
-
-
 enum ice_status
 ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx,
 		  u32 rxq_index);
drivers/net/ice/base/ice_controlq.c +1 -1
index fb82c23ee..cbc4cb4c2 100644
@@ -735,7 +735,7 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
  * Returns true if the firmware has processed all descriptors on the
  * admin send queue. Returns false if there are still requests pending.
  */
-bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)
+static bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)
 {
 	/* AQ designers suggest use of head for better
 	 * timing reliability than DD bit
Signature · 1 line
2.13.6
author
#2 lore raw

PATCH 2/7 net/ice/base: add API to support resource allocate

In reply to Qi Zhang

Added API ice_alloc_hw_res and ice_free_hw_res.
Added resource type macro.

---
 drivers/net/ice/base/ice_adminq_cmd.h | 27 +++++++++++++
 drivers/net/ice/base/ice_common.c     | 71 +++++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_common.h     |  4 ++
 3 files changed, 102 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +27 -0
index 9332f84aa..3003efd55 100644
@@ -238,8 +238,35 @@ struct ice_aqc_get_sw_cfg_resp {
  * Free Resources command (indirect 0x0209)
  * Get Allocated Resource Descriptors Command (indirect 0x020A)
  */
+#define ICE_AQC_RES_TYPE_VEB_COUNTER			0x00
+#define ICE_AQC_RES_TYPE_VLAN_COUNTER			0x01
+#define ICE_AQC_RES_TYPE_MIRROR_RULE			0x02
 #define ICE_AQC_RES_TYPE_VSI_LIST_REP			0x03
 #define ICE_AQC_RES_TYPE_VSI_LIST_PRUNE			0x04
+#define ICE_AQC_RES_TYPE_RECIPE				0x05
+#define ICE_AQC_RES_TYPE_PROFILE			0x06
+#define ICE_AQC_RES_TYPE_SWID				0x07
+#define ICE_AQC_RES_TYPE_VSI				0x08
+#define ICE_AQC_RES_TYPE_FLU				0x09
+#define ICE_AQC_RES_TYPE_WIDE_TABLE_1			0x0A
+#define ICE_AQC_RES_TYPE_WIDE_TABLE_2			0x0B
+#define ICE_AQC_RES_TYPE_WIDE_TABLE_4			0x0C
+#define ICE_AQC_RES_TYPE_GLOBAL_RSS_HASH		0x20
+#define ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK		0x21
+#define ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES	0x22
+#define ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES		0x23
+#define ICE_AQC_RES_TYPE_FLEX_DESC_PROG			0x30
+#define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_PROFID	0x48
+#define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_TCAM		0x49
+#define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_PROFID		0x50
+#define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_TCAM		0x51
+#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_PROFID		0x58
+#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_TCAM		0x59
+#define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_PROFID		0x60
+#define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_TCAM		0x61
+/* Resource types 0x62-67 are reserved for Hash profile builder */
+#define ICE_AQC_RES_TYPE_QHASH_PROF_BLDR_PROFID		0x68
+#define ICE_AQC_RES_TYPE_QHASH_PROF_BLDR_TCAM		0x69
 
 #define ICE_AQC_RES_TYPE_FLAG_SHARED			BIT(7)
 #define ICE_AQC_RES_TYPE_FLAG_SCAN_BOTTOM		BIT(12)
drivers/net/ice/base/ice_common.c +71 -0

77 lines not on this page · raw message

drivers/net/ice/base/ice_common.h +4 -0
index 0197fbfe3..45d93eb64 100644
@@ -32,6 +32,10 @@ ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res,
 		enum ice_aq_res_access_type access, u32 timeout);
 void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res);
 enum ice_status
+ice_alloc_hw_res(struct ice_hw *hw, u16 type, u16 num, bool sh, u16 *res);
+enum ice_status
+ice_free_hw_res(struct ice_hw *hw, u16 type, u16 num, u16 *res);
+enum ice_status
 ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries,
 		      struct ice_aqc_alloc_free_res_elem *buf, u16 buf_size,
 		      enum ice_adminq_opc opc, struct ice_sq_cd *cd);
Signature · 1 line
2.13.6
author
#3 lore raw

PATCH 3/7 net/ice/base: add package download related data structure

In reply to Qi Zhang
---
 drivers/net/ice/base/ice_adminq_cmd.h | 58 +++++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_type.h       |  1 -
 2 files changed, 58 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_adminq_cmd.h +58 -0
index 3003efd55..a1b9edd14 100644
@@ -1576,6 +1576,57 @@ struct ice_aqc_move_txqs_data {
 
 
 
+/* Download Package (indirect 0x0C40) */
+/* Also used for Update Package (indirect 0x0C42) */
+struct ice_aqc_download_pkg {
+	u8 flags;
+#define ICE_AQC_DOWNLOAD_PKG_LAST_BUF	0x01
+	u8 reserved[3];
+	__le32 reserved1;
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
+struct ice_aqc_download_pkg_resp {
+	__le32 error_offset;
+	__le32 error_info;
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
+/* Get Package Info List (indirect 0x0C43) */
+struct ice_aqc_get_pkg_info_list {
+	__le32 reserved1;
+	__le32 reserved2;
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
+/* Version format for packages */
+struct ice_pkg_ver {
+	u8 major;
+	u8 minor;
+	u8 update;
+	u8 draft;
+};
+
+#define ICE_PKG_NAME_SIZE	32
+
+struct ice_aqc_get_pkg_info {
+	struct ice_pkg_ver ver;
+	char name[ICE_PKG_NAME_SIZE];
+	u8 is_in_nvm;
+	u8 is_active;
+	u8 is_active_at_boot;
+	u8 is_modified;
+};
+
+/* Get Package Info List response buffer format (0x0C43) */
+struct ice_aqc_get_pkg_info_resp {
+	__le32 count;
+	struct ice_aqc_get_pkg_info pkg_info[1];
+};
+
 
 
 
@@ -1726,6 +1777,8 @@ struct ice_aq_desc {
 		struct ice_aqc_txqs_cleanup txqs_cleanup;
 		struct ice_aqc_add_get_update_free_vsi vsi_cmd;
 		struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res;
+		struct ice_aqc_download_pkg download_pkg;
+		struct ice_aqc_get_pkg_info_list get_pkg_info_list;
 		struct ice_aqc_fw_logging fw_logging;
 		struct ice_aqc_get_clear_fw_log get_clear_fw_log;
 		struct ice_aqc_set_mac_lb set_mac_lb;
@@ -1903,6 +1956,11 @@ enum ice_adminq_opc {
 	ice_aqc_opc_txqs_cleanup			= 0x0C31,
 	ice_aqc_opc_move_recfg_txqs			= 0x0C32,
 
+	/* package commands */
+	ice_aqc_opc_download_pkg			= 0x0C40,
+	ice_aqc_opc_upload_section			= 0x0C41,
+	ice_aqc_opc_update_pkg				= 0x0C42,
+	ice_aqc_opc_get_pkg_info_list			= 0x0C43,
 
 
 
drivers/net/ice/base/ice_type.h +0 -1
index 256bf3f37..d7c12d172 100644
@@ -704,7 +704,6 @@ struct ice_hw {
 
 	u8 ucast_shared;	/* true if VSIs can share unicast addr */
 
-
 };
 
 /* Statistics collected by each port, VSI, VEB, and S-channel */
Signature · 1 line
2.13.6
author
#4 lore raw

PATCH 4/7 net/ice/base: add some help macros

In reply to Qi Zhang
---
 drivers/net/ice/base/ice_common.h | 10 ++++++++++
 drivers/net/ice/base/ice_osdep.h  |  2 ++
 2 files changed, 12 insertions(+)
drivers/net/ice/base/ice_common.h +10 -0
index 45d93eb64..67539ccb7 100644
@@ -51,6 +51,16 @@ void ice_clear_pxe_mode(struct ice_hw *hw);
 
 enum ice_status ice_get_caps(struct ice_hw *hw);
 
+/* Define a macro that will align a pointer to point to the next memory address
+ * that falls on the given power of 2 (i.e., 2, 4, 8, 16, 32, 64...). For
+ * example, given the variable pointer = 0x1006, then after the following call:
+ *
+ *      pointer = ICE_ALIGN(pointer, 4)
+ *
+ * ... the value of pointer would equal 0x1008, since 0x1008 is the next
+ * address after 0x1006 which is divisible by 4.
+ */
+#define ICE_ALIGN(ptr, align)   (((ptr) + ((align) - 1)) & ~((align) - 1))
 
 
 enum ice_status
drivers/net/ice/base/ice_osdep.h +2 -0
index a3351c034..252c8f4e7 100644
@@ -457,6 +457,8 @@ LIST_HEAD(ice_list_head, ice_list_entry);
 
 /*Note parameters are swapped*/
 #define LIST_FIRST_ENTRY(head, type, field) (type *)((head)->lh_first)
+#define LIST_NEXT_ENTRY(entry, type, field) \
+	((type *)(entry)->field.next.le_next)
 #define LIST_ADD(entry, list_head)    LIST_INSERT_HEAD(list_head, entry, next)
 #define LIST_ADD_AFTER(entry, list_entry) \
 	LIST_INSERT_AFTER(list_entry, entry, next)
Signature · 1 line
2.13.6
author
#5 lore raw

PATCH 5/7 net/ice/base: add flexible pipeline module

In reply to Qi Zhang

The flexible pipeline module provide the intrastructure for ice's flexible packet processing feature.

---
 drivers/net/ice/Makefile             |    1 +
 drivers/net/ice/base/ice_flex_pipe.c | 5018 ++++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_flex_pipe.h |  107 +
 drivers/net/ice/base/ice_flex_type.h |  685 +++++
 drivers/net/ice/base/ice_type.h      |   36 +
 drivers/net/ice/base/meson.build     |    1 +
 6 files changed, 5848 insertions(+)
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.c
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.h
drivers/net/ice/Makefile +1 -0
index 4b421cde3..1bb76efc2 100644
@@ -49,6 +49,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_common.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_sched.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_switch.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_nvm.c
+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_flex_pipe.c
 
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_rxtx.c
drivers/net/ice/base/ice_flex_pipe.c new file +5018 -0

2,993 lines not on this page · raw message

drivers/net/ice/base/ice_flex_pipe.h new file +107 -0

107 lines not on this page · raw message

drivers/net/ice/base/ice_flex_type.h +685 -0

685 lines not on this page · raw message

drivers/net/ice/base/ice_type.h +36 -0
index d7c12d172..17d79ba21 100644

Lines of this file are not shown. View the raw message.

drivers/net/ice/base/meson.build +1 -0
index 0cfc8cd67..77a9802f4 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.13.6

Part of the diff is not shown here. View the raw message.

author
#6 lore raw

PATCH 6/7 net/ice/base: add flow module

In reply to Qi Zhang

Add the module that implemented flow abstraction that base on flexible pipeline.

---
 drivers/net/ice/Makefile          |    1 +
 drivers/net/ice/base/ice_common.h |    1 +
 drivers/net/ice/base/ice_flow.c   | 2080 +++++++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_flow.h   |  337 ++++++
 drivers/net/ice/base/meson.build  |    1 +
 5 files changed, 2420 insertions(+)
 create mode 100644 drivers/net/ice/base/ice_flow.c
drivers/net/ice/Makefile +1 -0
index 1bb76efc2..61846cae2 100644
@@ -50,6 +50,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_sched.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_switch.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_nvm.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_flex_pipe.c
+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_flow.c
 
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_rxtx.c
drivers/net/ice/base/ice_common.h +1 -0
index 67539ccb7..5ac991ef2 100644
@@ -7,6 +7,7 @@
 
 #include "ice_type.h"
 
+#include "ice_flex_pipe.h"
 #include "ice_switch.h"
 
 enum ice_status ice_nvm_validate_checksum(struct ice_hw *hw);
drivers/net/ice/base/ice_flow.c new file +2080 -0

2,080 lines not on this page · raw message

drivers/net/ice/base/ice_flow.h +337 -0

341 lines not on this page · raw message

drivers/net/ice/base/meson.build +1 -0
index 77a9802f4..d7f8536bc 100644
@@ -8,6 +8,7 @@ sources = [
 	'ice_switch.c',
 	'ice_nvm.c',
 	'ice_flex_pipe.c',
+	'ice_flow.c',
 ]
 
 error_cflags = ['-Wno-unused-value',
Signature · 1 line
2.13.6
#7 lore raw

Re: [PATCH 6/7] net/ice/base: add flow module

Quoted 5 lines · Qi Zhang

Add the module that implemented flow abstraction that base on flexible pipeline.

<...>

Quoted 26 lines
drivers/net/ice/base/ice_flow.c new file +26 -0
+/**
+ * ice_flow_find_entry - look for a flow entry using its unique ID
+ * @hw: pointer to the hw struct
+ * @blk: classification stage
+ * @entry_id: unique ID to identify this flow entry
+ *
+ * This function looks for the flow entry with the specified unique ID in all
+ * flow profiles of the specified classification stage. If the entry is found,
+ * and it returns the handle to the flow entry. Otherwise, it returns
+ * ICE_FLOW_ENTRY_ID_INVAL.
+ */
+u64 ice_flow_find_entry(struct ice_hw *hw, enum ice_block blk, u64 entry_id)
+{
+	struct ice_flow_entry *found = NULL;
+	struct ice_flow_prof *p;
+
+	ice_acquire_lock(&hw->fl_profs_locks[blk]);
+
+	LIST_FOR_EACH_ENTRY(p, &hw->fl_profs[blk], ice_flow_prof, l_entry) {
+		struct ice_flow_entry *e;
+
+		ice_acquire_lock(&p->entries_lock);
+		LIST_FOR_EACH_ENTRY(e, &p->entries, ice_flow_entry, l_entry)
+			if (e->id == entry_id) {
+				found = e;
+				break;

drivers/net/ice/base/ice_flow.c line 1247

Quoted 10 lines
drivers/net/ice/base/ice_flow.c new file +10 -0
+			}
+		ice_release_lock(&p->entries_lock);
+
+		if (found)
+			break;
+	}
+
+	ice_release_lock(&hw->fl_profs_locks[blk]);
+
+	return found ? ICE_FLOW_ENTRY_HNDL(found) : ICE_FLOW_ENTRY_HANDLE_INVAL;

ICE_FLOW_ENTRY_HNDL macro is causing build error for 32-bits build [1], there are a few more usage of this macro, all are causing same issue:

[1]
Building i686-native-linuxapp-gcc ...
In file included from .../drivers/net/ice/base/ice_flow.c:6:
.../drivers/net/ice/base/ice_flow.c: In function ‘ice_flow_find_entry’:
.../drivers/net/ice/base/ice_flow.h:242:33: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

 #define ICE_FLOW_ENTRY_HNDL(e) ((u64)e)
                                 ^
.../drivers/net/ice/base/ice_flow.c:1247:17: note: in expansion of macro
‘ICE_FLOW_ENTRY_HNDL’
  return found ? ICE_FLOW_ENTRY_HNDL(found) : ICE_FLOW_ENTRY_HANDLE_INVAL;
                 ^~~~~~~~~~~~~~~~~~~

<...>

Quoted 5 lines
drivers/net/ice/base/ice_flow.c new file +5 -0
+/**
+ * ice_flow_rem_entry - Remove a flow entry
+ * @hw: pointer to the hw struct
+ * @entry_h: handle to the flow entry to be removed
+ */

drivers/net/ice/base/ice_flow.c line 1350

Quoted 10 lines
drivers/net/ice/base/ice_flow.c new file +10 -0
+enum ice_status ice_flow_rem_entry(struct ice_hw *hw, u64 entry_h)
+{
+	struct ice_flow_entry *entry;
+	struct ice_flow_prof *prof;
+	enum ice_status status;
+
+	if (entry_h == ICE_FLOW_ENTRY_HANDLE_INVAL)
+		return ICE_ERR_PARAM;
+
+	entry = ICE_FLOW_ENTRY_PTR(entry_h);

causing build error for 32-bits [2]:

[2]
.../drivers/net/ice/base/ice_flow.c: In function ‘ice_flow_rem_entry’:
.../drivers/net/ice/base/ice_flow.h:243:32: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

 #define ICE_FLOW_ENTRY_PTR(h) ((struct ice_flow_entry *)(h))
                                ^
.../drivers/net/ice/base/ice_flow.c:1350:10: note: in expansion of macro
‘ICE_FLOW_ENTRY_PTR’
  entry = ICE_FLOW_ENTRY_PTR(entry_h);
          ^~~~~~~~~~~~~~~~~~
author
#8 lore raw

PATCH 7/7 net/ice/base: free flow profile entries

In reply to Qi Zhang

Free flow profile entries when free hw tables.

---
 drivers/net/ice/base/ice_flex_pipe.c | 38 ++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
drivers/net/ice/base/ice_flex_pipe.c +38 -0
index 0b8376d31..479b8bded 100644
@@ -3034,6 +3034,42 @@ static void ice_fill_blk_tbls(struct ice_hw *hw, enum ice_block block_id)
 }
 
 /**
+ * ice_free_flow_profs - free flow profile entries
+ * @hw: pointer to the hardware structure
+ */
+static void ice_free_flow_profs(struct ice_hw *hw)
+{
+	u8 i;
+
+	for (i = 0; i < ICE_BLK_COUNT; i++) {
+		struct ice_flow_prof *p, *tmp;
+
+		if (!&hw->fl_profs[i])
+			continue;
+
+		/* This call is being made as part of resource deallocation
+		 * during unload. Lock acquire and release will not be
+		 * necessary here.
+		 */
+		LIST_FOR_EACH_ENTRY_SAFE(p, tmp, &hw->fl_profs[i],
+					 ice_flow_prof, l_entry) {
+			struct ice_flow_entry *e, *t;
+
+			LIST_FOR_EACH_ENTRY_SAFE(e, t, &p->entries,
+						 ice_flow_entry, l_entry)
+				ice_flow_rem_entry(hw, ICE_FLOW_ENTRY_HNDL(e));
+
+			LIST_DEL(&p->l_entry);
+			if (p->acts)
+				ice_free(hw, p->acts);
+			ice_free(hw, p);
+		}
+
+		ice_destroy_lock(&hw->fl_profs_locks[i]);
+	}
+}
+
+/**
  * ice_free_prof_map - frees the profile map
  * @hw: pointer to the hardware structure
  * @blk: the hw block which contains the profile map to be freed
@@ -3096,6 +3132,8 @@ void ice_free_hw_tbls(struct ice_hw *hw)
 	}
 
 	ice_memset(hw->blk, 0, sizeof(hw->blk), ICE_NONDMA_MEM);
+
+	ice_free_flow_profs(hw);
 }
 
 /**
Signature · 1 line
2.13.6
#9 lore raw

Re: [PATCH 7/7] net/ice/base: free flow profile entries

Quoted 4 lines · Qi Zhang

Free flow profile entries when free hw tables.

<...>

Quoted 15 lines

/**
+ * ice_free_flow_profs - free flow profile entries
+ * @hw: pointer to the hardware structure
+ */

drivers/net/ice/base/ice_flex_pipe.c +11 -0
+static void ice_free_flow_profs(struct ice_hw *hw)
+{
+	u8 i;
+
+	for (i = 0; i < ICE_BLK_COUNT; i++) {
+		struct ice_flow_prof *p, *tmp;
+
+		if (!&hw->fl_profs[i])
+			continue;
+
+		/* This call is being made as part of resource deallocation

drivers/net/ice/base/ice_flex_pipe.c static void ice_fill_blk_tbls(struct ice_hw *hw, enum ice_block block_id) · line 3060

Quoted 10 lines
drivers/net/ice/base/ice_flex_pipe.c +10 -0
+		 * during unload. Lock acquire and release will not be
+		 * necessary here.
+		 */
+		LIST_FOR_EACH_ENTRY_SAFE(p, tmp, &hw->fl_profs[i],
+					 ice_flow_prof, l_entry) {
+			struct ice_flow_entry *e, *t;
+
+			LIST_FOR_EACH_ENTRY_SAFE(e, t, &p->entries,
+						 ice_flow_entry, l_entry)
+				ice_flow_rem_entry(hw, ICE_FLOW_ENTRY_HNDL(e));

Same 32-bits build error here for ICE_FLOW_ENTRY_HNDL usage.

#10 lore raw
In reply to Qi Zhang
Quoted 15 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Tuesday, January 15, 2019 8:57 PM
To: Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>
Cc: Stillwell Jr, Paul M <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH 0/7] net/ice: update share code

For ice family NICs, package processing pipe line can be configured in a package file should be downloaded into device by driver during init. The patch set add necessary share code APIs to support package download. Also some code clean is included.

Quoted 6 lines

Though package download will not be enabled in 19.02 as plan, but we hope the share code part could be merged early.

Meanwhile we will submit a seperate RFC patch for package download for customer early evelutation.

Series Acked-by: Wenzhuo Lu <[email protected]>

#11 lore raw
In reply to Qi Zhang
Quoted 11 lines · Qi Zhang

For ice family NICs, package processing pipe line can be configured in a package file should be downloaded into device by driver during init. The patch set add necessary share code APIs to support package download. Also some code clean is included.

Though package download will not be enabled in 19.02 as plan, but we hope the share code part could be merged early.

Meanwhile we will submit a seperate RFC patch for package download for customer early evelutation.

Quoted 8 lines

Qi Zhang (7):
net/ice/base: code clean
net/ice/base: add API to support resource allocate net/ice/base: add package download related data structure net/ice/base: add some help macros
net/ice/base: add flexible pipeline module net/ice/base: add flow module
net/ice/base: free flow profile entries

Since there will be already a new version, can you also check the checkpatch errors, there are a few reported.

Thanks,
ferruh

author
#12 lore raw

v2 cover net/ice: update share code

In reply to Qi Zhang

For ice family NICs, package processing pipe line can be configured in a package file should be downloaded into device by driver during init. The patch set add necessary share code APIs to support package download. Also some code clean is included.

Though package download will not be enabled in 19.02 as plan, but we hope the share code part could be merged early.

Meanwhile we will submit a seperate RFC patch for package download for customer early evelutation.

v2:
- fix 32 bit compile error.
- fix check patch warning.

Qi Zhang (7):
net/ice/base: code clean
net/ice/base: add API to support resource allocate net/ice/base: add package download related data structure net/ice/base: add some help macros
net/ice/base: add flexible pipeline module net/ice/base: add flow module
net/ice/base: free flow profile entries

 drivers/net/ice/Makefile              |    2 +
 drivers/net/ice/base/ice_adminq_cmd.h |   85 +
 drivers/net/ice/base/ice_common.c     |   85 +-
 drivers/net/ice/base/ice_common.h     |   32 +-
 drivers/net/ice/base/ice_controlq.c   |    2 +-
 drivers/net/ice/base/ice_flex_pipe.c  | 5056 +++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_flex_pipe.h  |  107 +
 drivers/net/ice/base/ice_flex_type.h  |  685 +++++
 drivers/net/ice/base/ice_flow.c       | 2080 ++++++++++++++
 drivers/net/ice/base/ice_flow.h       |  337 +++
 drivers/net/ice/base/ice_osdep.h      |    2 +
 drivers/net/ice/base/ice_type.h       |   37 +-
 drivers/net/ice/base/meson.build      |    2 +
 13 files changed, 8479 insertions(+), 33 deletions(-)
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.c
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.h
 create mode 100644 drivers/net/ice/base/ice_flow.c
Signature · 1 line
2.13.6
author
#13 lore raw

PATCH v2 1/7 net/ice/base: code clean

Remove some unnecessary code.

---
 drivers/net/ice/base/ice_common.c   | 14 --------------
 drivers/net/ice/base/ice_common.h   | 17 -----------------
 drivers/net/ice/base/ice_controlq.c |  2 +-
 3 files changed, 1 insertion(+), 32 deletions(-)
drivers/net/ice/base/ice_common.c +0 -14
index d49264d14..2ccf58527 100644
@@ -60,16 +60,6 @@ static enum ice_status ice_set_mac_type(struct ice_hw *hw)
 	return status;
 }
 
-#if defined(FPGA_SUPPORT) || defined(CVL_A0_SUPPORT)
-void ice_dev_onetime_setup(struct ice_hw *hw)
-{
-	/* configure Rx - set non pxe mode */
-	wr32(hw, GLLAN_RCTL_0, 0x1);
-
-
-
-}
-#endif /* FPGA_SUPPORT || CVL_A0_SUPPORT */
 
 /**
  * ice_clear_pf_cfg - Clear PF configuration
@@ -830,10 +820,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
 	if (status)
 		goto err_unroll_sched;
 
-#if defined(FPGA_SUPPORT) || defined(CVL_A0_SUPPORT)
-	/* some of the register write workarounds to get Rx working */
-	ice_dev_onetime_setup(hw);
-#endif /* FPGA_SUPPORT || CVL_A0_SUPPORT */
 
 	/* Get MAC information */
 	/* A single port can report up to two (LAN and WoL) addresses */
drivers/net/ice/base/ice_common.h +0 -17
index 082ae66f9..0197fbfe3 100644
@@ -9,18 +9,6 @@
 
 #include "ice_switch.h"
 
-/* prototype for functions used for SW locks */
-void ice_free_list(struct LIST_HEAD_TYPE *list);
-void ice_init_lock(struct ice_lock *lock);
-void ice_acquire_lock(struct ice_lock *lock);
-void ice_release_lock(struct ice_lock *lock);
-void ice_destroy_lock(struct ice_lock *lock);
-
-void *ice_alloc_dma_mem(struct ice_hw *hw, struct ice_dma_mem *m, u64 size);
-void ice_free_dma_mem(struct ice_hw *hw, struct ice_dma_mem *m);
-
-bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq);
-
 enum ice_status ice_nvm_validate_checksum(struct ice_hw *hw);
 
 void
@@ -61,11 +49,6 @@ enum ice_status ice_get_caps(struct ice_hw *hw);
 
 
 
-#if defined(FPGA_SUPPORT) || defined(CVL_A0_SUPPORT)
-void ice_dev_onetime_setup(struct ice_hw *hw);
-#endif /* FPGA_SUPPORT || CVL_A0_SUPPORT */
-
-
 enum ice_status
 ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx,
 		  u32 rxq_index);
drivers/net/ice/base/ice_controlq.c +1 -1
index fb82c23ee..cbc4cb4c2 100644
@@ -735,7 +735,7 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
  * Returns true if the firmware has processed all descriptors on the
  * admin send queue. Returns false if there are still requests pending.
  */
-bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)
+static bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)
 {
 	/* AQ designers suggest use of head for better
 	 * timing reliability than DD bit
Signature · 1 line
2.13.6
author
#14 lore raw

PATCH v2 2/7 net/ice/base: add API to support resource allocate

In reply to Qi Zhang

Added API ice_alloc_hw_res and ice_free_hw_res.
Added resource type macro.

---
 drivers/net/ice/base/ice_adminq_cmd.h | 27 +++++++++++++
 drivers/net/ice/base/ice_common.c     | 71 +++++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_common.h     |  4 ++
 3 files changed, 102 insertions(+)
drivers/net/ice/base/ice_adminq_cmd.h +27 -0
index 9332f84aa..3003efd55 100644
@@ -238,8 +238,35 @@ struct ice_aqc_get_sw_cfg_resp {
  * Free Resources command (indirect 0x0209)
  * Get Allocated Resource Descriptors Command (indirect 0x020A)
  */
+#define ICE_AQC_RES_TYPE_VEB_COUNTER			0x00
+#define ICE_AQC_RES_TYPE_VLAN_COUNTER			0x01
+#define ICE_AQC_RES_TYPE_MIRROR_RULE			0x02
 #define ICE_AQC_RES_TYPE_VSI_LIST_REP			0x03
 #define ICE_AQC_RES_TYPE_VSI_LIST_PRUNE			0x04
+#define ICE_AQC_RES_TYPE_RECIPE				0x05
+#define ICE_AQC_RES_TYPE_PROFILE			0x06
+#define ICE_AQC_RES_TYPE_SWID				0x07
+#define ICE_AQC_RES_TYPE_VSI				0x08
+#define ICE_AQC_RES_TYPE_FLU				0x09
+#define ICE_AQC_RES_TYPE_WIDE_TABLE_1			0x0A
+#define ICE_AQC_RES_TYPE_WIDE_TABLE_2			0x0B
+#define ICE_AQC_RES_TYPE_WIDE_TABLE_4			0x0C
+#define ICE_AQC_RES_TYPE_GLOBAL_RSS_HASH		0x20
+#define ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK		0x21
+#define ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES	0x22
+#define ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES		0x23
+#define ICE_AQC_RES_TYPE_FLEX_DESC_PROG			0x30
+#define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_PROFID	0x48
+#define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_TCAM		0x49
+#define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_PROFID		0x50
+#define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_TCAM		0x51
+#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_PROFID		0x58
+#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_TCAM		0x59
+#define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_PROFID		0x60
+#define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_TCAM		0x61
+/* Resource types 0x62-67 are reserved for Hash profile builder */
+#define ICE_AQC_RES_TYPE_QHASH_PROF_BLDR_PROFID		0x68
+#define ICE_AQC_RES_TYPE_QHASH_PROF_BLDR_TCAM		0x69
 
 #define ICE_AQC_RES_TYPE_FLAG_SHARED			BIT(7)
 #define ICE_AQC_RES_TYPE_FLAG_SCAN_BOTTOM		BIT(12)
drivers/net/ice/base/ice_common.c +71 -0

77 lines not on this page · raw message

drivers/net/ice/base/ice_common.h +4 -0
index 0197fbfe3..45d93eb64 100644
@@ -32,6 +32,10 @@ ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res,
 		enum ice_aq_res_access_type access, u32 timeout);
 void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res);
 enum ice_status
+ice_alloc_hw_res(struct ice_hw *hw, u16 type, u16 num, bool sh, u16 *res);
+enum ice_status
+ice_free_hw_res(struct ice_hw *hw, u16 type, u16 num, u16 *res);
+enum ice_status
 ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries,
 		      struct ice_aqc_alloc_free_res_elem *buf, u16 buf_size,
 		      enum ice_adminq_opc opc, struct ice_sq_cd *cd);
Signature · 1 line
2.13.6
author
#15 lore raw

PATCH v2 3/7 net/ice/base: add package download related data structure

In reply to Qi Zhang

As title.

---
 drivers/net/ice/base/ice_adminq_cmd.h | 58 +++++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_type.h       |  1 -
 2 files changed, 58 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_adminq_cmd.h +58 -0
index 3003efd55..a1b9edd14 100644
@@ -1576,6 +1576,57 @@ struct ice_aqc_move_txqs_data {
 
 
 
+/* Download Package (indirect 0x0C40) */
+/* Also used for Update Package (indirect 0x0C42) */
+struct ice_aqc_download_pkg {
+	u8 flags;
+#define ICE_AQC_DOWNLOAD_PKG_LAST_BUF	0x01
+	u8 reserved[3];
+	__le32 reserved1;
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
+struct ice_aqc_download_pkg_resp {
+	__le32 error_offset;
+	__le32 error_info;
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
+/* Get Package Info List (indirect 0x0C43) */
+struct ice_aqc_get_pkg_info_list {
+	__le32 reserved1;
+	__le32 reserved2;
+	__le32 addr_high;
+	__le32 addr_low;
+};
+
+/* Version format for packages */
+struct ice_pkg_ver {
+	u8 major;
+	u8 minor;
+	u8 update;
+	u8 draft;
+};
+
+#define ICE_PKG_NAME_SIZE	32
+
+struct ice_aqc_get_pkg_info {
+	struct ice_pkg_ver ver;
+	char name[ICE_PKG_NAME_SIZE];
+	u8 is_in_nvm;
+	u8 is_active;
+	u8 is_active_at_boot;
+	u8 is_modified;
+};
+
+/* Get Package Info List response buffer format (0x0C43) */
+struct ice_aqc_get_pkg_info_resp {
+	__le32 count;
+	struct ice_aqc_get_pkg_info pkg_info[1];
+};
+
 
 
 
@@ -1726,6 +1777,8 @@ struct ice_aq_desc {
 		struct ice_aqc_txqs_cleanup txqs_cleanup;
 		struct ice_aqc_add_get_update_free_vsi vsi_cmd;
 		struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res;
+		struct ice_aqc_download_pkg download_pkg;
+		struct ice_aqc_get_pkg_info_list get_pkg_info_list;
 		struct ice_aqc_fw_logging fw_logging;
 		struct ice_aqc_get_clear_fw_log get_clear_fw_log;
 		struct ice_aqc_set_mac_lb set_mac_lb;
@@ -1903,6 +1956,11 @@ enum ice_adminq_opc {
 	ice_aqc_opc_txqs_cleanup			= 0x0C31,
 	ice_aqc_opc_move_recfg_txqs			= 0x0C32,
 
+	/* package commands */
+	ice_aqc_opc_download_pkg			= 0x0C40,
+	ice_aqc_opc_upload_section			= 0x0C41,
+	ice_aqc_opc_update_pkg				= 0x0C42,
+	ice_aqc_opc_get_pkg_info_list			= 0x0C43,
 
 
 
drivers/net/ice/base/ice_type.h +0 -1
index 256bf3f37..d7c12d172 100644
@@ -704,7 +704,6 @@ struct ice_hw {
 
 	u8 ucast_shared;	/* true if VSIs can share unicast addr */
 
-
 };
 
 /* Statistics collected by each port, VSI, VEB, and S-channel */
Signature · 1 line
2.13.6
author
#16 lore raw

PATCH v2 4/7 net/ice/base: add some help macros

In reply to Qi Zhang

As title.

---
 drivers/net/ice/base/ice_common.h | 10 ++++++++++
 drivers/net/ice/base/ice_osdep.h  |  2 ++
 2 files changed, 12 insertions(+)
drivers/net/ice/base/ice_common.h +10 -0
index 45d93eb64..67539ccb7 100644
@@ -51,6 +51,16 @@ void ice_clear_pxe_mode(struct ice_hw *hw);
 
 enum ice_status ice_get_caps(struct ice_hw *hw);
 
+/* Define a macro that will align a pointer to point to the next memory address
+ * that falls on the given power of 2 (i.e., 2, 4, 8, 16, 32, 64...). For
+ * example, given the variable pointer = 0x1006, then after the following call:
+ *
+ *      pointer = ICE_ALIGN(pointer, 4)
+ *
+ * ... the value of pointer would equal 0x1008, since 0x1008 is the next
+ * address after 0x1006 which is divisible by 4.
+ */
+#define ICE_ALIGN(ptr, align)   (((ptr) + ((align) - 1)) & ~((align) - 1))
 
 
 enum ice_status
drivers/net/ice/base/ice_osdep.h +2 -0
index a3351c034..252c8f4e7 100644
@@ -457,6 +457,8 @@ LIST_HEAD(ice_list_head, ice_list_entry);
 
 /*Note parameters are swapped*/
 #define LIST_FIRST_ENTRY(head, type, field) (type *)((head)->lh_first)
+#define LIST_NEXT_ENTRY(entry, type, field) \
+	((type *)(entry)->field.next.le_next)
 #define LIST_ADD(entry, list_head)    LIST_INSERT_HEAD(list_head, entry, next)
 #define LIST_ADD_AFTER(entry, list_entry) \
 	LIST_INSERT_AFTER(list_entry, entry, next)
Signature · 1 line
2.13.6
author
#17 lore raw

PATCH v2 5/7 net/ice/base: add flexible pipeline module

In reply to Qi Zhang

The flexible pipeline module provide the intrastructure for ice's flexible packet processing feature.

---
 drivers/net/ice/Makefile             |    1 +
 drivers/net/ice/base/ice_flex_pipe.c | 5018 ++++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_flex_pipe.h |  107 +
 drivers/net/ice/base/ice_flex_type.h |  686 +++++
 drivers/net/ice/base/ice_type.h      |   36 +
 drivers/net/ice/base/meson.build     |    1 +
 6 files changed, 5849 insertions(+)
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.c
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.h
drivers/net/ice/Makefile +1 -0
index 4b421cde3..1bb76efc2 100644
@@ -49,6 +49,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_common.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_sched.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_switch.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_nvm.c
+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_flex_pipe.c
 
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_rxtx.c
drivers/net/ice/base/ice_flex_pipe.c new file +5018 -0

2,993 lines not on this page · raw message

drivers/net/ice/base/ice_flex_pipe.h new file +107 -0

107 lines not on this page · raw message

drivers/net/ice/base/ice_flex_type.h +686 -0

686 lines not on this page · raw message

drivers/net/ice/base/ice_type.h +36 -0
index d7c12d172..17d79ba21 100644

Lines of this file are not shown. View the raw message.

drivers/net/ice/base/meson.build +1 -0
index 0cfc8cd67..77a9802f4 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.13.6

Part of the diff is not shown here. View the raw message.

author
#18 lore raw

PATCH v2 6/7 net/ice/base: add flow module

In reply to Qi Zhang

Add the module that implemented flow abstraction that base on flexible pipeline.

---
 drivers/net/ice/Makefile          |    1 +
 drivers/net/ice/base/ice_common.h |    1 +
 drivers/net/ice/base/ice_flow.c   | 2080 +++++++++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_flow.h   |  337 ++++++
 drivers/net/ice/base/meson.build  |    1 +
 5 files changed, 2420 insertions(+)
 create mode 100644 drivers/net/ice/base/ice_flow.c
drivers/net/ice/Makefile +1 -0
index 1bb76efc2..61846cae2 100644
@@ -50,6 +50,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_sched.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_switch.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_nvm.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_flex_pipe.c
+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_flow.c
 
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_rxtx.c
drivers/net/ice/base/ice_common.h +1 -0
index 67539ccb7..5ac991ef2 100644
@@ -7,6 +7,7 @@
 
 #include "ice_type.h"
 
+#include "ice_flex_pipe.h"
 #include "ice_switch.h"
 
 enum ice_status ice_nvm_validate_checksum(struct ice_hw *hw);
drivers/net/ice/base/ice_flow.c new file +2080 -0

2,080 lines not on this page · raw message

drivers/net/ice/base/ice_flow.h +337 -0

341 lines not on this page · raw message

drivers/net/ice/base/meson.build +1 -0
index 77a9802f4..d7f8536bc 100644
@@ -8,6 +8,7 @@ sources = [
 	'ice_switch.c',
 	'ice_nvm.c',
 	'ice_flex_pipe.c',
+	'ice_flow.c',
 ]
 
 error_cflags = ['-Wno-unused-value',
Signature · 1 line
2.13.6
author
#19 lore raw

PATCH v2 7/7 net/ice/base: free flow profile entries

In reply to Qi Zhang

Free flow profile entries when free hw tables.

---
 drivers/net/ice/base/ice_flex_pipe.c | 38 ++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
drivers/net/ice/base/ice_flex_pipe.c +38 -0
index 1887fc38c..493bc4e9b 100644
@@ -3034,6 +3034,42 @@ static void ice_fill_blk_tbls(struct ice_hw *hw, enum ice_block block_id)
 }
 
 /**
+ * ice_free_flow_profs - free flow profile entries
+ * @hw: pointer to the hardware structure
+ */
+static void ice_free_flow_profs(struct ice_hw *hw)
+{
+	u8 i;
+
+	for (i = 0; i < ICE_BLK_COUNT; i++) {
+		struct ice_flow_prof *p, *tmp;
+
+		if (!&hw->fl_profs[i])
+			continue;
+
+		/* This call is being made as part of resource deallocation
+		 * during unload. Lock acquire and release will not be
+		 * necessary here.
+		 */
+		LIST_FOR_EACH_ENTRY_SAFE(p, tmp, &hw->fl_profs[i],
+					 ice_flow_prof, l_entry) {
+			struct ice_flow_entry *e, *t;
+
+			LIST_FOR_EACH_ENTRY_SAFE(e, t, &p->entries,
+						 ice_flow_entry, l_entry)
+				ice_flow_rem_entry(hw, ICE_FLOW_ENTRY_HNDL(e));
+
+			LIST_DEL(&p->l_entry);
+			if (p->acts)
+				ice_free(hw, p->acts);
+			ice_free(hw, p);
+		}
+
+		ice_destroy_lock(&hw->fl_profs_locks[i]);
+	}
+}
+
+/**
  * ice_free_prof_map - frees the profile map
  * @hw: pointer to the hardware structure
  * @blk: the hw block which contains the profile map to be freed
@@ -3096,6 +3132,8 @@ void ice_free_hw_tbls(struct ice_hw *hw)
 	}
 
 	ice_memset(hw->blk, 0, sizeof(hw->blk), ICE_NONDMA_MEM);
+
+	ice_free_flow_profs(hw);
 }
 
 /**
Signature · 1 line
2.13.6
author Applied
#20 lore raw
In reply to Qi Zhang
Quoted 53 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Wednesday, January 16, 2019 10:14 PM
To: Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>
Cc: Stillwell Jr, Paul M <[email protected]>; [email protected]; Yigit, Ferruh <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: [PATCH v2 0/7] net/ice: update share code

For ice family NICs, package processing pipe line can be configured in a package file should be downloaded into device by driver during init.
The patch set add necessary share code APIs to support package download. Also some code clean is included.

Though package download will not be enabled in 19.02 as plan, but we hope the share code part could be merged early.

Meanwhile we will submit a seperate RFC patch for package download for customer early evelutation.

v2:
- fix 32 bit compile error.
- fix check patch warning.

Qi Zhang (7):
net/ice/base: code clean
net/ice/base: add API to support resource allocate net/ice/base: add package download related data structure net/ice/base: add some help macros
net/ice/base: add flexible pipeline module net/ice/base: add flow module
net/ice/base: free flow profile entries

 drivers/net/ice/Makefile              |    2 +
 drivers/net/ice/base/ice_adminq_cmd.h |   85 +
 drivers/net/ice/base/ice_common.c     |   85 +-
 drivers/net/ice/base/ice_common.h     |   32 +-
 drivers/net/ice/base/ice_controlq.c   |    2 +-
 drivers/net/ice/base/ice_flex_pipe.c  | 5056
+++++++++++++++++++++++++++++++++  drivers/net/ice/base/ice_flex_pipe.h
|  107 +  drivers/net/ice/base/ice_flex_type.h  |  685 +++++
 drivers/net/ice/base/ice_flow.c       | 2080 ++++++++++++++
 drivers/net/ice/base/ice_flow.h       |  337 +++
 drivers/net/ice/base/ice_osdep.h      |    2 +
 drivers/net/ice/base/ice_type.h       |   37 +-
 drivers/net/ice/base/meson.build      |    2 +
 13 files changed, 8479 insertions(+), 33 deletions(-)  create mode 100644
drivers/net/ice/base/ice_flex_pipe.c
 create mode 100644 drivers/net/ice/base/ice_flex_pipe.h
 create mode 100644 drivers/net/ice/base/ice_flow.c
Quoted 2 lines

--
2.13.6

Applied to dpdk-next-net-intel.

Thanks
Qi