From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: [PATCH v2] examples/ip_fragmentation: support big packets Date: Mon, 14 Jan 2019 12:55:37 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258010D903A68@irsmsx105.ger.corp.intel.com> References: <1547379358-17310-1-git-send-email-noae@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Asaf Penso , "dev@dpdk.org" To: Noa Ezra Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 1F9541B1F0 for ; Mon, 14 Jan 2019 13:55:40 +0100 (CET) In-Reply-To: <1547379358-17310-1-git-send-email-noae@mellanox.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >=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 > Signed-off-by: Noa Ezra > --- > v2: move set_mtu() to be done after dev_configure(). >=20 > 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..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) { > -- Acked-by: Konstantin Ananyev > 1.8.3.1