net: flow_dissector: Use 64bits for used_keys
authorRatheesh Kannoth <rkannoth@marvell.com>
Fri, 28 Jul 2023 23:22:15 +0000 (04:52 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Jul 2023 08:11:24 +0000 (09:11 +0100)
As 32bits of dissector->used_keys are exhausted,
increase the size to 64bits.

This is base change for ESP/AH flow dissector patch.
Please find patch and discussions at
https://lore.kernel.org/netdev/ZMDNjD46BvZ5zp5I@corigine.com/T/#t

Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw
Tested-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
34 files changed:
drivers/net/dsa/ocelot/felix_vsc9959.c
drivers/net/dsa/sja1105/sja1105_flower.c
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c
drivers/net/ethernet/freescale/enetc/enetc_qos.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/iavf/iavf_main.c
drivers/net/ethernet/intel/ice/ice_tc_lib.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c
drivers/net/ethernet/marvell/prestera/prestera_flower.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
drivers/net/ethernet/microchip/vcap/vcap_tc.c
drivers/net/ethernet/microchip/vcap/vcap_tc.h
drivers/net/ethernet/mscc/ocelot_flower.c
drivers/net/ethernet/netronome/nfp/flower/conntrack.c
drivers/net/ethernet/netronome/nfp/flower/offload.c
drivers/net/ethernet/qlogic/qede/qede_filter.c
drivers/net/ethernet/sfc/tc.c
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
drivers/net/ethernet/ti/am65-cpsw-qos.c
drivers/net/ethernet/ti/cpsw_priv.c
include/net/flow_dissector.h
net/core/flow_dissector.c
net/ethtool/ioctl.c
net/netfilter/nf_flow_table_offload.c
net/netfilter/nf_tables_offload.c
net/netfilter/nft_cmp.c

index dce3548..4a6e529 100644 (file)
@@ -1746,10 +1746,10 @@ static int vsc9959_stream_identify(struct flow_cls_offload *f,
        struct flow_dissector *dissector = rule->match.dissector;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS)))
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS)))
                return -EOPNOTSUPP;
 
        if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) {
index fad5afe..9e8ca18 100644 (file)
@@ -205,10 +205,10 @@ static int sja1105_flower_parse_key(struct sja1105_private *priv,
        u16 pcp = U16_MAX;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
                NL_SET_ERR_MSG_MOD(extack,
                                   "Unsupported keys used");
                return -EOPNOTSUPP;
index d8afcf8..38d89d8 100644 (file)
@@ -373,9 +373,9 @@ static int bnxt_tc_parse_flow(struct bnxt *bp,
        struct flow_dissector *dissector = rule->match.dissector;
 
        /* KEY_CONTROL and KEY_BASIC are needed for forming a meaningful key */
-       if ((dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_CONTROL)) == 0 ||
-           (dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_BASIC)) == 0) {
-               netdev_info(bp->dev, "cannot form TC key: used_keys = 0x%x\n",
+       if ((dissector->used_keys & BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL)) == 0 ||
+           (dissector->used_keys & BIT_ULL(FLOW_DISSECTOR_KEY_BASIC)) == 0) {
+               netdev_info(bp->dev, "cannot form TC key: used_keys = 0x%llx\n",
                            dissector->used_keys);
                return -EOPNOTSUPP;
        }
index d354115..72ac4a3 100644 (file)
@@ -313,15 +313,15 @@ static int cxgb4_validate_flow_match(struct net_device *dev,
        u16 ethtype_key = 0;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IP))) {
-               netdev_warn(dev, "Unsupported key used: 0x%x\n",
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IP))) {
+               netdev_warn(dev, "Unsupported key used: 0x%llx\n",
                            dissector->used_keys);
                return -EOPNOTSUPP;
        }
index c39b866..4798fb7 100644 (file)
@@ -17,14 +17,14 @@ static int dpaa2_switch_flower_parse_key(struct flow_cls_offload *cls,
        struct dpsw_acl_fields *acl_h, *acl_m;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_IP) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS))) {
                NL_SET_ERR_MSG_MOD(extack,
                                   "Unsupported keys used");
                return -EOPNOTSUPP;
@@ -539,9 +539,9 @@ static int dpaa2_switch_flower_parse_mirror_key(struct flow_cls_offload *cls,
        int ret = -EOPNOTSUPP;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN))) {
                NL_SET_ERR_MSG_MOD(extack,
                                   "Mirroring is supported only per VLAN");
                return -EOPNOTSUPP;
index 270cbd5..2513b44 100644 (file)
@@ -483,13 +483,13 @@ struct enetc_psfp {
 static struct actions_fwd enetc_act_fwd[] = {
        {
                BIT(FLOW_ACTION_GATE),
-               BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS),
+               BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS),
                FILTER_ACTION_TYPE_PSFP
        },
        {
                BIT(FLOW_ACTION_POLICE) |
                BIT(FLOW_ACTION_GATE),
-               BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS),
+               BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS),
                FILTER_ACTION_TYPE_PSFP
        },
        /* example for ACL actions */
@@ -1069,8 +1069,8 @@ revert_sid:
        return err;
 }
 
-static struct actions_fwd *enetc_check_flow_actions(u64 acts,
-                                                   unsigned int inputkeys)
+static struct actions_fwd *
+enetc_check_flow_actions(u64 acts, unsigned long long inputkeys)
 {
        int i;
 
index bf675c1..83ab89f 100644 (file)
@@ -7315,14 +7315,14 @@ static int hclge_parse_cls_flower(struct hclge_dev *hdev,
        struct flow_dissector *dissector = flow->match.dissector;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS))) {
-               dev_err(&hdev->pdev->dev, "unsupported key set: %#x\n",
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS))) {
+               dev_err(&hdev->pdev->dev, "unsupported key set: %#llx\n",
                        dissector->used_keys);
                return -EOPNOTSUPP;
        }
