ethdev: rework tunnel filtering structure
authorXutao Sun <xutao.sun@intel.com>
Thu, 10 Mar 2016 03:05:59 +0000 (11:05 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 13 Mar 2016 14:26:55 +0000 (15:26 +0100)
Change the fields of outer_mac and inner_mac in struct
rte_eth_tunnel_filter_conf from pointer to struct in order to
keep the code's readability.

Signed-off-by: Xutao Sun <xutao.sun@intel.com>
Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
app/test-pmd/cmdline.c
doc/guides/rel_notes/deprecation.rst
doc/guides/rel_notes/release_16_04.rst
drivers/net/i40e/i40e_ethdev.c
examples/tep_termination/vxlan_setup.c
lib/librte_ether/rte_eth_ctrl.h

index 102d50d..86616d3 100644 (file)
@@ -6669,8 +6669,8 @@ cmd_tunnel_filter_parsed(void *parsed_result,
        struct rte_eth_tunnel_filter_conf tunnel_filter_conf;
        int ret = 0;
 
-       tunnel_filter_conf.outer_mac = &res->outer_mac;
-       tunnel_filter_conf.inner_mac = &res->inner_mac;
+       ether_addr_copy(&res->outer_mac, &tunnel_filter_conf.outer_mac);
+       ether_addr_copy(&res->inner_mac, &tunnel_filter_conf.inner_mac);
        tunnel_filter_conf.inner_vlan = res->inner_vlan;
 
        if (res->ip_value.family == AF_INET) {
index f033bbc..a2017f1 100644 (file)
@@ -34,10 +34,5 @@ Deprecation Notices
   RTE_ETH_FLOW_MAX. The release 2.2 does not contain these ABI changes,
   but release 2.3 will.
 
-* ABI changes are planned for rte_eth_tunnel_filter_conf. Change the fields
-  of outer_mac and inner_mac from pointer to struct in order to keep the
-  code's readability. The release 2.2 does not contain these ABI changes, but
-  release 2.3 will, and no backwards compatibility is planned.
-
 * The scheduler statistics structure will change to allow keeping track of
   RED actions.
index f4a07c7..b729b67 100644 (file)
@@ -212,6 +212,10 @@ This section should contain API changes. Sample format:
   have been renamed into ``rte_eth_dev_udp_tunnel_port_add`` and
   ``rte_eth_dev_udp_tunnel_port_delete``.
 
+* The ``outer_mac`` and ``inner_mac`` fields in structure
+  ``rte_eth_tunnel_filter_conf`` are changed from pointer to struct in order
+  to keep code's readability.
+
 * The fields in ethdev structure ``rte_eth_fdir_masks`` were changed
   to be in big endian.
 
index 6dd8bda..1b5c315 100644 (file)
@@ -5908,10 +5908,8 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf,
        }
        pfilter = cld_filter;
 
-       (void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac,
-                       sizeof(struct ether_addr));
-       (void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac,
-                       sizeof(struct ether_addr));
+       ether_addr_copy(&tunnel_filter->outer_mac, (struct ether_addr*)&pfilter->outer_mac);
+       ether_addr_copy(&tunnel_filter->inner_mac, (struct ether_addr*)&pfilter->inner_mac);
 
        pfilter->inner_vlan = tunnel_filter->inner_vlan;
        if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) {
@@ -6211,13 +6209,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf,
        }
 
        if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) &&
-               (is_zero_ether_addr(filter->outer_mac))) {
+               (is_zero_ether_addr(&filter->outer_mac))) {
                PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address");
                return -EINVAL;
        }
 
        if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) &&
-               (is_zero_ether_addr(filter->inner_mac))) {
+               (is_zero_ether_addr(&filter->inner_mac))) {
                PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address");
                return -EINVAL;
        }
index 8836603..2a48e14 100644 (file)
@@ -278,11 +278,11 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)
        memset(&tunnel_filter_conf, 0,
                sizeof(struct rte_eth_tunnel_filter_conf));
 
-       tunnel_filter_conf.outer_mac = &ports_eth_addr[0];
+       ether_addr_copy(&ports_eth_addr[0], &tunnel_filter_conf.outer_mac);
        tunnel_filter_conf.filter_type = tep_filter_type[filter_idx];
 
        /* inner MAC */
-       tunnel_filter_conf.inner_mac = &vdev->mac_address;
+       ether_addr_copy(&vdev->mac_address, &tunnel_filter_conf.inner_mac);
 
        tunnel_filter_conf.queue_id = vdev->rx_q;
        tunnel_filter_conf.tenant_id = tenant_id_conf[vdev->rx_q];
@@ -366,8 +366,8 @@ vxlan_unlink(struct vhost_dev *vdev)
                memset(&tunnel_filter_conf, 0,
                        sizeof(struct rte_eth_tunnel_filter_conf));
 
-               tunnel_filter_conf.outer_mac = &ports_eth_addr[0];
-               tunnel_filter_conf.inner_mac = &vdev->mac_address;
+               ether_addr_copy(&ports_eth_addr[0], &tunnel_filter_conf.outer_mac);
+               ether_addr_copy(&vdev->mac_address, &tunnel_filter_conf.inner_mac);
                tunnel_filter_conf.tenant_id = tenant_id_conf[vdev->rx_q];
                tunnel_filter_conf.filter_type = tep_filter_type[filter_idx];
 
index 4c79bd3..255435a 100644 (file)
@@ -282,8 +282,8 @@ enum rte_tunnel_iptype {
  * Tunneling Packet filter configuration.
  */
 struct rte_eth_tunnel_filter_conf {
-       struct ether_addr *outer_mac;  /**< Outer MAC address filter. */
-       struct ether_addr *inner_mac;  /**< Inner MAC address filter. */
+       struct ether_addr outer_mac;  /**< Outer MAC address filter. */
+       struct ether_addr inner_mac;  /**< Inner MAC address filter. */
        uint16_t inner_vlan;           /**< Inner VLAN filter. */
        enum rte_tunnel_iptype ip_type; /**< IP address type. */
        union {