From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30072.outbound.protection.outlook.com [40.107.3.72]) by dpdk.org (Postfix) with ESMTP id 16AD52C15; Wed, 26 Dec 2018 14:08:29 +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=ynZy1Z/S/Ia/x1J0sNoavJiU55Kz8sxiTlTJOjxhb1Y=; b=VUrgThrEKIMNZLNZKaQlLMs+YD+uWCaRzIKDO6WaMNEmkZrYwCALII5dB6IIucgpACF2Pmfz35AO7Ybqg0QCUNtc0bzlAfWFfg//q/szGu40h3F4mCfuqZg0y14IOLQ2P0XFiTLaO3IqSPbYnSZq6eq+l1djtw3eiE7osVqSo08= Received: from AM6PR05MB4389.eurprd05.prod.outlook.com (52.135.162.30) by AM6PR05MB4215.eurprd05.prod.outlook.com (52.135.161.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.21; Wed, 26 Dec 2018 13:08:27 +0000 Received: from AM6PR05MB4389.eurprd05.prod.outlook.com ([fe80::f82a:5665:b063:efab]) by AM6PR05MB4389.eurprd05.prod.outlook.com ([fe80::f82a:5665:b063:efab%2]) with mapi id 15.20.1471.019; Wed, 26 Dec 2018 13:08:27 +0000 From: Noa Ezra To: "konstantin.ananyev@intel.com" CC: Asaf Penso , "dev@dpdk.org" , Noa Ezra , "stable@dpdk.org" Thread-Topic: [PATCH] examples/ip_fragmentation: support big packets Thread-Index: AQHUnRwXx7uv9BfBpkS9xbV3ATUIYA== Date: Wed, 26 Dec 2018 13:08:27 +0000 Message-ID: <1545829642-18896-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: LO2P265CA0390.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:f::18) To AM6PR05MB4389.eurprd05.prod.outlook.com (2603:10a6:209:42::30) 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; AM6PR05MB4215; 6:ynH3VXH4VTSPpqe5nJyrS0xY1UTPGCTcztTc4obKWjnWToCKX7UDKdUmI8imUyKEVw00C0iAP4cWnP4GSVT1iY6Z7/2TCO63XQeFyYy1m3BqkINg3Q+ExI05hdDKQ7dNdbTEYQIy3SBcESOMqa37X00By6419/hw/i8Z3TQiOSOOo1lDDH/HRP+TVo6j6G0c4eTBrHrdrUyDlKogcHGZ+wVY2mD70OGJrUp5+QDIPZtvNhg1wBbAOaRO9lkpd0uR01mhAAoUSB5PfS1+AxDKTO1sq/oao0TijZLkSOVpKGyw8Ul23oQnpoYybT/JBn5IQNaLMMMQe+hHsfzJdQR895VaVndlB9l8fY4F4UpkM782nuDnPPbV+BeXhWoabnpPFspcIQy8X7y4KjM3YaKG4uWChdmvadME1GYiuQejNtkMHL46I9xp3y4FnQJgi0SSY6qj7HM2Nx/kkMn32ednaQ==; 5:eiAnQR2HorhcMH7HIb4UR+lMCHAfN/+vsy+vLzv6UUmkH/n/4ejXYLYmTPGA3B5GCJCsKF4oWgt81kNbn7g8rcSapFtN0lG6Oa1iOMcG95qd7e+sOpBCzCjFLXpHQIBS3MgFoj21dHUHtWISm/5kvxJJYnY4JjwLBfBL6gYQ+6o=; 7:plpg2Z0ggJBETOTbholDcQrPiXOVZcwBJpoXOUK4glN5/nHgOPCCAIi/6+7cyNeoGVmKrqjzD1mVYGB32hJfx9IDY9Jc7GgvV1DO4CjH988sDCkGynmAh02EqDVSmrxmzDCHzkj8mBO4q4qEKBjLvw== x-ms-office365-filtering-correlation-id: c3b6ea23-bef2-48e3-3efd-08d66b33394c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4215; x-ms-traffictypediagnostic: AM6PR05MB4215: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4215; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4215; x-forefront-prvs: 0898A6E028 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(39860400002)(346002)(136003)(189003)(199004)(14444005)(256004)(50226002)(99286004)(6436002)(8676002)(486006)(8936002)(6116002)(52116002)(2501003)(25786009)(5640700003)(316002)(3846002)(54906003)(4326008)(2616005)(97736004)(6506007)(81156014)(81166006)(6486002)(478600001)(386003)(68736007)(476003)(36756003)(2351001)(7736002)(305945005)(71190400001)(105586002)(53936002)(66066001)(6916009)(4720700003)(106356001)(2906002)(71200400001)(26005)(86362001)(6512007)(5660300001)(102836004)(14454004)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4215; H:AM6PR05MB4389.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: iJYNqx3g+ZlqAhodHsm0kDX4sNnSxqHP1POhWTJ8kNp4W0JLCxyxtmvMpVg+32Dym5B4kzvYJrEo0q8CRbhxM28vKK1M1X6WKSBga9WbXzveFse41zMXkypPMe01tV/dBpCZghe0t3FFmUUiwuNRafteQ+NNn9DcDHp9WdhMNK5SOezZJ7UULWGx+9O5SuEEGh4n9kVhVI9UnCyzoNTsmsqOMdeQC4ROVMvdU6SAmQ5rIAk+KVgqb+rpk9ljaJyZWy54HW6JOimU8tnx0Ym3OttPfl/i6Bq+L0+BNp/WNqai+KZXwiwNeffe2bcATFfB 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: c3b6ea23-bef2-48e3-3efd-08d66b33394c X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Dec 2018 13:08:27.1588 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4215 Subject: [dpdk-dev] [PATCH] 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: Wed, 26 Dec 2018 13:08:29 -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. Cc: stable@dpdk.org Signed-off-by: Noa Ezra --- 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..d294f5f 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 { @@ -892,6 +893,16 @@ struct rte_lpm6_config lpm6_config =3D { dev_info.max_rx_pktlen, local_port_conf.rxmode.max_rx_pkt_len); =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); + } + /* get the lcore_id for this port */ while (rte_lcore_is_enabled(rx_lcore_id) =3D=3D 0 || qconf->n_rx_queue =3D=3D (unsigned)rx_queue_per_lcore) { --=20 1.8.3.1