index 982ae70..3d0d697 100644 (file)
@@ -8525,15 +8525,15 @@ static int i40e_parse_cls_flower(struct i40e_vsi *vsi,
        u8 field_flags = 0;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_KEYID))) {
-               dev_err(&pf->pdev->dev, "Unsupported key used: 0x%x\n",
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID))) {
+               dev_err(&pf->pdev->dev, "Unsupported key used: 0x%llx\n",
                        dissector->used_keys);
                return -EOPNOTSUPP;
        }
index 9610ca7..7b300c8 100644 (file)
@@ -3744,15 +3744,15 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
        struct virtchnl_filter *vf = &filter->f;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_KEYID))) {
-               dev_err(&adapter->pdev->dev, "Unsupported key used: 0x%x\n",
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID))) {
+               dev_err(&adapter->pdev->dev, "Unsupported key used: 0x%llx\n",
                        dissector->used_keys);
                return -EOPNOTSUPP;
        }
index 4a34ef5..38547db 100644 (file)
@@ -1343,24 +1343,24 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
        dissector = rule->match.dissector;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_CVLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_OPTS) |
-             BIT(FLOW_DISSECTOR_KEY_IP) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IP) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_PPPOE) |
-             BIT(FLOW_DISSECTOR_KEY_L2TPV3))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CVLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_OPTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PPPOE) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_L2TPV3))) {
                NL_SET_ERR_MSG_MOD(fltr->extack, "Unsupported key used");
                return -EOPNOTSUPP;
        }
@@ -1382,10 +1382,10 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
                 */
                headers = &fltr->inner_headers;
        } else if (dissector->used_keys &
-                 (BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
-                  BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
-                  BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) |
-                  BIT(FLOW_DISSECTOR_KEY_ENC_PORTS))) {
+                 (BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
+                  BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
+                  BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
+                  BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS))) {
                NL_SET_ERR_MSG_MOD(fltr->extack, "Tunnel key used, but device isn't a tunnel");
                return -EOPNOTSUPP;
        } else {
index 9a25614..9f63a10 100644 (file)
@@ -2615,10 +2615,10 @@ static int igb_parse_cls_flower(struct igb_adapter *adapter,
        struct netlink_ext_ack *extack = f->common.extack;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN))) {
                NL_SET_ERR_MSG_MOD(extack,
                                   "Unsupported key used, only BASIC, CONTROL, ETH_ADDRS and VLAN are supported");
                return -EOPNOTSUPP;
index 0915a01..5a44e9b 100644 (file)
@@ -454,15 +454,15 @@ static int otx2_tc_prepare_flow(struct otx2_nic *nic, struct otx2_tc_flow *node,
        dissector = rule->match.dissector;
 
        if ((dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_IP))))  {
-               netdev_info(nic->netdev, "unsupported flow used key 0x%x",
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IP))))  {
+               netdev_info(nic->netdev, "unsupported flow used key 0x%llx",
                            dissector->used_keys);
                return -EOPNOTSUPP;
        }
index 3e20e71..8b9455d 100644 (file)
@@ -202,16 +202,16 @@ static int prestera_flower_parse(struct prestera_flow_block *block,
        int err;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_META) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ICMP) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS_RANGE) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_META) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ICMP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS_RANGE) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN))) {
                NL_SET_ERR_MSG_MOD(f->common.extack, "Unsupported key");
                return -EOPNOTSUPP;
        }
index 2b80fe7..8c531f4 100644 (file)
@@ -221,16 +221,21 @@ mlx5_ct_fs_smfs_destroy(struct mlx5_ct_fs *fs)
 }
 
 static inline bool
