net: add rte prefix to IP defines
[dpdk.git] / drivers / net / i40e / i40e_flow.c
index 5447e4e..3053d1f 100644 (file)
@@ -2006,9 +2006,9 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,
                         * Mask bits of destination MAC address must be full
                         * of 1 or full of 0.
                         */
-                       if (!is_zero_ether_addr(&eth_mask->src) ||
-                           (!is_zero_ether_addr(&eth_mask->dst) &&
-                            !is_broadcast_ether_addr(&eth_mask->dst))) {
+                       if (!rte_is_zero_ether_addr(&eth_mask->src) ||
+                           (!rte_is_zero_ether_addr(&eth_mask->dst) &&
+                            !rte_is_broadcast_ether_addr(&eth_mask->dst))) {
                                rte_flow_error_set(error, EINVAL,
                                                   RTE_FLOW_ERROR_TYPE_ITEM,
                                                   item,
@@ -2027,7 +2027,7 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,
                        /* If mask bits of destination MAC address
                         * are full of 1, set RTE_ETHTYPE_FLAGS_MAC.
                         */
-                       if (is_broadcast_ether_addr(&eth_mask->dst)) {
+                       if (rte_is_broadcast_ether_addr(&eth_mask->dst)) {
                                filter->mac_addr = eth_spec->dst;
                                filter->flags |= RTE_ETHTYPE_FLAGS_MAC;
                        } else {
@@ -2035,9 +2035,9 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,
                        }
                        filter->ether_type = rte_be_to_cpu_16(eth_spec->type);
 
-                       if (filter->ether_type == ETHER_TYPE_IPv4 ||
-                           filter->ether_type == ETHER_TYPE_IPv6 ||
-                           filter->ether_type == ETHER_TYPE_LLDP ||
+                       if (filter->ether_type == RTE_ETHER_TYPE_IPv4 ||
+                           filter->ether_type == RTE_ETHER_TYPE_IPv6 ||
+                           filter->ether_type == RTE_ETHER_TYPE_LLDP ||
                            filter->ether_type == outer_tpid) {
                                rte_flow_error_set(error, EINVAL,
                                                   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2484,8 +2484,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
                        eth_mask = item->mask;
 
                        if (eth_spec && eth_mask) {
-                               if (!is_zero_ether_addr(&eth_mask->src) ||
-                                   !is_zero_ether_addr(&eth_mask->dst)) {
+                               if (!rte_is_zero_ether_addr(&eth_mask->src) ||
+                                   !rte_is_zero_ether_addr(&eth_mask->dst)) {
                                        rte_flow_error_set(error, EINVAL,
                                                      RTE_FLOW_ERROR_TYPE_ITEM,
                                                      item,
@@ -2507,9 +2507,9 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
                                ether_type = rte_be_to_cpu_16(eth_spec->type);
 
                                if (next == RTE_FLOW_ITEM_TYPE_VLAN ||
-                                   ether_type == ETHER_TYPE_IPv4 ||
-                                   ether_type == ETHER_TYPE_IPv6 ||
-                                   ether_type == ETHER_TYPE_ARP ||
+                                   ether_type == RTE_ETHER_TYPE_IPv4 ||
+                                   ether_type == RTE_ETHER_TYPE_IPv6 ||
+                                   ether_type == RTE_ETHER_TYPE_ARP ||
                                    ether_type == outer_tpid) {
                                        rte_flow_error_set(error, EINVAL,
                                                     RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2552,9 +2552,9 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
                                ether_type =
                                        rte_be_to_cpu_16(vlan_spec->inner_type);
 
-                               if (ether_type == ETHER_TYPE_IPv4 ||
-                                   ether_type == ETHER_TYPE_IPv6 ||
-                                   ether_type == ETHER_TYPE_ARP ||
+                               if (ether_type == RTE_ETHER_TYPE_IPv4 ||
+                                   ether_type == RTE_ETHER_TYPE_IPv6 ||
+                                   ether_type == RTE_ETHER_TYPE_ARP ||
                                    ether_type == outer_tpid) {
                                        rte_flow_error_set(error, EINVAL,
                                                     RTE_FLOW_ERROR_TYPE_ITEM,
@@ -2606,8 +2606,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
                                /* Check if it is fragment. */
                                frag_off = ipv4_spec->hdr.fragment_offset;
                                frag_off = rte_be_to_cpu_16(frag_off);
-                               if (frag_off & IPV4_HDR_OFFSET_MASK ||
-                                   frag_off & IPV4_HDR_MF_FLAG)
+                               if (frag_off & RTE_IPV4_HDR_OFFSET_MASK ||
+                                   frag_off & RTE_IPV4_HDR_MF_FLAG)
                                        pctype = I40E_FILTER_PCTYPE_FRAG_IPV4;
 
                                /* Get the filter info */
@@ -3325,8 +3325,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
                                /* DST address of inner MAC shouldn't be masked.
                                 * SRC address of Inner MAC should be masked.
                                 */
-                               if (!is_broadcast_ether_addr(&eth_mask->dst) ||
-                                   !is_zero_ether_addr(&eth_mask->src) ||
+                               if (!rte_is_broadcast_ether_addr(&eth_mask->dst) ||
+                                   !rte_is_zero_ether_addr(&eth_mask->src) ||
                                    eth_mask->type) {
                                        rte_flow_error_set(error, EINVAL,
                                                   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -3338,12 +3338,12 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
                                if (!vxlan_flag) {
                                        rte_memcpy(&filter->outer_mac,
                                                   &eth_spec->dst,
-                                                  ETHER_ADDR_LEN);
+                                                  RTE_ETHER_ADDR_LEN);
                                        filter_type |= ETH_TUNNEL_FILTER_OMAC;
                                } else {
                                        rte_memcpy(&filter->inner_mac,
                                                   &eth_spec->dst,
-                                                  ETHER_ADDR_LEN);
+                                                  RTE_ETHER_ADDR_LEN);
                                        filter_type |= ETH_TUNNEL_FILTER_IMAC;
                                }
                        }
@@ -3555,8 +3555,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
                                /* DST address of inner MAC shouldn't be masked.
                                 * SRC address of Inner MAC should be masked.
                                 */
-                               if (!is_broadcast_ether_addr(&eth_mask->dst) ||
-                                   !is_zero_ether_addr(&eth_mask->src) ||
+                               if (!rte_is_broadcast_ether_addr(&eth_mask->dst) ||
+                                   !rte_is_zero_ether_addr(&eth_mask->src) ||
                                    eth_mask->type) {
                                        rte_flow_error_set(error, EINVAL,
                                                   RTE_FLOW_ERROR_TYPE_ITEM,
@@ -3568,12 +3568,12 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
                                if (!nvgre_flag) {
                                        rte_memcpy(&filter->outer_mac,
                                                   &eth_spec->dst,
-                                                  ETHER_ADDR_LEN);
+                                                  RTE_ETHER_ADDR_LEN);
                                        filter_type |= ETH_TUNNEL_FILTER_OMAC;
                                } else {
                                        rte_memcpy(&filter->inner_mac,
                                                   &eth_spec->dst,
-                                                  ETHER_ADDR_LEN);
+                                                  RTE_ETHER_ADDR_LEN);
                                        filter_type |= ETH_TUNNEL_FILTER_IMAC;
                                }
                        }
@@ -4444,6 +4444,14 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev,
                }
        }
 
+       if (rss_info->conf.queue_num) {
+               rte_flow_error_set(error, EINVAL,
+                               RTE_FLOW_ERROR_TYPE_ACTION,
+                               act,
+                               "rss only allow one valid rule");
+               return -rte_errno;
+       }
+
        /* Parse RSS related parameters from configuration */
        if (rss->func != RTE_ETH_HASH_FUNCTION_DEFAULT)
                return rte_flow_error_set
@@ -4802,10 +4810,10 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
        int ret = 0;
 
        memset(&cld_filter, 0, sizeof(cld_filter));
-       ether_addr_copy((struct ether_addr *)&filter->input.outer_mac,
-                       (struct ether_addr *)&cld_filter.element.outer_mac);
-       ether_addr_copy((struct ether_addr *)&filter->input.inner_mac,
-                       (struct ether_addr *)&cld_filter.element.inner_mac);
+       rte_ether_addr_copy((struct rte_ether_addr *)&filter->input.outer_mac,
+                       (struct rte_ether_addr *)&cld_filter.element.outer_mac);
+       rte_ether_addr_copy((struct rte_ether_addr *)&filter->input.inner_mac,
+                       (struct rte_ether_addr *)&cld_filter.element.inner_mac);
        cld_filter.element.inner_vlan = filter->input.inner_vlan;
        cld_filter.element.flags = filter->input.flags;
        cld_filter.element.tenant_id = filter->input.tenant_id;