From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 44C282956 for ; Thu, 25 Feb 2016 02:54:26 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 24 Feb 2016 17:22:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,496,1449561600"; d="scan'208";a="910686546" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 24 Feb 2016 17:22:48 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 24 Feb 2016 17:22:48 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 24 Feb 2016 17:22:47 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.132]) by shsmsx102.ccr.corp.intel.com ([169.254.2.232]) with mapi id 14.03.0248.002; Thu, 25 Feb 2016 09:22:45 +0800 From: "Wu, Jingjing" To: "Sun, Xutao" , "dev@dpdk.org" Thread-Topic: [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Thread-Index: AQHRaue3tN4+G8m6rES0BbzP8nJ/2p87/xHQ Date: Thu, 25 Feb 2016 01:22:45 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8DC918D@SHSMSX104.ccr.corp.intel.com> References: <1455789499-15975-1-git-send-email-xutao.sun@intel.com> <1455867097-19173-1-git-send-email-xutao.sun@intel.com> <1455867097-19173-2-git-send-email-xutao.sun@intel.com> In-Reply-To: <1455867097-19173-2-git-send-email-xutao.sun@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Thu, 25 Feb 2016 01:54:26 -0000 > -----Original Message----- > From: Sun, Xutao > Sent: Friday, February 19, 2016 3:32 PM > To: dev@dpdk.org > Cc: Zhang, Helin; Wu, Jingjing; De Lara Guarch, Pablo; Sun, Xutao; Liu, J= ijiang > Subject: [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_con= f' > structure >=20 > Change the fields of outer_mac and inner_mac from pointer to struct in > order to keep the code's readability. >=20 > Signed-off-by: Xutao Sun > Signed-off-by: Jijiang Liu > 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:: >=20 > 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-te= nid|\ > + 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 tenan= t > ID. > + > +* ``oip``: Set filter type as Outer IP. > + > +* ``iip``: Set filter type as Inner IP. > + Doc for tunnel_filter is extended, and ipingre type is also mentioned here. This part seems no relationship with the commit log "Change the fields of o= uter_mac and inner_mac from pointer to struct in order to keep the code's readabilit= y". It's better to move to latter patch. > +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. >=20 > tunnel_filter remove > ~~~~~~~~~~~~~~~~~~~~ > @@ -561,7 +591,8 @@ tunnel_filter remove Remove a tunnel filter on a > port:: >=20 > 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-te= nid|\ > + imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) > + (queue_id) >=20 > rx_vxlan_port add > ~~~~~~~~~~~~~~~~~ > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.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 =3D cld_filter; >=20 > - (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); >=20 > pfilter->inner_vlan =3D tunnel_filter->inner_vlan; > if (tunnel_filter->ip_type =3D=3D RTE_TUNNEL_IPTYPE_IPV4) { @@ - > 6131,13 +6131,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, > } >=20 > 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; > } >=20 > 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_c= trl.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