-mlx5_tc_ct_valid_used_dissector_keys(const u32 used_keys)
+mlx5_tc_ct_valid_used_dissector_keys(const u64 used_keys)
 {
-#define DISS_BIT(name) BIT(FLOW_DISSECTOR_KEY_ ## name)
-       const u32 basic_keys = DISS_BIT(BASIC) | DISS_BIT(CONTROL) | DISS_BIT(META);
-       const u32 ipv4_tcp = basic_keys | DISS_BIT(IPV4_ADDRS) | DISS_BIT(PORTS) | DISS_BIT(TCP);
-       const u32 ipv6_tcp = basic_keys | DISS_BIT(IPV6_ADDRS) | DISS_BIT(PORTS) | DISS_BIT(TCP);
-       const u32 ipv4_udp = basic_keys | DISS_BIT(IPV4_ADDRS) | DISS_BIT(PORTS);
-       const u32 ipv6_udp = basic_keys | DISS_BIT(IPV6_ADDRS) | DISS_BIT(PORTS);
-       const u32 ipv4_gre = basic_keys | DISS_BIT(IPV4_ADDRS);
-       const u32 ipv6_gre = basic_keys | DISS_BIT(IPV6_ADDRS);
+#define DISS_BIT(name) BIT_ULL(FLOW_DISSECTOR_KEY_ ## name)
+       const u64 basic_keys = DISS_BIT(BASIC) | DISS_BIT(CONTROL) |
+                               DISS_BIT(META);
+       const u64 ipv4_tcp = basic_keys | DISS_BIT(IPV4_ADDRS) |
+                               DISS_BIT(PORTS) | DISS_BIT(TCP);
+       const u64 ipv6_tcp = basic_keys | DISS_BIT(IPV6_ADDRS) |
+                               DISS_BIT(PORTS) | DISS_BIT(TCP);
+       const u64 ipv4_udp = basic_keys | DISS_BIT(IPV4_ADDRS) |
+                               DISS_BIT(PORTS);
+       const u64 ipv6_udp = basic_keys | DISS_BIT(IPV6_ADDRS) |
+                                DISS_BIT(PORTS);
+       const u64 ipv4_gre = basic_keys | DISS_BIT(IPV4_ADDRS);
+       const u64 ipv6_gre = basic_keys | DISS_BIT(IPV6_ADDRS);
 
        return (used_keys == ipv4_tcp || used_keys == ipv4_udp || used_keys == ipv6_tcp ||
                used_keys == ipv6_udp || used_keys == ipv4_gre || used_keys == ipv6_gre);
@@ -247,7 +252,7 @@ mlx5_ct_fs_smfs_ct_validate_flow_rule(struct mlx5_ct_fs *fs, struct flow_rule *f
        struct flow_match_tcp tcp;
 
        if (!mlx5_tc_ct_valid_used_dissector_keys(flow_rule->match.dissector->used_keys)) {
-               ct_dbg("rule uses unexpected dissectors (0x%08x)",
+               ct_dbg("rule uses unexpected dissectors (0x%016llx)",
                       flow_rule->match.dissector->used_keys);
                return false;
        }
index 507825a..dfd2823 100644 (file)
@@ -2590,29 +2590,29 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
        match_level = outer_match_level;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_META) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_CVLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_TCP) |
-             BIT(FLOW_DISSECTOR_KEY_IP)  |
-             BIT(FLOW_DISSECTOR_KEY_CT) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IP) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_OPTS) |
-             BIT(FLOW_DISSECTOR_KEY_ICMP) |
-             BIT(FLOW_DISSECTOR_KEY_MPLS))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_META) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CVLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS)     |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_TCP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IP)  |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CT) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_OPTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ICMP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_MPLS))) {
                NL_SET_ERR_MSG_MOD(extack, "Unsupported key");
-               netdev_dbg(priv->netdev, "Unsupported key used: 0x%x\n",
+               netdev_dbg(priv->netdev, "Unsupported key used: 0x%llx\n",
                           dissector->used_keys);
                return -EOPNOTSUPP;
        }
index 8329100..af3f57d 100644 (file)
@@ -558,17 +558,17 @@ static int mlxsw_sp_flower_parse(struct mlxsw_sp *mlxsw_sp,
        int err;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_META) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS_RANGE) |
-             BIT(FLOW_DISSECTOR_KEY_TCP) |
-             BIT(FLOW_DISSECTOR_KEY_IP) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_META) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS_RANGE) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_TCP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN))) {
                dev_err(mlxsw_sp->bus_info->dev, "Unsupported key\n");
                NL_SET_ERR_MSG_MOD(f->common.extack, "Unsupported key");
                return -EOPNOTSUPP;
index 96b3def..d696cf9 100644 (file)
@@ -75,7 +75,7 @@ lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st)
                        goto out;
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_CONTROL);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL);
 
        return err;
 
@@ -172,7 +172,7 @@ lan966x_tc_flower_handler_basic_usage(struct vcap_tc_flower_parse_usage *st)
                }
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_BASIC);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_BASIC);
        return err;
 out:
        NL_SET_ERR_MSG_MOD(st->fco->common.extack, "ip_proto parse error");
index 3f87a52..906299a 100644 (file)
@@ -126,7 +126,7 @@ sparx5_tc_flower_handler_basic_usage(struct vcap_tc_flower_parse_usage *st)
                }
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_BASIC);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_BASIC);
 
        return err;
 
@@ -175,7 +175,7 @@ sparx5_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st)
                        goto out;
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_CONTROL);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL);
 
        return err;
 
index 09abe79..27e2dff 100644 (file)
@@ -50,7 +50,7 @@ int vcap_tc_flower_handler_ethaddr_usage(struct vcap_tc_flower_parse_usage *st)
                        goto out;
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS);
 
        return err;
 
@@ -86,7 +86,7 @@ int vcap_tc_flower_handler_ipv4_usage(struct vcap_tc_flower_parse_usage *st)
                }
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS);
 
        return err;
 
@@ -124,7 +124,7 @@ int vcap_tc_flower_handler_ipv6_usage(struct vcap_tc_flower_parse_usage *st)
                                goto out;
                }
        }
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS);
        return err;
 out:
        NL_SET_ERR_MSG_MOD(st->fco->common.extack, "ipv6_addr parse error");
@@ -158,7 +158,7 @@ int vcap_tc_flower_handler_portnum_usage(struct vcap_tc_flower_parse_usage *st)
                        goto out;
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_PORTS);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_PORTS);
 
        return err;
 
@@ -201,7 +201,7 @@ int vcap_tc_flower_handler_cvlan_usage(struct vcap_tc_flower_parse_usage *st)
                        goto out;
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_CVLAN);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CVLAN);
 
        return 0;
 out:
@@ -238,7 +238,7 @@ int vcap_tc_flower_handler_vlan_usage(struct vcap_tc_flower_parse_usage *st,
        if (mt.mask->vlan_tpid)
                st->tpid = be16_to_cpu(mt.key->vlan_tpid);
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_VLAN);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_VLAN);
 
        return 0;
 out:
@@ -313,7 +313,7 @@ int vcap_tc_flower_handler_tcp_usage(struct vcap_tc_flower_parse_usage *st)
                        goto out;
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_TCP);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_TCP);
 
        return err;
 
@@ -376,7 +376,7 @@ int vcap_tc_flower_handler_arp_usage(struct vcap_tc_flower_parse_usage *st)
                        goto out;
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_ARP);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_ARP);
 
        return 0;
 
