net/ice/base: add functions to get allocated resources
[dpdk.git] / drivers / net / ice / base / ice_type.h
index 08c9740..25d6447 100644 (file)
@@ -18,6 +18,9 @@
 #define ICE_BYTES_PER_DWORD    4
 #define ICE_MAX_TRAFFIC_CLASS  8
 
+#ifndef MIN_T
+#define MIN_T(_t, _a, _b)      min((_t)(_a), (_t)(_b))
+#endif
 
 #include "ice_status.h"
 #include "ice_hw_autogen.h"
@@ -379,6 +382,10 @@ struct ice_nvm_info {
 
 /* Max number of port to queue branches w.r.t topology */
 #define ICE_TXSCHED_MAX_BRANCHES ICE_MAX_TRAFFIC_CLASS
+
+#define ice_for_each_traffic_class(_i) \
+       for ((_i) = 0; (_i) < ICE_MAX_TRAFFIC_CLASS; (_i)++)
+
 /* ICE_DFLT_AGG_ID means that all new VM(s)/VSI node connects
  * to driver defined policy for default aggregator
  */
@@ -721,16 +728,11 @@ struct ice_hw {
 
        /* Pointer to allocated copy of pkg memory */
        u8 *pkg_copy;
+       u32 pkg_size;
 
        /* tunneling info */
        struct ice_tunnel_table tnl;
 
-       /* PTYPE group and XLT1 management */
-#define ICE_MAX_PTGS   256
-       struct ice_ptg_entry ptg_tbl[ICE_BLK_COUNT][ICE_MAX_PTGS];
-
-#define ICE_XLT1_CNT   1024
-       struct ice_ptg_ptype xlt1_tbl[ICE_BLK_COUNT][ICE_XLT1_CNT];
 #define ICE_PKG_FILENAME       "package_file"
 #define ICE_PKG_FILENAME_EXT   "pkg"
 #define ICE_PKG_FILE_MAJ_VER   1