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 8DA2AA0586; Wed, 19 Oct 2022 15:47:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 805C942BB6; Wed, 19 Oct 2022 15:47:57 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2078.outbound.protection.outlook.com [40.107.93.78]) by mails.dpdk.org (Postfix) with ESMTP id 9878242BB6 for ; Wed, 19 Oct 2022 15:47:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EEoiVY02xNl9z6DRPukZq2DixGgdAg4RB/zEpwkdtbZShzY/PJgpV7PQdzdmxUYrzDZwQ6ITRbqgoOvLHXXOek+a8ilj7iNtT6N6fS3jmQTDR7UqEoYpf9PuIzec+1RubxeWEreQYDIl1zbxk44brP/RZYqKuNM1o/xigJF14CTMgeasj87qOFUulWg18bWF9AE4+InOClZ7/3biEL4ZQdy4JsJK6dKlkqihsoME2vrz4Qh6GZZbbImcIhgTMWYfP35e7y20hvczxPElkp29iU2jt4OfWHisObVn190jk1VfRiwjvk9ge5wne4UPmiv4VaXpo+6gVUfV+VWulSP0Bw== 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=MIVL3y4xM3MPVgwJPgCD/5XBZrZhMy+H43hKM0fjJpA=; b=j1lXaC7h+FtUy8lEp15ft5YXNAj3RMsZYXuDIZrDwPwcIxjHiJTnE7TpgxV8ovq3vy3tvZ7o6EUh/Z532d9JKp0Ib/RKLhVGPDM5DeL/nJikrYvnMqk6ktyPKqmBnmAiCZvvsOPV54Tbd7kmYZ0ik2+H1XUzoPUQ+LHqEPXNuI7IYht6vRISPWtgjQW4Lzk22iXYoKxbfX7WnG4yhroTZuJy+qG/+HtTsdYP1DvsAvN3XhzUBZdtmQ7kdDLHXIHQfOLF7jD2NPO0qZfh1JZomLOnFJui/GEMgfRPWWZ3jJZ+LUyTUbMlSsHJzaP+ssyFZBoMFa2S3cioZQc39pDKtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MIVL3y4xM3MPVgwJPgCD/5XBZrZhMy+H43hKM0fjJpA=; b=oSmGe86E02222Amf7g07p30IGDcaNxr9YaJqTfF2pLODXyUhIWuQQ2vKSTB8y5JAEdF7RbocMANMNvOoBJWsZNYcbbpzLVSXAmz6cFD4Tu5xWqYFEGgOXmszUBU1PW79Y7XTu5U5+S2jWwh+cLwSIdlx3v29CcMCjKCMxd9e+As= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) by SN7PR12MB6931.namprd12.prod.outlook.com (2603:10b6:806:261::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Wed, 19 Oct 2022 13:47:53 +0000 Received: from DM6PR12MB4297.namprd12.prod.outlook.com ([fe80::b9fd:e732:4585:6b25]) by DM6PR12MB4297.namprd12.prod.outlook.com ([fe80::b9fd:e732:4585:6b25%7]) with mapi id 15.20.5723.033; Wed, 19 Oct 2022 13:47:53 +0000 Message-ID: <325bda5b-54ea-b804-336a-296e53864ed7@amd.com> Date: Wed, 19 Oct 2022 14:47:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v5 5/8] net/gve: add support for MTU setting Content-Language: en-US To: Junfeng Guo , qi.z.zhang@intel.com, jingjing.wu@intel.com Cc: ferruh.yigit@xilinx.com, dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com, xueqin.lin@intel.com References: <20220927073255.1803892-2-junfeng.guo@intel.com> <20221010101757.878317-1-junfeng.guo@intel.com> <20221010101757.878317-6-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20221010101757.878317-6-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P123CA0005.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:338::10) To DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4297:EE_|SN7PR12MB6931:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c761edc-5400-4a7c-1d2f-08dab1d8854e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jKieCTH2k+HNXvQWkEt2wty1H6PyzlNE/1J6xPrOmMlUS3RSfE6sjZfFZBstqSnTxO/YmA6TboIuWbR4WH99ECtHkKYBIi1E6GMMxL6ogYk6ij1SExZgxQy6lOznUPyj+xbuK2zzeg7cY36vWS++w+KKhqInJL9h8fRL4iclvo5TN6BS7Ppg5M2OyaNNUGlmupqhJ8a1pLyhed9kGJ9BGPYJfjUURe/y+J3gP1RqiPs6oAM4uRlTsuq0YFkYE7krZ5VM30ZohpvAZgnPoh0TyZxURnJJAsdIyq6bOTFhS4WgFyOHObfU7aS1Fy6LjzDyn51m7CaF8Z9kp3l8w3Fxwf+4bSYp6I0AaqvdshOacUXs8sM3pvJhyIsPzUb/4qpcyPOKJq76/U2oHJL6Jwei2UIRjnBiRmH7yE6FEQGLjTYrjdVz0pSXQt+97stmgmr+0pO5KSytl4F2/A833QmkhTYxyop8OisAG1SCHGsdhTt4R1+p5Bz7q3y3pCnL7M5IuSj2yq/zUljAfULUeEq8V+o21ggt4bNQ+6sWE1VjXQlso18PgCEqLNen1GeDPafL424RosGaRyDLlqD69yq5ea3W8LPSodMvzENVZiaWttuUUSGKPKjfONdIQ/HHXFSYl5dvN+ihJAMURs96556H1lcbzX88pR76ipLClz/SmhkDilSsNlkQ3CSlUieTWdZepdRWOlZpHl46vdhMSqPi5ehnkNJoqA8Lg+HyvyL8E1jA0va9nwXUQx3I+U+9ZTm5iPm2V8gRUKuV6jsND56PAx+5lGgbkRdrvXWUQ1nKUN8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4297.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(396003)(136003)(346002)(39860400002)(376002)(451199015)(83380400001)(36756003)(31696002)(86362001)(38100700002)(6666004)(66556008)(316002)(31686004)(5660300002)(4744005)(44832011)(8936002)(186003)(66476007)(2906002)(6506007)(2616005)(53546011)(66946007)(478600001)(6512007)(6486002)(26005)(41300700001)(4326008)(8676002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R0xyUncwZXJDTkNrSkIvbkZBaG05YUJQKzZmK2NyejhoNXE4UGlabE04S1F4?= =?utf-8?B?UWhoNGRmNGNScitHSHpiTkJLTkI2RzdaSVBoc0dQeEx5Y29JMllGQkM3OHpn?= =?utf-8?B?cDEzTUdxbHJZeGhNSVpvMXU3RDExcVNzem9mSTJ5K3Z5Ly9XdWhOWmlVczZ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poVXlVc0F5S25VdVVtVHFBbHZoYVVkbEFxTFk1ckV4MWt2?= =?utf-8?B?WGRtRjVSUFZDWFFFZlc2VVpudS95N2NPdTFQeGxkaW1Kc0RseG11dG8rUWd2?= =?utf-8?B?d3pZRkVHYWlqeDBaYU1XV3Q2Ty80NEdzdXdyd0xRRCtPbUN1SWZSR2xtVHlM?= =?utf-8?Q?tE6+2bkmormWvR0XpIKyKo1k+?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c761edc-5400-4a7c-1d2f-08dab1d8854e X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 13:47:53.6543 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IaXTCCqefSGM9MM4KsLhAWJmvkRffNF7iCZBel7pVMbnAfbrVF1DCCXXRDb+757K X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6931 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 10/10/2022 11:17 AM, Junfeng Guo wrote: > > Support dev_ops mtu_set. > > Signed-off-by: Xiaoyun Li > Signed-off-by: Junfeng Guo <...> > > +static int > +gve_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > +{ > + struct gve_priv *priv = dev->data->dev_private; > + int err; > + > + if (mtu < RTE_ETHER_MIN_MTU || mtu > priv->max_mtu) { > + PMD_DRV_LOG(ERR, "MIN MTU is %u MAX MTU is %u", RTE_ETHER_MIN_MTU, priv->max_mtu); > + return -EINVAL; > + } > + > + /* mtu setting is forbidden if port is start */ > + if (dev->data->dev_started) { > + PMD_DRV_LOG(ERR, "Port must be stopped before configuration"); > + return -EBUSY; > + } > + > + dev->data->dev_conf.rxmode.mtu = mtu + RTE_ETHER_HDR_LEN; it is 'dev->data->mtu' that holds latest MTU value. 'dev_conf.rxmode.mtu' is the config requested from user, no need to update that. And since 'dev->data->mtu' already updated by 'rte_eth_dev_set_mtu()', can drop above line.