@@ -401,7 +401,7 @@ int vcap_tc_flower_handler_ip_usage(struct vcap_tc_flower_parse_usage *st)
                        goto out;
        }
 
-       st->used_keys |= BIT(FLOW_DISSECTOR_KEY_IP);
+       st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_IP);
 
        return err;
 
index 071f892..49b02d0 100644 (file)
@@ -14,7 +14,7 @@ struct vcap_tc_flower_parse_usage {
        u16 l3_proto;
        u8 l4_proto;
        u16 tpid;
-       unsigned int used_keys;
+       unsigned long long used_keys;
 };
 
 int vcap_tc_flower_handler_ethaddr_usage(struct vcap_tc_flower_parse_usage *st);
index e0916af..33b438c 100644 (file)
@@ -581,14 +581,14 @@ ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress,
        int ret;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_META) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_META) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
                return -EOPNOTSUPP;
        }
 
@@ -641,12 +641,12 @@ ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress,
                 * then just bail out
                 */
                if ((dissector->used_keys &
-                   (BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-                    BIT(FLOW_DISSECTOR_KEY_BASIC) |
-                    BIT(FLOW_DISSECTOR_KEY_CONTROL))) !=
-                   (BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-                    BIT(FLOW_DISSECTOR_KEY_BASIC) |
-                    BIT(FLOW_DISSECTOR_KEY_CONTROL)))
+                   (BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL))) !=
+                   (BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL)))
                        return -EOPNOTSUPP;
 
                flow_rule_match_eth_addrs(rule, &match);
index 7303217..2643c4b 100644 (file)
@@ -61,7 +61,7 @@ bool is_pre_ct_flow(struct flow_cls_offload *flow)
        struct flow_match_ct ct;
        int i;
 
-       if (dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_CT)) {
+       if (dissector->used_keys & BIT_ULL(FLOW_DISSECTOR_KEY_CT)) {
                flow_rule_match_ct(rule, &ct);
                if (ct.key->ct_state)
                        return false;
@@ -94,7 +94,7 @@ bool is_post_ct_flow(struct flow_cls_offload *flow)
        struct flow_match_ct ct;
        int i;
 
-       if (dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_CT)) {
+       if (dissector->used_keys & BIT_ULL(FLOW_DISSECTOR_KEY_CT)) {
                flow_rule_match_ct(rule, &ct);
                if (ct.key->ct_state & TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED)
                        return true;
@@ -236,10 +236,11 @@ static bool nfp_ct_merge_check_cannot_skip(struct nfp_fl_ct_flow_entry *entry1,
 static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                              struct nfp_fl_ct_flow_entry *entry2)
 {
-       unsigned int ovlp_keys = entry1->rule->match.dissector->used_keys &
-                                entry2->rule->match.dissector->used_keys;
+       unsigned long long ovlp_keys;
        bool out, is_v6 = false;
        u8 ip_proto = 0;
+       ovlp_keys = entry1->rule->match.dissector->used_keys &
+                       entry2->rule->match.dissector->used_keys;
        /* Temporary buffer for mangling keys, 64 is enough to cover max
         * struct size of key in various fields that may be mangled.
         * Supported fields to mangle:
@@ -257,7 +258,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
        /* Check the overlapped fields one by one, the unmasked part
         * should not conflict with each other.
         */
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_CONTROL)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL)) {
                struct flow_match_control match1, match2;
 
                flow_rule_match_control(entry1->rule, &match1);
@@ -267,7 +268,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_BASIC)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_BASIC)) {
                struct flow_match_basic match1, match2;
 
                flow_rule_match_basic(entry1->rule, &match1);
@@ -289,7 +290,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
         * will be do merge check when do nft and post ct merge,
         * so skip this ip merge check here.
         */
-       if ((ovlp_keys & BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS)) &&
+       if ((ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS)) &&
            nfp_ct_merge_check_cannot_skip(entry1, entry2)) {
                struct flow_match_ipv4_addrs match1, match2;
 
@@ -311,7 +312,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
         * will be do merge check when do nft and post ct merge,
         * so skip this ip merge check here.
         */
-       if ((ovlp_keys & BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS)) &&
+       if ((ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS)) &&
            nfp_ct_merge_check_cannot_skip(entry1, entry2)) {
                struct flow_match_ipv6_addrs match1, match2;
 
@@ -333,7 +334,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
         * will be do merge check when do nft and post ct merge,
         * so skip this tport merge check here.
         */
-       if ((ovlp_keys & BIT(FLOW_DISSECTOR_KEY_PORTS)) &&
+       if ((ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_PORTS)) &&
            nfp_ct_merge_check_cannot_skip(entry1, entry2)) {
                enum flow_action_mangle_base htype = FLOW_ACT_MANGLE_UNSPEC;
                struct flow_match_ports match1, match2;
@@ -355,7 +356,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS)) {
                struct flow_match_eth_addrs match1, match2;
 
                flow_rule_match_eth_addrs(entry1->rule, &match1);
@@ -371,7 +372,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_VLAN)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_VLAN)) {
                struct flow_match_vlan match1, match2;
 
                flow_rule_match_vlan(entry1->rule, &match1);
@@ -381,7 +382,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_MPLS)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_MPLS)) {
                struct flow_match_mpls match1, match2;
 
                flow_rule_match_mpls(entry1->rule, &match1);
@@ -391,7 +392,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_TCP)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_TCP)) {
                struct flow_match_tcp match1, match2;
 
                flow_rule_match_tcp(entry1->rule, &match1);
@@ -401,7 +402,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_IP)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_IP)) {
                struct flow_match_ip match1, match2;
 
                flow_rule_match_ip(entry1->rule, &match1);
@@ -413,7 +414,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_ENC_KEYID)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID)) {
                struct flow_match_enc_keyid match1, match2;
 
                flow_rule_match_enc_keyid(entry1->rule, &match1);
@@ -423,7 +424,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS)) {
                struct flow_match_ipv4_addrs match1, match2;
 
                flow_rule_match_enc_ipv4_addrs(entry1->rule, &match1);
@@ -433,7 +434,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS)) {
                struct flow_match_ipv6_addrs match1, match2;
 
                flow_rule_match_enc_ipv6_addrs(entry1->rule, &match1);
@@ -443,7 +444,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL)) {
                struct flow_match_control match1, match2;
 
                flow_rule_match_enc_control(entry1->rule, &match1);
@@ -453,7 +454,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_ENC_IP)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP)) {
                struct flow_match_ip match1, match2;
 
                flow_rule_match_enc_ip(entry1->rule, &match1);
@@ -463,7 +464,7 @@ static int nfp_ct_merge_check(struct nfp_fl_ct_flow_entry *entry1,
                        goto check_failed;
        }
 
-       if (ovlp_keys & BIT(FLOW_DISSECTOR_KEY_ENC_OPTS)) {
+       if (ovlp_keys & BIT_ULL(FLOW_DISSECTOR_KEY_ENC_OPTS)) {
                struct flow_match_enc_opts match1, match2;
 
                flow_rule_match_enc_opts(entry1->rule, &match1);
@@ -589,7 +590,7 @@ static int nfp_ct_check_meta(struct nfp_fl_ct_flow_entry *post_ct_entry,
        int i;
 
        ct_met = get_flow_act(nft_entry->rule, FLOW_ACTION_CT_METADATA);
-       if (ct_met && (dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_CT))) {
+       if (ct_met && (dissector->used_keys & BIT_ULL(FLOW_DISSECTOR_KEY_CT))) {
                u32 *act_lbl;
 
                act_lbl = ct_met->ct_metadata.labels;
index 18328eb..c153f05 100644 (file)
         FLOW_DIS_FIRST_FRAG)
 
 #define NFP_FLOWER_WHITELIST_DISSECTOR \
-       (BIT(FLOW_DISSECTOR_KEY_CONTROL) | \
-        BIT(FLOW_DISSECTOR_KEY_BASIC) | \
-        BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) | \
-        BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) | \
-        BIT(FLOW_DISSECTOR_KEY_TCP) | \
-        BIT(FLOW_DISSECTOR_KEY_PORTS) | \
-        BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) | \
-        BIT(FLOW_DISSECTOR_KEY_VLAN) | \
-        BIT(FLOW_DISSECTOR_KEY_CVLAN) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_PORTS) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_OPTS) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_IP) | \
-        BIT(FLOW_DISSECTOR_KEY_MPLS) | \
-        BIT(FLOW_DISSECTOR_KEY_CT) | \
-        BIT(FLOW_DISSECTOR_KEY_META) | \
-        BIT(FLOW_DISSECTOR_KEY_IP))
+       (BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_TCP) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_CVLAN) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_OPTS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_MPLS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_CT) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_META) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_IP))
 
 #define NFP_FLOWER_WHITELIST_TUN_DISSECTOR \
