From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00077.outbound.protection.outlook.com [40.107.0.77]) by dpdk.org (Postfix) with ESMTP id 93A452BC7 for ; Wed, 26 Dec 2018 13:15:32 +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=ZR3v7z6EQxooQpBNscrP5nJJHR4WDKRHElQra9Hoauc=; b=eQ4qLxMNW/djYWrMUrU2fAIYekqzavB3YwwalW6JUZVZd15S8UQ9D0vsOIlCbfzVWiS+tuC2eNtv8kzHX3xFETmoGrscy1FeoJ6XX4a6iLQN1xLUrMjyNaqlt8Ycw6kKFMyvVTbHf8qL6S1i9Xs+BMcm2A/i4j4S2Ul+fUWyNOo= Received: from AM6PR05MB4389.eurprd05.prod.outlook.com (52.135.162.30) by AM6PR05MB5351.eurprd05.prod.outlook.com (20.177.197.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Wed, 26 Dec 2018 12:15:30 +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 12:15:30 +0000 From: Noa Ezra To: Noa Ezra CC: "stable@dpdk.org" Thread-Topic: [PATCH] examples/ip_fragmentation: support big packets Thread-Index: AQHUnRSxfJ601Tet302AnkKraJSWRQ== Date: Wed, 26 Dec 2018 12:15:30 +0000 Message-ID: <1545826517-14579-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: CWXP123CA0009.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:73::21) 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; AM6PR05MB5351; 6:vRB3LpPQHxbBXteiWYqu+0mdEfm1w9XJBTrmivCtwGBTfL63WbrJXFZHp0yoNACJbrPVxwRg5hA9y2vpjb5aUhG6CXV0H4B7FgBSVPHKucuOx5+5yAc58tiMCx1JAhRJYYkiFXRl3xhGFSv5DXcN37addyXqZJ/Ttp0coaUyV4ZilGdXslO+lItkMSaGzEV/VOfLqLY2WNIF9rqvO56XKVCEVyMPD+Osslvoq9quMLVUva/AXpZnqtPWo86k3wbiGIXa9BHYY9pFfi2Xe6hpa9vRyKEB821mIsqiLYyQ9ocVeHSYI77RD0TF6Iv4KT0L/UjrTG8CA2lUf6CNpky+6H1yh647prflmxwxaz2QFKE5XmmUb+NFv9Sr9usvoZ3nrhN6FrjWOQ5kcncug6GKINDnDYs4/y/oebiIC8LMIeCFXUmUU8vaOMmHbs1RL0bbue0JqnXMjZswP16C8x3Rsg==; 5:plLjxP+n05WFhQ1TOFqLcNL82um7bBRHqDSHmV0fmml1SbUtk8p07kuhq4DP2oV6ZYJ2wJuTeJbAiuCven+Q83TiP+2JAwyjQNzYbSpiF4F1ijfhKMn/SoEjDRQvstnNNnyjSRJnKeEKxmKH7C9mq3K7VDYbwdkrgjOx5pdLi5c=; 7:6VDKteYHEZCWFgwaq9HFNwHs0qwMlGlt29D6BwzJl8tuM8ST7dSnvelD3GvWLQzVO68EmzsAHLc6kVEUqukYns3FS9j08/V8i5Ti8psmL4xVQme9itHdsZIPwbwblvma8RDDx/Fi9wXaUuJ50hPz8g== x-ms-office365-filtering-correlation-id: 5994a920-37a4-4a59-50cf-08d66b2bd3ce 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:AM6PR05MB5351; x-ms-traffictypediagnostic: AM6PR05MB5351: 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)(10201501046)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB5351; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB5351; x-forefront-prvs: 0898A6E028 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(376002)(346002)(39860400002)(199004)(189003)(386003)(6506007)(81166006)(52116002)(50226002)(105586002)(53936002)(6862004)(102836004)(478600001)(25786009)(7049001)(186003)(86362001)(8676002)(4720700003)(4326008)(26005)(71200400001)(71190400001)(316002)(106356001)(66066001)(2906002)(6116002)(81156014)(99286004)(6436002)(6200100001)(476003)(5660300001)(3846002)(6486002)(14454004)(37006003)(256004)(14444005)(305945005)(2616005)(36756003)(68736007)(8936002)(6512007)(7736002)(97736004)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB5351; H:AM6PR05MB4389.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: 9oC6mm/CMTDxYQpUZJ45y2BlLrybC3KODin80ovdlMIWa0w/e1XZV9KEUh3KwAlutQtEGcbyvgYEHGfxFIIdE7PSOMOWmoN37aHqUBrZEN5stt0Tj3F6KMsRtL4bRA4TuDaphymb3eNHezXZwk4jDdYw3GSunZOwA80rxO3ci7NmZTLalvY0xgIT+PHejhk+fh7h9MXfLyBDnzAy0WRe4xqI8obhaQsns+i30k+33ADTwok7fPFnbdQNxuO8XQLG5up8b0PLJyoWayrbGCtrqlQis/3+v+cBFdQJk4nxEdYe8QbcSp47MHZrr5aOO8Nz 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: 5994a920-37a4-4a59-50cf-08d66b2bd3ce X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Dec 2018 12:15:30.4175 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5351 Subject: [dpdk-stable] [PATCH] examples/ip_fragmentation: support big packets X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 12:15:32 -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 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/m= ain.c index 17a877d..7420420 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 { @@ -425,7 +426,6 @@ struct rte_lpm6_config lpm6_config =3D { * Read packet from RX queues */ for (i =3D 0; i < qconf->n_rx_queue; i++) { - portid =3D qconf->rx_queue_list[i].portid; nb_rx =3D rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); @@ -777,7 +777,6 @@ struct rte_lpm6_config lpm6_config =3D { RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket %i\n", socket); snprintf(buf, sizeof(buf), "pool_direct_%i", socket); - mp =3D rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket); if (mp =3D=3D NULL) { @@ -892,6 +891,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) { @@ -927,7 +936,7 @@ struct rte_lpm6_config lpm6_config =3D { local_port_conf.txmode.offloads |=3D DEV_TX_OFFLOAD_MBUF_FAST_FREE; ret =3D rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue, - &local_port_conf); + &local_port_conf); if (ret < 0) { printf("\n"); rte_exit(EXIT_FAILURE, "Cannot configure device: " @@ -936,7 +945,7 @@ struct rte_lpm6_config lpm6_config =3D { } =20 ret =3D rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, - &nb_txd); + &nb_txd); if (ret < 0) { printf("\n"); rte_exit(EXIT_FAILURE, "Cannot adjust number of " --=20 1.8.3.1