From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DFC50A0562; Sat, 4 Apr 2020 17:58:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2D17B2BEA; Sat, 4 Apr 2020 17:58:11 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 708FAF04 for ; Sat, 4 Apr 2020 17:58:09 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 034FvPSW026249; Sat, 4 Apr 2020 08:58:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=YBsfl9R4lN/q8ME+abgiWifulsiIBkHNheTavWlKIVU=; b=eFqNwn1ddWPC0aQJaJAw2NIZaD4+G9kEz1E48XLJ4ly4EA8hIP9sktGC9kDXwNkQhJmZ HgYfDE9Eg/gy1d2NGBVULw97duV0UzrVY9QmYbM+m85zffM5sSjwLW2kkG41oyftAuSh NIt1HaKuBk/Xu0OSPICuqRn+h9YOWqQZoXHb6hDC+nOWqFdxgk5r/GCp4lxfoPloCcmk ax22TCmGrPf2aDfV5oskuLVlGiw8GxoXje9fvwswAA7uH8SJCjB9LDBmPpxQdOvoYVjd glUhwKbWAKtmFJBkB3iHbyd0QeQ4ldKec93qBdynF3YjM5MTm7D/+7bHVbVoIxm8nvtJ 8A== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 306qkqrw5d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 04 Apr 2020 08:58:07 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 4 Apr 2020 08:58:06 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 4 Apr 2020 08:58:05 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Sat, 4 Apr 2020 08:58:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K6vP4i8WII/TEDY4IKt0e78cv9X9cVOfjeQzAEoupDDaZFwSwgmWHMzManeGX9T/CjNOfF1O9R61IDZpXJAEqHLq8nszYmeGFySMBr9TZgarSwJZpKDCzd5KM3fNoejk9ChBC332Hxtr8Uj3yaZzL9rZoxALr5aFsegrtyldYpTvfQ6Sgk/44/58QEu5Do8Kc95Z/cM8PdTxVgFjfjfL54zPc5DF6kiBGiIeDE5/5b/u7JUdtIAiemBzrKXgrpIzuTFvzvhVNheoqvqr2GL1z4vN7DBZNvmjiPMfCDoqT/6PWlcXyG8ITHWEFrSvbnM3Gussfts3VdAQf6G2VkhorQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YBsfl9R4lN/q8ME+abgiWifulsiIBkHNheTavWlKIVU=; b=j/uIvgna0RMRb+u6JnyRnDy9dnPgM9t+ov6t/D5hwVR7GGh/Mjz773WK6AzsxmrH+fdEfmZ8vI3gtVygfmwciatbz//VKrCgYM9OvVTvuJbuGSau4GmF/bcGUTP2Y+DrecOoRye3x8hGuu93ljDuVKaLfBHuqQCwBKilqSsNusBSQr0JAI2CuwIIDPCdLDgLsLizPZ9/7HYuzhODfDloP8bvogQ3sC3c0ojMexECacOCxXduV/V3jpYSwCPIfBVI+reTaNU1P9j4d4cEYTqsRJSQqI21m31j5hPIK66W3DpT6d+dS3bP/SJmSFNUxHOUt5EhjUTU3m+BE6kbwudZnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YBsfl9R4lN/q8ME+abgiWifulsiIBkHNheTavWlKIVU=; b=fsWsrBtc3DIdVj0gwxxTO+i36b5lprBgqiRIDsHjyjcX1ZJvvYOWbL3YxGLDN2hfSLkpt+ZuLMJRS23ZQTqFMall5STy6DYgAKsryRQFyv7nFm/zTI/KFYJ2ge1CU90X1P/2Pib4RcSSBZLtKChfoIomGO+LZRj3dKu8FqpXLfc= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (2603:10b6:910:7b::32) by CY4PR1801MB1989.namprd18.prod.outlook.com (2603:10b6:910:7b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Sat, 4 Apr 2020 15:58:03 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::7424:c6cd:94f2:b27b]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::7424:c6cd:94f2:b27b%4]) with mapi id 15.20.2878.017; Sat, 4 Apr 2020 15:58:03 +0000 From: Pavan Nikhilesh Bhagavatula To: Aaron Conole , "dev@dpdk.org" CC: Konstantin Ananyev , Sunil Kumar Kori , Anatoly Burakov , "Chas Williams" , Bruce Richardson , David Marchand Thread-Topic: [dpdk-dev] [PATCH v3 4/4] ipfrag: add unit test case Thread-Index: AQHWCFUEsf6ZKnUTckGjU1p2dMG+E6hpHvog Date: Sat, 4 Apr 2020 15:58:03 +0000 Message-ID: References: <20200401131849.2209336-1-aconole@redhat.com> <20200401183917.3620845-1-aconole@redhat.com> <20200401183917.3620845-5-aconole@redhat.com> In-Reply-To: <20200401183917.3620845-5-aconole@redhat.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.181.63.42] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 81a05966-f514-4f79-8527-08d7d8b0f53e x-ms-traffictypediagnostic: CY4PR1801MB1989: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:751; x-forefront-prvs: 03630A6A4A x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR1801MB1863.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(346002)(39840400004)(376002)(136003)(396003)(366004)(9686003)(55016002)(81156014)(110136005)(7696005)(66556008)(64756008)(66446008)(2906002)(6506007)(4326008)(54906003)(66946007)(316002)(5660300002)(66476007)(76116006)(52536014)(86362001)(26005)(8936002)(81166006)(71200400001)(478600001)(33656002)(8676002)(186003); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rmvBIX6w3OPOHQaCDJ109v2MGuFLUDcxUAXJE/2B33CmRkRCJfWEtDcA0bUaTeZzH8T55bkwuqRuhbdjXmDS+eED4zuzzHyH3+ktHfYRTUAgkVDCWUphLqpvLKdZ/lUQs1cAuT/uRtNb2F20u8QIqdk5usoh7txU0ch/1GWbVBdFYntRLEDEv5U/yrPluUrjbqsZdHyG4glmbyFn3cG7VhiL4T9Jx6maGVNeworsksueDeMtYo+RScqWIFSnow/nQYdLdsJoDJN3YX0T1DUrJbpnVH6OwVWdI1gON7S+lUbMKSZTp1swUhZI894XdWqroF7ySf8SkTMemb2CD3SehL4lUb//yGyAKFs+nd5VM5+bSV7ruFVchKKCCaPS1GqRRNc2cOMil6ccqRxmETQ/5xmK9qOSZjJGGDj2AdcXgL9QxKPRE5vVt9s/0qvbg6LN x-ms-exchange-antispam-messagedata: k74EKtxS9kK9e+fCHUBm/Kjlsxw/jPYCIwYsIv8mOwWub5Ujgp7K5srvcJystKHgAfLG/50sC2DF6LovRimVAFxpx8iAsllPiTJa3h0iRGxLmPzRAo+jyX2qMGmae+iQZPcm+zRd6q4h0jbIQ2vKXQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 81a05966-f514-4f79-8527-08d7d8b0f53e X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2020 15:58:03.5564 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sTIXCCO2+CXlZEydWaPTcj9Tcm7gHxGN7ynd66Tf8hA1PiEG1/SeEPuU4Udw8TpQ9DJO1kczy+6d5pGCYWU0Te+LMbUkcQ8XjKnFm52g1QE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1989 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-04_12:2020-04-03, 2020-04-04 signatures=0 Subject: Re: [dpdk-dev] [PATCH v3 4/4] ipfrag: add unit test case 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >Subject: [dpdk-dev] [PATCH v3 4/4] ipfrag: add unit test case > >Initial IP fragmentation unit test. > >Signed-off-by: Aaron Conole >--- > MAINTAINERS | 1 + > app/test/meson.build | 2 + > app/test/test_ipfrag.c | 277 >+++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 280 insertions(+) > create mode 100644 app/test/test_ipfrag.c > >+static int >+v4_allocate_packet_of(struct rte_mbuf *b, int fill, size_t s, int df, >+ uint8_t ttl, uint8_t proto, uint16_t pktid) >+{ >+ /* Create a packet, 2k bytes long */ >+ b->data_off =3D 0; >+ char *data =3D rte_pktmbuf_mtod(b, char *); >+ >+ memset(data, fill, sizeof(struct rte_ipv4_hdr) + s); >+ >+ struct rte_ipv4_hdr *hdr =3D (struct rte_ipv4_hdr *)data; >+ >+ hdr->version_ihl =3D 0x45; /* standard IP header... */ >+ hdr->type_of_service =3D 0; >+ b->pkt_len =3D s + sizeof(struct rte_ipv4_hdr); >+ b->data_len =3D b->pkt_len; >+ hdr->total_length =3D htonl(b->pkt_len);=09 Minor nit, please use rte_cpu_to_be_xx() for byte order conversion across t= he file. >+ hdr->packet_id =3D htons(pktid); >+ hdr->fragment_offset =3D 0; >+ if (df) >+ hdr->fragment_offset =3D htons(0x4000); >+ >+ if (!ttl) >+ ttl =3D 64; /* default to 64 */ >+ >+ if (!proto) >+ proto =3D 1; /* icmp */ >+ >+ hdr->time_to_live =3D ttl; >+ hdr->next_proto_id =3D proto; >+ hdr->hdr_checksum =3D 0; >+ hdr->src_addr =3D htonl(0x8080808); >+ hdr->dst_addr =3D htonl(0x8080404); >+ >+ return 0; >+} >+