-       (BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_OPTS) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_PORTS) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_IP))
+       (BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_OPTS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP))
 
 #define NFP_FLOWER_WHITELIST_TUN_DISSECTOR_R \
-       (BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS))
+       (BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS))
 
 #define NFP_FLOWER_WHITELIST_TUN_DISSECTOR_V6_R \
-       (BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL) | \
-        BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS))
+       (BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL) | \
+        BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS))
 
 #define NFP_FLOWER_MERGE_FIELDS \
        (NFP_FLOWER_LAYER_PORT | \
@@ -1303,7 +1303,7 @@ static bool offload_pre_check(struct flow_cls_offload *flow)
        struct flow_dissector *dissector = rule->match.dissector;
        struct flow_match_ct ct;
 
-       if (dissector->used_keys & BIT(FLOW_DISSECTOR_KEY_CT)) {
+       if (dissector->used_keys & BIT_ULL(FLOW_DISSECTOR_KEY_CT)) {
                flow_rule_match_ct(rule, &ct);
                /* Allow special case where CT match is all 0 */
                if (memchr_inv(ct.key, 0, sizeof(*ct.key)))
index 3010833..a5ac21a 100644 (file)
@@ -1827,12 +1827,12 @@ qede_parse_flow_attr(struct qede_dev *edev, __be16 proto,
        memset(tuple, 0, sizeof(*tuple));
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS))) {
-               DP_NOTICE(edev, "Unsupported key set:0x%x\n",
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS))) {
+               DP_NOTICE(edev, "Unsupported key set:0x%llx\n",
                          dissector->used_keys);
                return -EOPNOTSUPP;
        }
index 15ebd39..4dc8811 100644 (file)
@@ -201,23 +201,23 @@ static int efx_tc_flower_parse_match(struct efx_nic *efx,
                }
        }
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_VLAN) |
-             BIT(FLOW_DISSECTOR_KEY_CVLAN) |
-             BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_IP) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_PORTS) |
-             BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_TCP) |
-             BIT(FLOW_DISSECTOR_KEY_IP))) {
-               NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported flower keys %#x",
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CVLAN) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_TCP) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_IP))) {
+               NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported flower keys %#llx",
                                       dissector->used_keys);
                return -EOPNOTSUPP;
        }
