From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 23038A0553 for ; Mon, 17 Feb 2020 18:47:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B0501DA9E; Mon, 17 Feb 2020 18:47:07 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 3FC431DABB for ; Mon, 17 Feb 2020 18:47:05 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id g3so20763048wrs.12 for ; Mon, 17 Feb 2020 09:47:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gIwg8OgYF9J2rEF5PqViNJDppNTdo7jUMjUOjFMPqC0=; b=tNrQBpH5NvlbH/B3Z7IHDlScegirRR7Jj1P17XZGxvDgOO6fQP3Kq75ajOzLTOeoyh hES89cHUT7gNLPt2V9FsUHyz3gSJyC42KPZ0yQ4PK2CtCvPNeQIrSHNYLJAwGgLoOJtb D6jPshnoQG+rTB0OdZzOEsyq6fOYJnQMgpZZlKuScxMDUqeL2D6+TW52buyUBm9hCwdb 5Vd+sx6YAU7hkPORQ8MFKroXNYaZRNo74RKSZButAPz3OAGjFDhLXjZw6kGgTlrNz+ON f0f+EtnEkVEGnVIUMfuINo5WpGrE+0xMhmeycwn2tsyO+Uy5KqcX2/5RGzEl2ffNwUCH QBxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gIwg8OgYF9J2rEF5PqViNJDppNTdo7jUMjUOjFMPqC0=; b=iaeKHQvQw7/n/jkbxs5bSCPUN7Tw6ZOv96oJSUxvQ1IiLZgI1lpYx1pPAbluvnMcId XTnoyElqLIVceYhdNfg/OaMC39hZRWyKRPusnQfzNdXZnrAxJK7GoVZ/CRZku7p3jHVK 1nufb0HdHXH5vhl1IdA7QrygVwjrb7Ekc/tkUpb8WJ8Zj7PfJUk4oOBjZX26cNXnDUCC MRAk/e/7WpRM9aN2rnziC1vCfvuSWzaOg4bWlXPETUym3KUgeKA+c8oJKoLh9ibwEJ3y nglDQ35LvZqQClllC/vMVMA2QmiD2Cbb+vewU9Ia/cny1QD4QhD064DfYqNLTzRh6uRS aOJA== X-Gm-Message-State: APjAAAWnWH7ldxtnW0hM3GrTs3WhIrFqv0l5fvdRADqMRFnFljmuzGFD Q87R5IgUPL0FQjgJnLohA2lfiKAFHBApcg== X-Google-Smtp-Source: APXvYqwQlRIxGoHT/jb+b6xpWCRxM8vlsG2dfXR5INrTfhYUxpskBAoJU2s6us9X/gytcxKQcMIB6g== X-Received: by 2002:a5d:5183:: with SMTP id k3mr23001255wrv.414.1581961624999; Mon, 17 Feb 2020 09:47:04 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id j15sm2099739wrp.9.2020.02.17.09.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:47:04 -0800 (PST) From: luca.boccassi@gmail.com To: "Wei Hu (Xavier)" Cc: Huisong Li , Ferruh Yigit , dpdk stable Date: Mon, 17 Feb 2020 17:45:36 +0000 Message-Id: <20200217174546.25334-44-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: update Rx offload after setting MTU' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/19/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 97293db4409daeac55b1f5f019eea30f47e97d6c Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Thu, 13 Feb 2020 09:57:43 +0800 Subject: [PATCH] app/testpmd: update Rx offload after setting MTU [ upstream commit 150c9ac2df13b1ab1a0ad723f74004346d8ecd65 ] Currently, Rx offload capabilities and max_rx_pkt_len in the struct variable named rte_port are not updated after setting mtu successfully in port_mtu_set function by 'port config mtu ' command. This may lead to reconfig mtu to the initial value in the driver when recalling rte_eth_dev_configure API interface. This patch updates Rx offload capabilities and max_rx_pkt_len after setting mtu successfully when configuring mtu. Fixes: ae03d0d18adf ("app/testpmd: command to configure MTU") Signed-off-by: Huisong Li Signed-off-by: Wei Hu (Xavier) Reviewed-by: Ferruh Yigit --- app/test-pmd/config.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 8c86217796..62e547be09 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1216,7 +1216,9 @@ void port_mtu_set(portid_t port_id, uint16_t mtu) { int diag; + struct rte_port *rte_port = &ports[port_id]; struct rte_eth_dev_info dev_info; + uint16_t eth_overhead; int ret; if (port_id_is_invalid(port_id, ENABLED_WARN)) @@ -1232,8 +1234,25 @@ port_mtu_set(portid_t port_id, uint16_t mtu) return; } diag = rte_eth_dev_set_mtu(port_id, mtu); - if (diag == 0) + if (diag == 0 && + dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) { + /* + * Ether overhead in driver is equal to the difference of + * max_rx_pktlen and max_mtu in rte_eth_dev_info when the + * device supports jumbo frame. + */ + eth_overhead = dev_info.max_rx_pktlen - dev_info.max_mtu; + if (mtu > RTE_ETHER_MAX_LEN - eth_overhead) { + rte_port->dev_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + rte_port->dev_conf.rxmode.max_rx_pkt_len = + mtu + eth_overhead; + } else + rte_port->dev_conf.rxmode.offloads &= + ~DEV_RX_OFFLOAD_JUMBO_FRAME; + return; + } printf("Set MTU failed. diag=%d\n", diag); } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:16.538346827 +0000 +++ 0044-app-testpmd-update-Rx-offload-after-setting-MTU.patch 2020-02-17 17:00:15.367951305 +0000 @@ -1,8 +1,10 @@ -From 150c9ac2df13b1ab1a0ad723f74004346d8ecd65 Mon Sep 17 00:00:00 2001 +From 97293db4409daeac55b1f5f019eea30f47e97d6c Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Thu, 13 Feb 2020 09:57:43 +0800 Subject: [PATCH] app/testpmd: update Rx offload after setting MTU +[ upstream commit 150c9ac2df13b1ab1a0ad723f74004346d8ecd65 ] + Currently, Rx offload capabilities and max_rx_pkt_len in the struct variable named rte_port are not updated after setting mtu successfully in port_mtu_set function by 'port config mtu ' command. @@ -13,7 +15,6 @@ setting mtu successfully when configuring mtu. Fixes: ae03d0d18adf ("app/testpmd: command to configure MTU") -Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Wei Hu (Xavier) @@ -23,10 +24,10 @@ 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c -index f9c55a2260..9d95202233 100644 +index 8c86217796..62e547be09 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c -@@ -1215,7 +1215,9 @@ void +@@ -1216,7 +1216,9 @@ void port_mtu_set(portid_t port_id, uint16_t mtu) { int diag; @@ -36,7 +37,7 @@ int ret; if (port_id_is_invalid(port_id, ENABLED_WARN)) -@@ -1231,8 +1233,25 @@ port_mtu_set(portid_t port_id, uint16_t mtu) +@@ -1232,8 +1234,25 @@ port_mtu_set(portid_t port_id, uint16_t mtu) return; } diag = rte_eth_dev_set_mtu(port_id, mtu);