ethdev: rework tunnel filtering structure

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>
This commit is contained in:
Xutao Sun 2016-03-10 11:05:59 +08:00 committed by Thomas Monjalon
parent d87c3058bb
commit dd76f93c2d
6 changed files with 16 additions and 19 deletions

View 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) {

View 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.

View 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.

View 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;
}

View 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];

View 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 {