From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Meunier Subject: Re: [PATCH] i40e: configure MTU Date: Wed, 27 Apr 2016 13:43:43 +0200 Message-ID: <5720A5EF.7000206@6wind.com> References: <1461410769-16942-1-git-send-email-beilei.xing@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Beilei Xing , jingjing.wu@intel.com Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id EA61A374C for ; Wed, 27 Apr 2016 13:43:55 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id e201so34808053wme.0 for ; Wed, 27 Apr 2016 04:43:55 -0700 (PDT) In-Reply-To: <1461410769-16942-1-git-send-email-beilei.xing@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello, On 04/23/2016 01:26 PM, Beilei Xing wrote: [...] > + /* mtu setting is forbidden if port is start */ > + if (dev_data->dev_started) { > + PMD_DRV_LOG(ERR, > + "port %d must be stopped before configuration\n", > + dev_data->port_id); > + return -EBUSY; > + } According to rte_ethdev.h, only 4 return codes are supported for rte_eth_dev_set_mtu: * - (0) if successful. * - (-ENOTSUP) if operation is not supported. * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if *mtu* invalid. EBUSY should not be returned. > + for (i =3D 0; i < dev_data->nb_rx_queues; i++) { > + rxq =3D dev_data->rx_queues[i]; > + if (!rxq || !rxq->q_set) > + continue; > + > + dev_data->dev_conf.rxmode.max_rx_pkt_len =3D frame_size; > + len =3D hw->func_caps.rx_buf_chain_len * rxq->rx_buf_len; > + rxq->max_pkt_len =3D RTE_MIN(len, frame_size); > + } > + > + ret =3D i40e_dev_rx_init(pf); > + > + return ret; > +} >=20 Why do want to reconfigure rxq here ? All these operations are already done when you call i40e_dev_rx_init. i40e_dev_rx_init =3D> i40e_rx_queue_init (for each queue) =3D> i40e_rx_queue_config =3D> redefine rxq->max_pkt_len Moreover, you should move dev_data->dev_conf.rxmode.max_rx_pkt_len out of the loop. frame_size is the same for all rx_queues. --=20 Julien MEUNIER 6WIND