From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA48CA0C4E; Mon, 25 Oct 2021 20:06:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB0ED40E32; Mon, 25 Oct 2021 20:06:49 +0200 (CEST) Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) by mails.dpdk.org (Postfix) with ESMTP id 9C1334003E for ; Mon, 25 Oct 2021 20:06:48 +0200 (CEST) Received: by mail-il1-f182.google.com with SMTP id a8so13934071ilj.10 for ; Mon, 25 Oct 2021 11:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j0X7bsqGUomSMmVaUp1BRuq8LFZ3dckHbkh1cX60Vyw=; b=a5b78i+We3tr62m4i+GNj5OFIzdcGx2xS0jf5fPMzqZzeDftMA3x/gFcPbGt4Sxyoa PxyVtP2Pzh3tFQBqfZWYL0pPkUbpXPS8Y6xpLJ51g96XUkYCBh7ZNM/0kg+pLH3hNXJK mf3xHOWxUmh1lbFvRUcbwR+MVoAOPkybJbWmY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j0X7bsqGUomSMmVaUp1BRuq8LFZ3dckHbkh1cX60Vyw=; b=M8mnzYYMQeah6kMK8Dm5QHDWeKCS2rf5pag/7unfDQXRMZf+rxF5M8kASTymxXwuHs l9CIjPPz3rrkmIj1IWw7ryjDH2Q50V+WZCrDp8EE5kkB6gAvvO5iPOkmK7T0AwE1zKWo jbyVz0wCKn4AMQx2wMzQvluUSHIQy0gcdEVeiR9XrbzIC/0iA7HZz2D+A4O5tN1EAUPI mTplVQrjdrkYz/DVeGa1bVPUs+JiM5mHiBzs1/F/dvwYlYRHNX0Itw6HUcEElZZYO7wf xWLZreScZY20jw51vIyfyPNgsnN8bK4XZAKbVHwjcRrWQB3BCgvuIhUjZBrlk3NGQCeV xlCg== X-Gm-Message-State: AOAM533P9GyNVGp0l9q+jy/QoI+Kz7BUJFFjGDsnWdautoiqThzd4tPH spjqFa2MyxNcS2DnGLyTMkGGeUWTXEjYB1nyOZClsg== X-Google-Smtp-Source: ABdhPJzUqmIdoCRRMHC4Ja3owiUfrvpgsnBV003SQrz3/+dexqIGy2IBERcA8gKcYIYJhgkVL4Bh1GhSO/56WCtLBQY= X-Received: by 2002:a92:c241:: with SMTP id k1mr9789311ilo.26.1635185206899; Mon, 25 Oct 2021 11:06:46 -0700 (PDT) MIME-Version: 1.0 References: <20211024164237.2116166-1-andrew.rybchenko@oktetlabs.ru> In-Reply-To: <20211024164237.2116166-1-andrew.rybchenko@oktetlabs.ru> From: Ajit Khaparde Date: Mon, 25 Oct 2021 11:06:31 -0700 Message-ID: To: Andrew Rybchenko Cc: Xiaoyun Li , Rosen Xu , Ferruh Yigit , Konstantin Ananyev , Ivan Ilchenko , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix MTU configuration before device start X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Sun, Oct 24, 2021 at 9:42 AM Andrew Rybchenko wrote: > > There is no point to do rte_eth_dev_mtu_set() before configure since > set MTU value is overwritten on configure anyway. So, setting of MTU > before configure is rejected now on ethdev level. > > If testpmd is going to do configure (e.g. just after testpmd start > with disabled devices start up or any configuration changes in stopped > state which require reconfigure), just save requested MTU in device > config to be applied on reconfigure. > > Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length") > Fixes: be0433cf953c ("ethdev: forbid MTU set before device configure") > > Signed-off-by: Andrew Rybchenko Acked-by: Ajit Khaparde > --- > app/test-pmd/config.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index a18871d461..3b97164302 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -1241,10 +1241,12 @@ port_mtu_set(portid_t port_id, uint16_t mtu) > if (port_id_is_invalid(port_id, ENABLED_WARN)) > return; > > - diag = rte_eth_dev_set_mtu(port_id, mtu); > - if (diag != 0) { > - fprintf(stderr, "Set MTU failed. diag=%d\n", diag); > - return; > + if (port->need_reconfig == 0) { > + diag = rte_eth_dev_set_mtu(port_id, mtu); > + if (diag != 0) { > + fprintf(stderr, "Set MTU failed. diag=%d\n", diag); > + return; > + } > } > > port->dev_conf.rxmode.mtu = mtu; > -- > 2.30.2 >