@@ -228,12 +228,13 @@ static int efx_tc_flower_parse_match(struct efx_nic *efx,
            !(match->value.eth_proto == htons(ETH_P_IP) ||
              match->value.eth_proto == htons(ETH_P_IPV6)))
                if (dissector->used_keys &
-                   (BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
-                    BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
-                    BIT(FLOW_DISSECTOR_KEY_PORTS) |
-                    BIT(FLOW_DISSECTOR_KEY_IP) |
-                    BIT(FLOW_DISSECTOR_KEY_TCP))) {
-                       NL_SET_ERR_MSG_FMT_MOD(extack, "L3/L4 flower keys %#x require protocol ipv[46]",
+                   (BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_IP) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_TCP))) {
+                       NL_SET_ERR_MSG_FMT_MOD(extack,
+                                              "L3/L4 flower keys %#llx require protocol ipv[46]",
                                               dissector->used_keys);
                        return -EINVAL;
                }
@@ -281,9 +282,10 @@ static int efx_tc_flower_parse_match(struct efx_nic *efx,
        if ((match->value.ip_proto != IPPROTO_UDP &&
             match->value.ip_proto != IPPROTO_TCP) || !IS_ALL_ONES(match->mask.ip_proto))
                if (dissector->used_keys &
-                   (BIT(FLOW_DISSECTOR_KEY_PORTS) |
-                    BIT(FLOW_DISSECTOR_KEY_TCP))) {
-                       NL_SET_ERR_MSG_FMT_MOD(extack, "L4 flower keys %#x require ipproto udp or tcp",
+                   (BIT_ULL(FLOW_DISSECTOR_KEY_PORTS) |
+                    BIT_ULL(FLOW_DISSECTOR_KEY_TCP))) {
+                       NL_SET_ERR_MSG_FMT_MOD(extack,
+                                              "L4 flower keys %#llx require ipproto udp or tcp",
                                               dissector->used_keys);
                        return -EINVAL;
                }
@@ -344,12 +346,13 @@ static int efx_tc_flower_parse_match(struct efx_nic *efx,
                MAP_ENC_KEY_AND_MASK(PORTS, ports, enc_ports, dst, enc_dport);
                MAP_ENC_KEY_AND_MASK(KEYID, enc_keyid, enc_keyid, keyid, enc_keyid);
        } else if (dissector->used_keys &
-                  (BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) |
-                   BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
-                   BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
-                   BIT(FLOW_DISSECTOR_KEY_ENC_IP) |
-                   BIT(FLOW_DISSECTOR_KEY_ENC_PORTS))) {
-               NL_SET_ERR_MSG_FMT_MOD(extack, "Flower enc keys require enc_control (keys: %#x)",
+                  (BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
+                   BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
+                   BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
+                   BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP) |
+                   BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS))) {
+               NL_SET_ERR_MSG_FMT_MOD(extack,
+                                      "Flower enc keys require enc_control (keys: %#llx)",
                                       dissector->used_keys);
                return -EOPNOTSUPP;
        }
index 687f43c..f9e43fc 100644 (file)
@@ -1355,7 +1355,7 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
                goto cleanup_rss;
        }
 
-       dissector->used_keys |= (1 << FLOW_DISSECTOR_KEY_IPV4_ADDRS);
+       dissector->used_keys |= (1ULL << FLOW_DISSECTOR_KEY_IPV4_ADDRS);
        dissector->offset[FLOW_DISSECTOR_KEY_IPV4_ADDRS] = 0;
 
        cls = kzalloc(sizeof(*cls), GFP_KERNEL);
@@ -1481,8 +1481,8 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
                goto cleanup_rss;
        }
 
-       dissector->used_keys |= (1 << FLOW_DISSECTOR_KEY_BASIC);
-       dissector->used_keys |= (1 << FLOW_DISSECTOR_KEY_PORTS);
+       dissector->used_keys |= (1ULL << FLOW_DISSECTOR_KEY_BASIC);
+       dissector->used_keys |= (1ULL << FLOW_DISSECTOR_KEY_PORTS);
        dissector->offset[FLOW_DISSECTOR_KEY_BASIC] = 0;
        dissector->offset[FLOW_DISSECTOR_KEY_PORTS] = offsetof(typeof(keys), key);
 
