acl: introduce a macro for bitmask conversion
[dpdk.git] / lib / librte_acl / rte_acl.h
index 30aea03..bd8f892 100644 (file)
@@ -115,13 +115,16 @@ struct rte_acl_field {
 
 enum {
        RTE_ACL_TYPE_SHIFT = 29,
-       RTE_ACL_MAX_INDEX = LEN2MASK(RTE_ACL_TYPE_SHIFT),
+       RTE_ACL_MAX_INDEX = RTE_LEN2MASK(RTE_ACL_TYPE_SHIFT, uint32_t),
        RTE_ACL_MAX_PRIORITY = RTE_ACL_MAX_INDEX,
        RTE_ACL_MIN_PRIORITY = 0,
 };
 
 #define        RTE_ACL_INVALID_USERDATA        0
 
+#define        RTE_ACL_MASKLEN_TO_BITMASK(v, s)        \
+((v) == 0 ? (v) : (typeof(v))((uint64_t)-1 << ((s) * CHAR_BIT - (v))))
+
 /**
  * Miscellaneous data for ACL rule.
  */
@@ -170,7 +173,6 @@ struct rte_acl_param {
  *   Pointer to ACL context structure that is used in future ACL
  *   operations, or NULL on error, with error code set in rte_errno.
  *   Possible rte_errno errors include:
- *   - E_RTE_NO_TAILQ - no tailq list could be got for the ACL context list
  *   - EINVAL - invalid parameter passed to function
  */
 struct rte_acl_ctx *