From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E2A03C4D6 for ; Fri, 19 Feb 2016 08:31:49 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 18 Feb 2016 23:31:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,469,1449561600"; d="scan'208";a="906628773" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 18 Feb 2016 23:31:47 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u1J7VjtO013448; Fri, 19 Feb 2016 15:31:45 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u1J7VfTm019227; Fri, 19 Feb 2016 15:31:43 +0800 Received: (from xutaosun@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u1J7VfSr019223; Fri, 19 Feb 2016 15:31:41 +0800 From: Xutao Sun To: dev@dpdk.org Date: Fri, 19 Feb 2016 15:31:34 +0800 Message-Id: <1455867097-19173-2-git-send-email-xutao.sun@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1455867097-19173-1-git-send-email-xutao.sun@intel.com> References: <1455789499-15975-1-git-send-email-xutao.sun@intel.com> <1455867097-19173-1-git-send-email-xutao.sun@intel.com> Subject: [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2016 07:31:50 -0000 Change the fields of outer_mac and inner_mac from pointer to struct in order to keep the code's readability. Signed-off-by: Xutao Sun Signed-off-by: Jijiang Liu --- app/test-pmd/cmdline.c | 6 +++-- doc/guides/rel_notes/deprecation.rst | 5 ----- doc/guides/rel_notes/release_16_04.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 35 +++++++++++++++++++++++++++-- drivers/net/i40e/i40e_ethdev.c | 12 +++++----- lib/librte_ether/rte_eth_ctrl.h | 4 ++-- 6 files changed, 47 insertions(+), 17 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 52e9f5f..c707318 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6640,8 +6640,10 @@ 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; + rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, + ETHER_ADDR_LEN); + rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, + ETHER_ADDR_LEN); tunnel_filter_conf.inner_vlan = res->inner_vlan; if (res->ip_value.family == AF_INET) { diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index e94d4a2..a895364 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -32,11 +32,6 @@ 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. diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index eb1b3b2..2588225 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -104,6 +104,8 @@ ABI Changes the previous releases and made in this release. Use fixed width quotes for ``rte_function_names`` or ``rte_struct_names``. Use the past tense. +* The fields of outer_mac and inner_mac were changed from pointer + to struct in order to keep the code's readability. Shared Library Versions ----------------------- diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a520cc5..3ee629a 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -553,7 +553,37 @@ tunnel_filter add Add a tunnel filter on a port:: testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) + +The available information categories are: + +* ``vxlan``: Set tunnel type as VXLAN. + +* ``nvgre``: Set tunnel type as NVGRE. + +* ``ipingre``: Set tunnel type as IP-in-GRE. + +* ``imac-ivlan``: Set filter type as Inner MAC and VLAN. + +* ``imac-ivlan-tenid``: Set filter type as Inner MAC, VLAN and tenant ID. + +* ``imac-tenid``: Set filter type as Inner MAC and tenant ID. + +* ``imac``: Set filter type as Inner MAC. + +* ``omac-imac-tenid``: Set filter type as Outer MAC, Inner MAC and tenant ID. + +* ``oip``: Set filter type as Outer IP. + +* ``iip``: Set filter type as Inner IP. + +Example:: + + testpmd> tunnel_filter add 0 68:05:CA:28:09:82 00:00:00:00:00:00 \ + 192.168.2.2 0 ipingre oip 1 1 + + Set an IP-in-GRE tunnel on port 0, and the filter type is Outer IP. tunnel_filter remove ~~~~~~~~~~~~~~~~~~~~ @@ -561,7 +591,8 @@ tunnel_filter remove Remove a tunnel filter on a port:: testpmd> tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id) + (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) rx_vxlan_port add ~~~~~~~~~~~~~~~~~ diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index ef24122..7c22358 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5828,10 +5828,10 @@ 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)); + (void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac, + ETHER_ADDR_LEN); + (void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac, + ETHER_ADDR_LEN); pfilter->inner_vlan = tunnel_filter->inner_vlan; if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) { @@ -6131,13 +6131,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; } diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..30cbde7 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -280,8 +280,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 { -- 1.9.3