index eced87f..9ac2ff0 100644 (file)
@@ -624,9 +624,9 @@ static int am65_cpsw_qos_clsflower_add_policer(struct am65_cpsw_port *port,
        int ret;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
                NL_SET_ERR_MSG_MOD(extack,
                                   "Unsupported keys used");
                return -EOPNOTSUPP;
index e966dd4..ae52cdb 100644 (file)
@@ -1396,9 +1396,9 @@ static int cpsw_qos_clsflower_add_policer(struct cpsw_priv *priv,
        int ret;
 
        if (dissector->used_keys &
-           ~(BIT(FLOW_DISSECTOR_KEY_BASIC) |
-             BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-             BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
+           ~(BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+             BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS))) {
                NL_SET_ERR_MSG_MOD(extack,
                                   "Unsupported keys used");
                return -EOPNOTSUPP;
index 8664ed4..830f06b 100644 (file)
@@ -370,7 +370,8 @@ struct flow_dissector_key {
 };
 
 struct flow_dissector {
-       unsigned int used_keys; /* each bit repesents presence of one key id */
+       unsigned long long  used_keys;
+               /* each bit represents presence of one key id */
        unsigned short int offset[FLOW_DISSECTOR_KEY_MAX];
 };
 
@@ -430,7 +431,7 @@ void skb_flow_get_icmp_tci(const struct sk_buff *skb,
 static inline bool dissector_uses_key(const struct flow_dissector *flow_dissector,
                                      enum flow_dissector_key_id key_id)
 {
-       return flow_dissector->used_keys & (1 << key_id);
+       return flow_dissector->used_keys & (1ULL << key_id);
 }
 
 static inline void *skb_flow_dissector_target(struct flow_dissector *flow_dissector,
index 85a2d0d..ed5dfa3 100644 (file)
@@ -40,7 +40,7 @@
 static void dissector_set_key(struct flow_dissector *flow_dissector,
                              enum flow_dissector_key_id key_id)
 {
-       flow_dissector->used_keys |= (1 << key_id);
+       flow_dissector->used_keys |= (1ULL << key_id);
 }
 
 void skb_flow_dissector_init(struct flow_dissector *flow_dissector,
index 7d40e79..0b0ce4f 100644 (file)
@@ -3208,7 +3208,7 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                if (v4_m_spec->ip4src ||
                    v4_m_spec->ip4dst) {
                        match->dissector.used_keys |=
-                               BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS);
+                               BIT_ULL(FLOW_DISSECTOR_KEY_IPV4_ADDRS);
                        match->dissector.offset[FLOW_DISSECTOR_KEY_IPV4_ADDRS] =
                                offsetof(struct ethtool_rx_flow_key, ipv4);
                }
@@ -3223,7 +3223,7 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                if (v4_m_spec->psrc ||
                    v4_m_spec->pdst) {
                        match->dissector.used_keys |=
-                               BIT(FLOW_DISSECTOR_KEY_PORTS);
+                               BIT_ULL(FLOW_DISSECTOR_KEY_PORTS);
                        match->dissector.offset[FLOW_DISSECTOR_KEY_PORTS] =
                                offsetof(struct ethtool_rx_flow_key, tp);
                }
@@ -3260,7 +3260,7 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                if (!ipv6_addr_any((struct in6_addr *)v6_m_spec->ip6src) ||
                    !ipv6_addr_any((struct in6_addr *)v6_m_spec->ip6dst)) {
                        match->dissector.used_keys |=
-                               BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS);
+                               BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS);
                        match->dissector.offset[FLOW_DISSECTOR_KEY_IPV6_ADDRS] =
                                offsetof(struct ethtool_rx_flow_key, ipv6);
                }
@@ -3275,7 +3275,7 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                if (v6_m_spec->psrc ||
                    v6_m_spec->pdst) {
                        match->dissector.used_keys |=
-                               BIT(FLOW_DISSECTOR_KEY_PORTS);
+                               BIT_ULL(FLOW_DISSECTOR_KEY_PORTS);
                        match->dissector.offset[FLOW_DISSECTOR_KEY_PORTS] =
                                offsetof(struct ethtool_rx_flow_key, tp);
                }
@@ -3283,7 +3283,7 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                        match->key.ip.tos = v6_spec->tclass;
                        match->mask.ip.tos = v6_m_spec->tclass;
                        match->dissector.used_keys |=
-                               BIT(FLOW_DISSECTOR_KEY_IP);
+                               BIT_ULL(FLOW_DISSECTOR_KEY_IP);
                        match->dissector.offset[FLOW_DISSECTOR_KEY_IP] =
                                offsetof(struct ethtool_rx_flow_key, ip);
                }
@@ -3307,7 +3307,7 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                break;
        }
 
-       match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_BASIC);
+       match->dissector.used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_BASIC);
        match->dissector.offset[FLOW_DISSECTOR_KEY_BASIC] =
                offsetof(struct ethtool_rx_flow_key, basic);
 
@@ -3340,7 +3340,7 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                if (ext_m_spec->vlan_etype ||
                    ext_m_spec->vlan_tci) {
                        match->dissector.used_keys |=
-                               BIT(FLOW_DISSECTOR_KEY_VLAN);
+                               BIT_ULL(FLOW_DISSECTOR_KEY_VLAN);
                        match->dissector.offset[FLOW_DISSECTOR_KEY_VLAN] =
                                offsetof(struct ethtool_rx_flow_key, vlan);
                }
@@ -3355,7 +3355,7 @@ ethtool_rx_flow_rule_create(const struct ethtool_rx_flow_spec_input *input)
                       ETH_ALEN);
 
                match->dissector.used_keys |=
-                       BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS);
+                       BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS);
                match->dissector.offset[FLOW_DISSECTOR_KEY_ETH_ADDRS] =
                        offsetof(struct ethtool_rx_flow_key, eth_addrs);
        }
index 1c26f03..a010b25 100644 (file)
@@ -34,7 +34,7 @@ static void nf_flow_rule_lwt_match(struct nf_flow_match *match,
 {
        struct nf_flow_key *mask = &match->mask;
        struct nf_flow_key *key = &match->key;
-       unsigned int enc_keys;
+       unsigned long long enc_keys;
 
        if (!tun_info || !(tun_info->mode & IP_TUNNEL_INFO_TX))
                return;
@@ -43,8 +43,8 @@ static void nf_flow_rule_lwt_match(struct nf_flow_match *match,
        NF_FLOW_DISSECTOR(match, FLOW_DISSECTOR_KEY_ENC_KEYID, enc_key_id);
        key->enc_key_id.keyid = tunnel_id_to_key32(tun_info->key.tun_id);
        mask->enc_key_id.keyid = 0xffffffff;
-       enc_keys = BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) |
-                  BIT(FLOW_DISSECTOR_KEY_ENC_CONTROL);
+       enc_keys = BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
+                  BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL);
 
        if (ip_tunnel_info_af(tun_info) == AF_INET) {
                NF_FLOW_DISSECTOR(match, FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS,
@@ -55,7 +55,7 @@ static void nf_flow_rule_lwt_match(struct nf_flow_match *match,
                        mask->enc_ipv4.src = 0xffffffff;
                if (key->enc_ipv4.dst)
                        mask->enc_ipv4.dst = 0xffffffff;
-               enc_keys |= BIT(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS);
+               enc_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS);
                key->enc_control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
        } else {
                memcpy(&key->enc_ipv6.src, &tun_info->key.u.ipv6.dst,
@@ -70,7 +70,7 @@ static void nf_flow_rule_lwt_match(struct nf_flow_match *match,
                           sizeof(struct in6_addr)))
                        memset(&mask->enc_ipv6.dst, 0xff,
                               sizeof(struct in6_addr));
-               enc_keys |= BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS);
+               enc_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS);
                key->enc_control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
        }
 
