From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id B60362A5B for ; Fri, 12 Feb 2016 15:08:24 +0100 (CET) Received: by mail-wm0-f50.google.com with SMTP id c200so22263795wme.0 for ; Fri, 12 Feb 2016 06:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=CxCoGApOCzUee63kySFJYA03Iy7Zk6THcjdnnqIVt1Q=; b=O/dVexbnddjc9aKx9sIutxckDtfFppCguwUJPj+jT5n5MTTeidWYlKhwEv4qN9ykZY 35ONAME6I0U4g5crs1RoTCzDlJwinHXuCDPX9eSGHDxrINWvqVngYq+G464RxGgoC2uX tG++GCwOJ6zzVJn+W+g6uQImyXz2qRn6H/E4BRh/87OlfSkerlEdDL3STavX1bVJAHCw P3lIOXxGA4nRBOVFl/FcsD7P8sD7BjtOC+W+SoIKOMiAHt1Z3ozK04bnajj+Cm7NUKXB SfwlwXL64rxqvo4gOrMxW1EP+qpklqU7JBlWczYsX5z1MwUfWizy+3XwPbJbf+zj8IF3 C0hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=CxCoGApOCzUee63kySFJYA03Iy7Zk6THcjdnnqIVt1Q=; b=WoTnb7NGEjX9qN6++S5RkMgrgOpVVYvLXBzL6HGNO6UtUcM2NjeaKqolleB0pFEYx5 XFQg7EuvGm8N7e5dOHIgD1rbLXtEc19/I7QlFbJiJA9VzXa165te1ebSIHFswu9PAHvu hPO58tLsKTQLdsKkSZ8eox+p5KTUJ3C6z99Gzz6WH9sRsNVvuK6zU9J37Np+vo9owSbK nFLl4YM53cu1PwY8Yw31po0+HzJmPqHgzM936iiVZejfTjcGgH7jZ6o3hGdRyKUuGezs P6vLRUetjYYqM8su5JO70IgVx/Ma9HtnK1pcrfGfCPpgSfwT4b4UULQjlf6MXXIpN4CL ndbA== X-Gm-Message-State: AG10YOSjRB2TfQCQonpMJUG9i1OU8fnXxGi4qjDAxxZSWoenD83FmTLMUlJ+iY//Ubf2Gywj X-Received: by 10.194.209.204 with SMTP id mo12mr2076777wjc.69.1455286104568; Fri, 12 Feb 2016 06:08:24 -0800 (PST) Received: from [10.16.0.205] (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id jc7sm12275595wjb.33.2016.02.12.06.08.23 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Feb 2016 06:08:23 -0800 (PST) Message-ID: <56BDE749.1000409@6wind.com> Date: Fri, 12 Feb 2016 15:08:09 +0100 From: Julien Meunier User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: "Zhang, Helin" , "dev@dpdk.org" References: <56BA1561.3060201@6wind.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] i40e: cannot change mtu to enable jumbo frame X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 14:08:24 -0000 On 02/10/2016 04:20 PM, Zhang, Helin wrote: > > >> -----Original Message----- >> From: Julien Meunier [mailto:julien.meunier@6wind.com] >> Sent: Wednesday, February 10, 2016 12:36 AM >> To: Zhang, Helin ; dev@dpdk.org >> Subject: i40e: cannot change mtu to enable jumbo frame >> [...] >> Does a mtu_set function will be developed soon in order to support jumbo >> frame ? > Yes, we will implement soon later. > Could you help to try with max_pkt_len in port config for now? > > Regards, > Helin > Hi, When I stop ports, change max_pkt_len and restart ports, jumbo frame are accepted. I was able to forward 9k frames on a i40e card. I wrote a quick and dirty patch in order to add minimal support of MTU for my test. I did not carefully study the impacts... Please advice. --- i40e: add support of mtu configuration Add support of MTU configuration. Ports are stopped and then started in order to force re-initialization of RX queues. NOTE: This patch is still experimental. Signed-off-by: Julien Meunier --- drivers/net/i40e/i40e_ethdev.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 750206b..b4d6912 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -296,6 +296,7 @@ static int i40e_dev_queue_stats_mapping_set(struct rte_eth_dev *dev, uint8_t is_rx); static void i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); +static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static int i40e_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on); @@ -439,6 +440,7 @@ static const struct eth_dev_ops i40e_eth_dev_ops = { .xstats_reset = i40e_dev_stats_reset, .queue_stats_mapping_set = i40e_dev_queue_stats_mapping_set, .dev_infos_get = i40e_dev_info_get, + .mtu_set = i40e_dev_mtu_set, .vlan_filter_set = i40e_vlan_filter_set, .vlan_tpid_set = i40e_vlan_tpid_set, .vlan_offload_set = i40e_vlan_offload_set, @@ -4681,6 +4683,37 @@ i40e_dev_rxtx_init(struct i40e_pf *pf) } static int +i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +{ + struct rte_eth_dev_info dev_info; + struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); + uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + + i40e_dev_info_get(dev, &dev_info); + + if ((frame_size < ETHER_MIN_MTU) || (frame_size > dev_info.max_rx_pktlen)) { + PMD_DRV_LOG(ERR, "Invalid MTU\n"); + return I40E_ERR_PARAM; + } + + i40e_dev_stop(dev); + hw->adapter_stopped = 1; + + /* switch to jumbo mode if needed */ + if (frame_size > ETHER_MAX_LEN) + dev->data->dev_conf.rxmode.jumbo_frame = 1; + else + dev->data->dev_conf.rxmode.jumbo_frame = 0; + + dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size; + + i40e_dev_start(dev); + hw->adapter_stopped = 0; + + return 0; +} + +static int i40e_vmdq_setup(struct rte_eth_dev *dev) { struct rte_eth_conf *conf = &dev->data->dev_conf; -- Regards, -- Julien MEUNIER 6WIND