From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BC5BE1B4A8; Fri, 4 Jan 2019 13:25:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jan 2019 04:25:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,438,1539673200"; d="scan'208";a="124064908" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga001.jf.intel.com with ESMTP; 04 Jan 2019 04:25:43 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.116]) by IRSMSX107.ger.corp.intel.com ([169.254.10.127]) with mapi id 14.03.0415.000; Fri, 4 Jan 2019 12:25:42 +0000 From: "Ananyev, Konstantin" To: Noa Ezra CC: Asaf Penso , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] examples/ip_fragmentation: support big packets Thread-Index: AQHUnRwXx7uv9BfBpkS9xbV3ATUIYKWfFaUA Date: Fri, 4 Jan 2019 12:25:42 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258010D8FDE8C@irsmsx105.ger.corp.intel.com> References: <1545829642-18896-1-git-send-email-noae@mellanox.com> In-Reply-To: <1545829642-18896-1-git-send-email-noae@mellanox.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzYzOWQ1Y2YtOTNmNS00ZDRiLTllNDctNGY1MDdkZGI3OWNhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVWlJR1dOc2k4czcwYkdSdTJNYW41WEdLMUwwb0F3WExmeUNyb1NRcWpwUzNGUG4wWU9xeHg0VWROTWxKR21BWCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Fri, 04 Jan 2019 12:25:46 -0000 Hi , >=20 > 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. >=20 > Cc: stable@dpdk.org >=20 > Signed-off-by: Noa Ezra > --- > examples/ip_fragmentation/main.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation= /main.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); > + } > + It probably doesn't matter for that particular case, but shouldn't set_mtu() be done after dev_configure()? To avoid situation when max_rx_pkt_len will be set by set_mtu() and then overwritten by dev_configure(). Konstantin=20 > /* 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) { > -- > 1.8.3.1