@@ -163,14 +163,14 @@ static int nf_flow_rule_match(struct nf_flow_match *match,
                return -EOPNOTSUPP;
        }
        mask->control.addr_type = 0xffff;
-       match->dissector.used_keys |= BIT(key->control.addr_type);
+       match->dissector.used_keys |= BIT_ULL(key->control.addr_type);
        mask->basic.n_proto = 0xffff;
 
        switch (tuple->l4proto) {
        case IPPROTO_TCP:
                key->tcp.flags = 0;
                mask->tcp.flags = cpu_to_be16(be32_to_cpu(TCP_FLAG_RST | TCP_FLAG_FIN) >> 16);
-               match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_TCP);
+               match->dissector.used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_TCP);
                break;
        case IPPROTO_UDP:
        case IPPROTO_GRE:
@@ -182,9 +182,9 @@ static int nf_flow_rule_match(struct nf_flow_match *match,
        key->basic.ip_proto = tuple->l4proto;
        mask->basic.ip_proto = 0xff;
 
-       match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_META) |
-                                     BIT(FLOW_DISSECTOR_KEY_CONTROL) |
-                                     BIT(FLOW_DISSECTOR_KEY_BASIC);
+       match->dissector.used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_META) |
+                                     BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
+                                     BIT_ULL(FLOW_DISSECTOR_KEY_BASIC);
 
        switch (tuple->l4proto) {
        case IPPROTO_TCP:
@@ -194,7 +194,7 @@ static int nf_flow_rule_match(struct nf_flow_match *match,
                key->tp.dst = tuple->dst_port;
                mask->tp.dst = 0xffff;
 
-               match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_PORTS);
+               match->dissector.used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_PORTS);
                break;
        }
 
index 910ef88..12ab78f 100644 (file)
@@ -35,12 +35,12 @@ void nft_flow_rule_set_addr_type(struct nft_flow_rule *flow,
        struct nft_flow_key *mask = &match->mask;
        struct nft_flow_key *key = &match->key;
 
-       if (match->dissector.used_keys & BIT(FLOW_DISSECTOR_KEY_CONTROL))
+       if (match->dissector.used_keys & BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL))
                return;
 
        key->control.addr_type = addr_type;
        mask->control.addr_type = 0xffff;
-       match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_CONTROL);
+       match->dissector.used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL);
        match->dissector.offset[FLOW_DISSECTOR_KEY_CONTROL] =
                offsetof(struct nft_flow_key, control);
 }
@@ -59,7 +59,7 @@ static void nft_flow_rule_transfer_vlan(struct nft_offload_ctx *ctx,
                .mask   = match->mask.basic.n_proto,
        };
 
-       if (match->dissector.used_keys & BIT(FLOW_DISSECTOR_KEY_VLAN) &&
+       if (match->dissector.used_keys & BIT_ULL(FLOW_DISSECTOR_KEY_VLAN) &&
            (match->key.vlan.vlan_tpid == htons(ETH_P_8021Q) ||
             match->key.vlan.vlan_tpid == htons(ETH_P_8021AD))) {
                match->key.basic.n_proto = match->key.cvlan.vlan_tpid;
@@ -70,8 +70,9 @@ static void nft_flow_rule_transfer_vlan(struct nft_offload_ctx *ctx,
                match->mask.vlan.vlan_tpid = ethertype.mask;
                match->dissector.offset[FLOW_DISSECTOR_KEY_CVLAN] =
                        offsetof(struct nft_flow_key, cvlan);
-               match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_CVLAN);
-       } else if (match->dissector.used_keys & BIT(FLOW_DISSECTOR_KEY_BASIC) &&
+               match->dissector.used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CVLAN);
+       } else if (match->dissector.used_keys &
+                  BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) &&
                   (match->key.basic.n_proto == htons(ETH_P_8021Q) ||
                    match->key.basic.n_proto == htons(ETH_P_8021AD))) {
                match->key.basic.n_proto = match->key.vlan.vlan_tpid;
@@ -80,7 +81,7 @@ static void nft_flow_rule_transfer_vlan(struct nft_offload_ctx *ctx,
                match->mask.vlan.vlan_tpid = ethertype.mask;
                match->dissector.offset[FLOW_DISSECTOR_KEY_VLAN] =
                        offsetof(struct nft_flow_key, vlan);
-               match->dissector.used_keys |= BIT(FLOW_DISSECTOR_KEY_VLAN);
+               match->dissector.used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_VLAN);
        }
 }
 
index 6eb21a4..cd46522 100644 (file)
@@ -162,7 +162,7 @@ static int __nft_cmp_offload(struct nft_offload_ctx *ctx,
        memcpy(key + reg->offset, data, reg->len);
        memcpy(mask + reg->offset, datamask, reg->len);
 
-       flow->match.dissector.used_keys |= BIT(reg->key);
+       flow->match.dissector.used_keys |= BIT_ULL(reg->key);
        flow->match.dissector.offset[reg->key] = reg->base_offset;
 
        if (reg->key == FLOW_DISSECTOR_KEY_META &&