From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 2835D688F for ; Wed, 22 Oct 2014 07:14:28 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 21 Oct 2014 22:21:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,766,1406617200"; d="scan'208";a="593531707" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga001.jf.intel.com with ESMTP; 21 Oct 2014 22:22:25 -0700 Received: from kmsmsx153.gar.corp.intel.com (172.21.73.88) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 22 Oct 2014 13:21:44 +0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 22 Oct 2014 13:21:44 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.202]) by shsmsx102.ccr.corp.intel.com ([169.254.2.156]) with mapi id 14.03.0195.001; Wed, 22 Oct 2014 13:21:43 +0800 From: "Liu, Jijiang" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v6 2/9] librte_ether:add VxLAN packet identification API in librte_ether Thread-Index: AQHP7Rz/36CcrBji70yGvoQoDSEZtJw6h8/AgAABQICAAQyVoA== Date: Wed, 22 Oct 2014 05:21:43 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D82863@SHSMSX101.ccr.corp.intel.com> References: <1413881168-20239-1-git-send-email-jijiang.liu@intel.com> <3607443.z2coKxdkI7@xps13> <1ED644BD7E0A5F4091CF203DAFB8E4CC01D82530@SHSMSX101.ccr.corp.intel.com> <282785858.Uoneh1Nj8l@xps13> In-Reply-To: <282785858.Uoneh1Nj8l@xps13> 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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v6 2/9] librte_ether:add VxLAN packet identification API in librte_ether 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: Wed, 22 Oct 2014 05:14:29 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, October 22, 2014 5:19 AM > To: Liu, Jijiang > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v6 2/9] librte_ether:add VxLAN packet > identification API in librte_ether >=20 > 2014-10-21 13:48, Liu, Jijiang: > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > > 2014-10-21 16:46, Jijiang Liu: > > > > int > > > > +rte_eth_dev_udp_tunnel_add(uint8_t port_id, > > > > + struct rte_eth_udp_tunnel *udp_tunnel, > > > > + uint8_t count) > > > > +{ > > > > + uint8_t i; > > > > + struct rte_eth_dev *dev; > > > > + struct rte_eth_udp_tunnel *tunnel; > > > > + > > > > + if (port_id >=3D nb_ports) { > > > > + PMD_DEBUG_TRACE("Invalid port_id=3D%d\n", port_id); > > > > + return -ENODEV; > > > > + } > > > > + > > > > + if (udp_tunnel =3D=3D NULL) { > > > > + PMD_DEBUG_TRACE("Invalid udp_tunnel parameter\n"); > > > > + return -EINVAL; > > > > + } > > > > + tunnel =3D udp_tunnel; > > > > + > > > > + for (i =3D 0; i < count; i++, tunnel++) { > > > > + if (tunnel->prot_type >=3D RTE_TUNNEL_TYPE_MAX) { > > > > + PMD_DEBUG_TRACE("Invalid tunnel type\n"); > > > > + return -EINVAL; > > > > + } > > > > + } > > > > > > I'm not sure it's a good idea to provide a count parameter to > > > iterate in a loop. > > > It's probably something that the application should do by itself. > > > > It is necessary to check if this prot_type(tunnel type) is valid here > > in case applications don't do that. >=20 > Yes, you have to check prot_type but looping for several tunnels is not > needed at this level. Ok, remove loop check from here. =20 > Thanks > -- > Thomas