From patchwork Fri May 13 08:16:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 67743 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp142798qge; Fri, 13 May 2016 01:17:14 -0700 (PDT) X-Received: by 10.140.34.203 with SMTP id l69mr12322086qgl.17.1463127434762; Fri, 13 May 2016 01:17:14 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 65si6819767qkx.158.2016.05.13.01.17.14; Fri, 13 May 2016 01:17:14 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id 64DFF61658; Fri, 13 May 2016 08:17:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id EEE17615D8; Fri, 13 May 2016 08:17:06 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 5332B6157E; Fri, 13 May 2016 08:17:05 +0000 (UTC) Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0138.outbound.protection.outlook.com [157.56.112.138]) by lists.linaro.org (Postfix) with ESMTPS id 9C2A96157E for ; Fri, 13 May 2016 08:16:27 +0000 (UTC) Received: from AM4PR07MB1233.eurprd07.prod.outlook.com (10.164.81.139) by AM4PR07MB1233.eurprd07.prod.outlook.com (10.164.81.139) with Microsoft SMTP Server (TLS) id 15.1.492.11; Fri, 13 May 2016 08:16:25 +0000 Received: from AM4PR07MB1233.eurprd07.prod.outlook.com ([10.164.81.139]) by AM4PR07MB1233.eurprd07.prod.outlook.com ([10.164.81.139]) with mapi id 15.01.0492.019; Fri, 13 May 2016 08:16:25 +0000 From: "Elo, Matias (Nokia - FI/Espoo)" To: EXT Bala Manoharan Thread-Topic: [lng-odp] [PATCH 2/4] linux-generic: packet: remove vlan_s_tag and vlan_c_tag members from odp_packet_hdr_t Thread-Index: AQHRrOIzsYYxhAg7a0+FC6zxi1i+FJ+2fm2Q Date: Fri, 13 May 2016 08:16:25 +0000 Message-ID: References: <1463056577-31920-1-git-send-email-matias.elo@nokia.com> <1463056577-31920-3-git-send-email-matias.elo@nokia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [131.228.2.13] x-ms-office365-filtering-correlation-id: 775b3d97-33f8-4db0-6d52-08d37b06e0aa x-microsoft-exchange-diagnostics: 1; AM4PR07MB1233; 5:20OlG/lmnIIw/Z//8E6CFPNwCV0WcnrkjpOD4x8j4QwVwcAX7DHKVIRHBFr5sCPYvG+Zy1xaI9JnodCNElJd+onp06ZVDTmbu6pWLavAXcR/Kb+Yw0r49umERq1sjbTg4byiWPY+C+Sqr5Bbar8LAQ==; 24:zuf1+UxGLiirHeQX0AAtGTmOcNEZEhB1yNZtuJ7IXlgkRH8BJnv2TDbfe04oxF9YuPL3kbVUso3CtZ2RnyZ8oRah5xbPxjcoJL9PRTztwF8=; 7:AuKUhA6R8UkWYUZqeUs/GM14Syf7qspfe3JHJmgsA1pMoSAy3nOZzE+3Xt91E1ENzygHu19o/8P7X7tmL951UmjBnWJ8H6HzxkiwVwTVpm0ZT0/9EDmABR1H+5b012d8mWrOdTCWeXTSdqj5VUnSnJPSS6J4RDhIPqnW7c9oljmmw7EOHl4Pb+8pO2FKSjAO x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM4PR07MB1233; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:AM4PR07MB1233; BCL:0; PCL:0; RULEID:; SRVR:AM4PR07MB1233; x-forefront-prvs: 0941B96580 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(24454002)(377454003)(33656002)(76176999)(106116001)(16236675004)(54356999)(50986999)(19609705001)(92566002)(5003600100002)(15975445007)(19580395003)(19580405001)(86362001)(19625215002)(110136002)(5002640100001)(74316001)(66066001)(189998001)(76576001)(11100500001)(3660700001)(6116002)(3846002)(790700001)(102836003)(5008740100001)(586003)(3280700002)(9686002)(2900100001)(122556002)(2950100001)(77096005)(5004730100002)(19617315012)(8676002)(9326002)(87936001)(10400500002)(4326007)(2906002)(81166006)(8936002)(1220700001)(19300405004)(41533002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR07MB1233; H:AM4PR07MB1233.eurprd07.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2016 08:16:25.7251 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR07MB1233 X-Topics: patch Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [PATCH 2/4] linux-generic: packet: remove vlan_s_tag and vlan_c_tag members from odp_packet_hdr_t X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Hi Bala, As this code is used in the fast path I’d rather just remove it for now. When someone is actually implementing this use-case he/she can choose how to do it without causing performance degradation. Before this patch set the size of odp_packet_hdr_t was 360 bytes (!). Simply by removing unused odp_packet_hdr_t members and optimizing the packet_init() function I was able to increase maximum packet throughput by almost 1 Mpps (odp_l2fwd, 64B packets, netmap/dpdk pktio). -Matias From: EXT Bala Manoharan [mailto:bala.manoharan@linaro.org] Sent: Friday, May 13, 2016 9:39 AM To: Elo, Matias (Nokia - FI/Espoo) Cc: LNG ODP Mailman List Subject: Re: [lng-odp] [PATCH 2/4] linux-generic: packet: remove vlan_s_tag and vlan_c_tag members from odp_packet_hdr_t There is a use-case in classification, where the packet can be classified based on outer/inner vlan tag and for that specific use-case it is better to store the vlan value in packet header field. Regards, Bala On 12 May 2016 at 18:06, Matias Elo > wrote: There is no way to read vlan tags in the ODP API, so don't save them. Signed-off-by: Matias Elo > --- platform/linux-generic/include/odp_packet_internal.h | 4 ---- platform/linux-generic/odp_packet.c | 4 ---- 2 files changed, 8 deletions(-) -- 1.9.1 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 508adf8..2a12503 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -143,8 +143,6 @@ typedef struct { uint32_t l4_offset; /**< offset to L4 hdr (TCP, UDP, SCTP, also ICMP) */ uint32_t payload_offset; /**< offset to payload */ - uint32_t vlan_s_tag; /**< Parsed 1st VLAN header (S-TAG) */ - uint32_t vlan_c_tag; /**< Parsed 2nd VLAN header (C-TAG) */ uint32_t l3_len; /**< Layer 3 length */ uint32_t l4_len; /**< Layer 4 length */ @@ -184,8 +182,6 @@ static inline void copy_packet_parser_metadata(odp_packet_hdr_t *src_hdr, dst_hdr->l4_offset = src_hdr->l4_offset; dst_hdr->payload_offset = src_hdr->payload_offset; - dst_hdr->vlan_s_tag = src_hdr->vlan_s_tag; - dst_hdr->vlan_c_tag = src_hdr->vlan_c_tag; dst_hdr->l3_len = src_hdr->l3_len; dst_hdr->l4_len = src_hdr->l4_len; } diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 8681c08..436265e 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -42,8 +42,6 @@ void packet_parse_reset(odp_packet_hdr_t *pkt_hdr) pkt_hdr->l3_offset = ODP_PACKET_OFFSET_INVALID; pkt_hdr->l4_offset = ODP_PACKET_OFFSET_INVALID; pkt_hdr->payload_offset = ODP_PACKET_OFFSET_INVALID; - pkt_hdr->vlan_s_tag = 0; - pkt_hdr->vlan_c_tag = 0; } /** @@ -1223,7 +1221,6 @@ int _odp_parse_common(odp_packet_hdr_t *pkt_hdr, const uint8_t *ptr) vlan = (const odph_vlanhdr_t *)parseptr; ethtype = odp_be_to_cpu_16(vlan->type); - pkt_hdr->vlan_s_tag = odp_be_to_cpu_16(vlan->tci); offset += sizeof(odph_vlanhdr_t); parseptr += sizeof(odph_vlanhdr_t); } @@ -1232,7 +1229,6 @@ int _odp_parse_common(odp_packet_hdr_t *pkt_hdr, const uint8_t *ptr) pkt_hdr->input_flags.vlan = 1; vlan = (const odph_vlanhdr_t *)parseptr; ethtype = odp_be_to_cpu_16(vlan->type); - pkt_hdr->vlan_c_tag = odp_be_to_cpu_16(vlan->tci); offset += sizeof(odph_vlanhdr_t); parseptr += sizeof(odph_vlanhdr_t); }