From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60059.outbound.protection.outlook.com [40.107.6.59]) by dpdk.org (Postfix) with ESMTP id 122F01B4E2 for ; Sun, 13 Jan 2019 12:37:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MmJmgqv1OskfmxOHr1Dz9MrUPULZdqhU0UvofZQ83l8=; b=UUttspEalEIxUr6x3qCLxc7or9DtPnxhvlT1z6Yoi+oIJEvZoqOEbchoCNsveotC7rZSQfLcv6ykYOr+sMttH+paHKySwhboeNeBuyzEhkErWEe1qc2V4XpLzZhJdZjBb1izJO82S+4c8g7QEOZA61yvLuWzMX5klgqmPJUk5dQ= Received: from AM0PR05MB4388.eurprd05.prod.outlook.com (52.134.91.161) by AM0SPR01MB0053.eurprd05.prod.outlook.com (20.178.115.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.18; Sun, 13 Jan 2019 11:37:06 +0000 Received: from AM0PR05MB4388.eurprd05.prod.outlook.com ([fe80::a518:a588:97d2:cf4b]) by AM0PR05MB4388.eurprd05.prod.outlook.com ([fe80::a518:a588:97d2:cf4b%4]) with mapi id 15.20.1516.019; Sun, 13 Jan 2019 11:37:06 +0000 From: Noa Ezra To: "konstantin.ananyev@intel.com" CC: Asaf Penso , "dev@dpdk.org" , Noa Ezra Thread-Topic: [PATCH v2] examples/ip_fragmentation: support big packets Thread-Index: AQHUqzRPF9b29A/QA0qS8X+1PLXyBg== Date: Sun, 13 Jan 2019 11:37:06 +0000 Message-ID: <1547379358-17310-1-git-send-email-noae@mellanox.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 1.8.3.1 x-clientproxiedby: CWLP123CA0028.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:58::16) To AM0PR05MB4388.eurprd05.prod.outlook.com (2603:10a6:208:59::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=noae@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0SPR01MB0053; 6:5Snbtr4BBXw2bfEE09hvfA6IhLdS7MCnIBEA/jWVyIEVYWL8BM5ggmcbS1uG7SMyliTAZaiOGa1ysWfQeQE0tbAZgJkb5rSD225HUqJD2PvrhSGUVfvbomSK/E2vXDef3zU9Frr5mJEIHxvtNQ7eGDDOS8QHTiJmnFBGEUqpmIJaC79B9dV5iQI1qKr9z7FIxXFDmMsuYg3HtetTyiOrUlHkRMQBT6aVwlVWhwfPH/VPXdtpHTDPFW9aSkQSxqcwr6dlXV3pHl156MtWRgOfvtoWb/mIsGx78TQEmHC8gtvyUFaGVql7CEM89qbkTWsX+huxlWHEc5VwY9wrsqmi9zXKWv3Jb1cYvDFYTZ0EegWjtfHM/t4xf9SV36g3KMAy32bKURa0P7R+9WCLBmW+SS1znD+WUX3F205ADsLvN32C92gCnPdFyPPrQbcxU5viKT6iandDt6pxOI1+imeLsA==; 5:1EDtTJV8Eo/4sDq3yyrL1BWK7B/s2pl5LLmkbfWv07YWofoLFZpiRTsXLTVbnsqmaezFjX7Jxw6xA/X8zOfptB15DEbduGKqMtcK6a91iyqRKBWe1mDBbixbB+37QsACgzosGLX2P9NK078xi/DXIoAeZr/rI0UiHiyMWe/sCdFM19xAirL2LpVkoSm1sEBYIfin9kJkZKsGZYLQMRLVeQ==; 7:qh4GN8b+YX5loZSERAIANknNM3ix3xKnXP2/kwZTyAVFlaiN2ajBNGJRYcT9R9YoRKSWHY3v0x2jEp/SM9c26YB2yKYSZOEQzn8uD23NLy55Qwv6HMZBXzDgK9XApLNSUK6q2cSi/AE/Ehscyl+09g== x-ms-office365-filtering-correlation-id: e554e9da-d0ea-42b1-ecdf-08d6794b71e0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0SPR01MB0053; x-ms-traffictypediagnostic: AM0SPR01MB0053: x-microsoft-antispam-prvs: x-forefront-prvs: 0916FC3A18 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(136003)(376002)(346002)(366004)(189003)(199004)(2501003)(36756003)(26005)(2616005)(476003)(486006)(7736002)(2906002)(256004)(14444005)(99286004)(53936002)(186003)(102836004)(6916009)(86362001)(25786009)(5660300001)(2351001)(305945005)(105586002)(97736004)(106356001)(6506007)(386003)(50226002)(66066001)(68736007)(4720700003)(8936002)(81156014)(316002)(107886003)(71200400001)(71190400001)(81166006)(14454004)(6486002)(6436002)(6512007)(8676002)(5640700003)(4326008)(52116002)(6116002)(3846002)(54906003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0SPR01MB0053; H:AM0PR05MB4388.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: TuxLNVwntSN82/VFfY6feunabVlYqyGzb2X3A8Iy8JSfW1unhzFYbhlaz7uwOyAjLg7LOJd6qgEHNAykl2JYD3oMhEfrADdfpdUXVO0VOO3OBaEZItMN+AcBtRNc8wUU1RE8u7ZxYbkXHQJUzwwf5ZJ9yjKE/hiUmNx62NXXeoWoF1KygET95BQfBxOI8ER4NyQ454BxChMJBaWrUFpnuMfmfkD4SzGGdnpPXrRhLZ44vXSkhfgsYfc8SjF7c+Adm8z6pH38KKzeNURrpIZsSpGiKDd9sh83eSbUkQZ6ZD7xlmvyanAwuNgayiAedR40o9iosSSdktQIn2veQwmAkq4mulahXjVrbgCbngABeH7ADq/oqTMnvIxk8/DuZ7oZ47acoBXyglGtbhcJ5aqJpsEYI7gbJE5xAC9ORUAb1/k= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e554e9da-d0ea-42b1-ecdf-08d6794b71e0 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2019 11:37:05.4764 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0SPR01MB0053 Subject: [dpdk-dev] [PATCH v2] examples/ip_fragmentation: support big packets 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: Sun, 13 Jan 2019 11:37:08 -0000 In some vendors the RX and TX configuration must be the same, therefore the MTU size need to be equal to max_rx_pkt_len. The MTU is the largest size packet in bytes that can be sent on the network, therefore before changing this parameter, the NIC could not receive packets larger than 1500 bytes, which is the default MTU size. In addition, scatter-gather need to be enabled in order to receive frames bigger than mbuf size. Signed-off-by: Noa Ezra --- v2: move set_mtu() to be done after dev_configure(). examples/ip_fragmentation/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/m= ain.c index 17a877d..8d789b4 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -141,6 +141,7 @@ struct lcore_queue_conf { .max_rx_pkt_len =3D JUMBO_FRAME_MAX_SIZE, .split_hdr_size =3D 0, .offloads =3D (DEV_RX_OFFLOAD_CHECKSUM | + DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_JUMBO_FRAME), }, .txmode =3D { @@ -935,6 +936,16 @@ struct rte_lpm6_config lpm6_config =3D { ret, portid); } =20 + /* set the mtu to the maximum received packet size */ + ret =3D rte_eth_dev_set_mtu(portid, + local_port_conf.rxmode.max_rx_pkt_len); + if (ret < 0) { + printf("\n"); + rte_exit(EXIT_FAILURE, "Set MTU failed: " + "err=3D%d, port=3D%d\n", + ret, portid); + } + ret =3D rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) { --=20 1.8.3.1