From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 187781094 for ; Mon, 2 Jan 2017 11:45:51 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 02 Jan 2017 02:45:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,432,1477983600"; d="scan'208";a="918092658" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 02 Jan 2017 02:45:50 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 2 Jan 2017 02:45:50 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 2 Jan 2017 02:45:50 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Mon, 2 Jan 2017 18:45:48 +0800 From: "Xing, Beilei" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhao1, Wei" , "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH v2 11/18] net/ixgbe: parse n-tuple filter Thread-Index: AQHSYnLiUouvO6AG4UO/04SoHPQFJaElBOmA Date: Mon, 2 Jan 2017 10:45:47 +0000 Message-ID: <94479800C636CB44BD422CB454846E013158CE8C@SHSMSX101.ccr.corp.intel.com> References: <1483084390-53159-1-git-send-email-wei.zhao1@intel.com> <1483084390-53159-12-git-send-email-wei.zhao1@intel.com> In-Reply-To: <1483084390-53159-12-git-send-email-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTUwYjc1ZjctNTFiYS00NTZlLWEwYzItMGE0Y2E5YjI3NjNhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlwvXC8rM1M3T2o0UHN0OUZRUjhRdnV4ZHJ4Sm8xU1dTSnBtanQ1RWdJWERmcz0ifQ== x-ctpclassification: CTP_IC 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 v2 11/18] net/ixgbe: parse n-tuple filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2017 10:45:52 -0000 > + > + filter->dst_port_mask =3D tcp_mask->hdr.dst_port; > + filter->src_port_mask =3D tcp_mask->hdr.src_port; > + if (tcp_mask->hdr.tcp_flags =3D=3D 0xFF) { It's better to use UINT8_MAX here. > + filter->flags |=3D RTE_NTUPLE_FLAGS_TCP_FLAG; > + } else if (!tcp_mask->hdr.tcp_flags) { > + filter->flags &=3D ~RTE_NTUPLE_FLAGS_TCP_FLAG; > + } else { > + memset(filter, 0, sizeof(struct rte_eth_ntuple_filter)); > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ITEM, > + item, "Not supported by ntuple filter"); > + return -rte_errno; > + } > + > + if (attr->priority > 0xFFFF) { How about UINT16_MAX? > + memset(filter, 0, sizeof(struct rte_eth_ntuple_filter)); > + rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, > + attr, "Error priority."); > + return -rte_errno; > + } > + filter->priority =3D (uint16_t)attr->priority; > + > + return 0; > +} > +