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 9689AA00C3; Thu, 12 May 2022 18:37:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4AB1D40E64; Thu, 12 May 2022 18:37:31 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2053.outbound.protection.outlook.com [40.107.220.53]) by mails.dpdk.org (Postfix) with ESMTP id 2AE0840DDD for ; Thu, 12 May 2022 18:37:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffgUmXP6dxTOOM0aKJAgSyMbuL0A+9C2MGXY6uoGj58YYBMBSLrxMOf2Vdb5Cx5ZlJhlLHruCd/g4LfKSZd/8mpthPB+lp+291k25ptiKAa7gtsDaa0PeIns6FQHja8X2PN3AB42LToDLUmQE5MqYl9aPSpCwaJiGk9qzQi2/wpcAbo2wwep0jWNlb1EYH2qchKh37Istom4EUDZe/djNF7JRGsAusM58SlLNeXePhWGL6GP8xiyiNkvWQlo3rdbhWilXRMED0CgpRbBvPKf2/V+e/1z4CprZKr0d4c5Plsh91lxGeO27Oto4IBwpu15jkLcDzUEZ0gvTfCO/0kv/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lo3MjrEWm+TA100ZO9gaQf+HGDfQtDvER09YpaUNkPg=; b=PEjOHGmuHGh7prbpfvy8ETQgELBXQUaTVVin/Xr/fXn94eAjmofXNWEdkyqOR0jDHwCXDy2EqffvU3Omy8OZd0wWSL2W7g5nv9HpfikqnzX9aXLzO2EA7ev9TEQoQKyeqZ8Y24dwQT85RF4duWmXnkHay28vEHeyRK3nRDrWGp11iptGgiI201Vc2JjoNYbiYGoFrkxsUNFGQBv7PoGcN+h1QbAKSvMSVK9Kqul6WWLGVeaQfbAZgpuiu+Ic2qysa/5iqbu9rZAaGuwNXvH+OnDpV5yuj1r1/9n7/qCIaNVTPykdANm2FvCnV5YIyUbgbpfF8mkN3a1RzcgmMVUqfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=huawei.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lo3MjrEWm+TA100ZO9gaQf+HGDfQtDvER09YpaUNkPg=; b=gtNrzsxFSdvzojkAmZwbG2jiVYWZecw9y7MOX/4zisejuOKjFDi7ZWAD0sM64+i/hJGruWADErPg52aiW+WBzA756iZTn0KLJ4evoCOovdeX7Ms/UDJUpjEBic1r4IXvZbUzZS9SGLIEpCmHCrk98dn2L73A/ebgyoHqu5ZWtJE= Received: from DM6PR06CA0089.namprd06.prod.outlook.com (2603:10b6:5:336::22) by DM6PR02MB5353.namprd02.prod.outlook.com (2603:10b6:5:46::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Thu, 12 May 2022 16:37:27 +0000 Received: from DM3NAM02FT008.eop-nam02.prod.protection.outlook.com (2603:10b6:5:336:cafe::88) by DM6PR06CA0089.outlook.office365.com (2603:10b6:5:336::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.22 via Frontend Transport; Thu, 12 May 2022 16:37:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch02.xlnx.xilinx.com; Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT008.mail.protection.outlook.com (10.13.5.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5250.13 via Frontend Transport; Thu, 12 May 2022 16:37:27 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 12 May 2022 17:37:25 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 12 May 2022 17:37:25 +0100 Envelope-to: lihuisong@huawei.com, dev@dpdk.org Received: from [10.71.116.154] (port=56169) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1npBob-0000hU-RF; Thu, 12 May 2022 17:37:25 +0100 Message-ID: <35e74141-f155-26e1-a3f2-04d74182cc4f@xilinx.com> Date: Thu, 12 May 2022 17:37:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 2/2] app/testpmd: fix incorrect MTU verification Content-Language: en-US To: "lihuisong (C)" , References: <20220406084537.16799-1-humin29@huawei.com> <20220406084537.16799-3-humin29@huawei.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b465696-03f1-4dff-169c-08da3435b34b X-MS-TrafficTypeDiagnostic: DM6PR02MB5353:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wASBAXD08BPelh3cz17/NNDa93MSyNV4b+UWLP2EjEVmpeuAggEeHNq2fFNF3RRITe2yjcCWhzd3wpbuzg0ggnr26KyvW/6ETRIP82Lse8riy8LktBPRaGL+OcW7ccuX6RUiDKn9vo2yUE/1kjWOMkqql/ZajraI2/9TxR1Uk6Bj3shM0kC6WcuK2XkjR5e78tgo0YOFbj5P0zYDlDPa1QuMrgsNpg3pG4Bd5jK7hqUQb/ZoQanMDjQudX+IWzH3vJsFIdYSXpixKk+w+YSJ+K5tsqF+VRgRljnYadQhrqRccSPNRG1AtqR4Esh+L0PcbSaVtgovSo4DzhPGVnAgBECuxol2TJWwqJUdDO+bQIiw1A15aiRakgAB+YcQCAQDVsdGS40yrtQ/a+Kug4YpVCUM3q0dKSTAZ8Zd0evKz8IHgUxZHM5qX1aCZE6Ywr94lz38IrLuwrJsFfYTurmHRAc5lV+K6vLkg28kmZdsfNJQDSC28ioz7PdBfRi1m/j+88EqMwL/pGN1FzElxnv4KvJlR0tUoK+Gny9SJ/Dqn75ZpohPBgin637EqWwZlV3IADE3UtFcz1FNfDdE4ZazoKD4oOXUPvRgVXWKS1cjKW3zWlT7Dki7wR75nnysWcQaKuBU2OPeUsP1vQpAI+pDuySic29eo8O6AndJk5bwaVB2pKZiTNnPCuhImRSPAtIWsZpu0b40NNfV1fuoCQ2aNGhP9DoqmQwHIEAhcMHz34I= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(8936002)(9786002)(36756003)(44832011)(70206006)(2906002)(5660300002)(31686004)(70586007)(110136005)(316002)(508600001)(31696002)(336012)(426003)(47076005)(40460700003)(2616005)(83380400001)(356005)(82310400005)(7636003)(36860700001)(8676002)(186003)(26005)(53546011)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2022 16:37:27.0112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b465696-03f1-4dff-169c-08da3435b34b X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT008.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5353 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 On 4/26/2022 2:38 AM, lihuisong (C) wrote: > > 在 2022/4/26 0:25, Singh, Aman Deep 写道: >> >> On 4/6/2022 2:15 PM, Min Hu (Connor) wrote: >>> From: Huisong Li >>> >>> The macro RTE_ETHER_MIN_LEN isn't the minimum value of MTU. But testpmd >>> used it when execute 'port config mtu 0 xx' cmd. This patch fix it. >>> >>> Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Huisong Li >>> Signed-off-by: Min Hu (Connor) <...> >>> @@ -1263,6 +1314,10 @@ port_mtu_set(portid_t port_id, uint16_t mtu) >>>       if (port_id_is_invalid(port_id, ENABLED_WARN)) >>>           return; >>>   +    diag = eth_dev_validate_mtu(port_id, mtu); >>> +    if (diag != 0) >>> +        return; >>> + >>>       if (port->need_reconfig == 0) { >>>           diag = rte_eth_dev_set_mtu(port_id, mtu); >>>           if (diag != 0) { >> I just wanted to know if these added functions eth_dev_validate_mtu() >> &  eth_dev_get_overhead_len() >> are copy of ethdev library API's in file "rte_ethdev.c", which get >> called by rte_eth_dev_set_mtu. >> Is our intent, is to call these twice ? > If port->need_reconfig is 1, rte_eth_dev_set_mtu doesn't be called, and > MTU value is saved to port->dev_conf.rxmode.mtu. This dev_conf.rxmode.mtu > will be set to driver in dev_configure(). This check is performed to > prevent dev_configure() failure. That's what I think. >> . Testpmd stores the MTU value and process it during start_port(), which may postpone any possible error in rte_eth_dev_configure(), so I think it is OK to duplicate the check in app level. Acked-by: Ferruh Yigit