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 CCCD3A0553; Thu, 20 Oct 2022 16:45:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8EC3C42D8A; Thu, 20 Oct 2022 16:45:15 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2061.outbound.protection.outlook.com [40.107.243.61]) by mails.dpdk.org (Postfix) with ESMTP id 11DCF42D82 for ; Thu, 20 Oct 2022 16:45:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HuR+DFScs2YiVvAPwJG4qEHslYN+wda1U8pPWU1exJSGeixv+RMYz2eY18ekmX6bNKAXn27cAqg7H9/hupzTiXq+79aQOfKv+UjxvnAsxDKhmGzIsSfCruvbs5xgdzHYv3Wn1HEpyO6tPPuKzgQvCwcuc8DzCrnmKpOa+W0Zp/lBMgUr/luGYvzPwQ+t4hqhw5BjSQoeqsIonBNn51pjhrnZuLAcjPjdixDij1GJPkakJCSqS1XIllOvizs3WJEzd2K6gMIcOLAm5ckmjnoDnJb29jDc3Ww9SZVCVP+PyELxqg2dSuHjs9p4acb1qj9Me+3sXRGLq1cf900k3r6/bw== 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=I4g4Qn/dvJ5shXGvWSdjKpF0lCaW782pOOOq0KX2P8o=; b=HMtUWXSVXtOVjldzNsaEn9dcZ+6xuNkkYcBO9eFyhNyfuVUZ+83DUwn42AkSz21bWi7WT6gURQDfMaYUssIuUZHETvm/bLiFwg1OZrkDGZgoU8/vjhBHc9PZXEK8XW54Go5Il+7pJ7TaTXj5AEyAS9s/Zl2bynY61ATT/AVuwZ7t+ttFdTQ91OQDPltHJl93C0O4MYHK6aLuJbNdj+owwkeCRl7bJ5ucvBaerkub4PzKnxW8T2fTPySQdCa/06GWTicn1P1/AlFmaMO1E6MWMIDtbpLZAB5yw+7fQObTWDOddXU7t9PF/55zXzXTJV5bE6GzqvRX/EgRZfsH3HKFUQ== 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=I4g4Qn/dvJ5shXGvWSdjKpF0lCaW782pOOOq0KX2P8o=; b=kk3Az+opEScP3a34dznAyDOJ8I4Thgm6JIHDyMQSm5L0DmhcHZTq+qp29gjjIA6F8o1MG7ygyAtWKi4f3a6TRw8jzZy3a/JZtC5/c0AROQFD1jWW45jaC8vCX5vPVZLnq8s0xSDF749tINgiSqaCObH8/4rQ2QxTYuF7uQPHuRI= 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 CH0PR12MB5282.namprd12.prod.outlook.com (2603:10b6:610:d5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Thu, 20 Oct 2022 14:45:13 +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; Thu, 20 Oct 2022 14:45:13 +0000 Message-ID: Date: Thu, 20 Oct 2022 15:45:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v6 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, beilei.xing@intel.com Cc: dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com, hemant.agrawal@nxp.com, stephen@networkplumber.org, chenbo.xia@intel.com, helin.zhang@intel.com References: <20221010101757.878317-2-junfeng.guo@intel.com> <20221020103656.1068036-1-junfeng.guo@intel.com> <20221020103656.1068036-6-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20221020103656.1068036-6-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0470.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a8::7) To DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4297:EE_|CH0PR12MB5282:EE_ X-MS-Office365-Filtering-Correlation-Id: d17629cf-461f-401c-6775-08dab2a9b173 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kxzarclj5wC0lMdpJbdBLblxbOKNUhzXhukYsp80AmfUns5jzgBMftWyTjxoMUQW+9KGCTUBFD3BBYQb8sdOnbTH7qiEWlPwXHg6Nw8fW5u2i2V6Ae7nNYJs8yDt+D2+ICmF8jpH0zMeuMFow6ETM35LNnLvfrtE92fmqVPXWP6f7YhXrz2TJnvM5Tf4K2DW52NGLWnIwlwiTJh9Q4MUcWeehWITFJbc5/8UytdP7jDts6hVSoCPEIfpGa6qc+Nkw1lCkcuhyDvNmNTrJhGD2dGjar/M+An2FBroyCnxYS4MWxd7xRUbzmmmdUH3hL1uFYwMDnRSC7nyCAnQfqdiRwxFMeShnKzvQmvwv2jwsAv3j8IsBR0K6xAmSnGfOjba1fI8eveRQZ4qXIDno656Cuoo3LPUC3oGQxLmwl23sX097VD9tCZ2QcFlcIEenAXkG6244UMTZPn4pCSGI3M0iaA2qjyQTPAumVvyhYshoLaA/2SwMJLgXK4voDMDWn0Xv9Bs3Bh3MLGt6LYzg6GAapitS1xjmmBt+QpCddl6xZ3BQvJJ+dfkIrVMkaqNJ22IJ09bPAvdFf7ukq7meM1CQQzxMm3LrYAGQGjfSbjlxDJuWAwtlPMEViQi8Lm28SOmlxWEa1yoZIVydqdNJjzhNOeG88yv0EXkIzRX+Yntk0t4CxUqTYCKEzisnS5iLGE4edTrB+mLOI7JO/q7ed9QBYH+NZkMhVaJ32va8u66cfSr0kvx/ei2zaL9I9KKM/lKtJ3WQxYeQ88pjPEyVdBB2ooWzFCTGXdcrdCSkMhBUN8= 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)(346002)(39860400002)(376002)(136003)(396003)(366004)(451199015)(31686004)(38100700002)(478600001)(6486002)(6666004)(6512007)(186003)(8936002)(316002)(41300700001)(83380400001)(53546011)(66946007)(86362001)(66556008)(31696002)(36756003)(8676002)(44832011)(2906002)(7416002)(2616005)(6506007)(26005)(5660300002)(4326008)(66476007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Vndlckh5QjM3eUM5QUdTM0pOZnE5L09ITW1lVFF0UnNSUzU1QkhBdFozdVNr?= =?utf-8?B?R0xsRmEwTy9GTHU1aGdZcll3VHJOTWpqbTZxYllqL3ArN0JPN0thUzRvbXNa?= =?utf-8?B?aEhQZ1RGSjhHdjMrZ1RYMGEzSnNVZHMzR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?B?V05sL3Jid2tTelJLUTlFSVFNSHY3dUlOWFM0SGJCOVpzWXJ0TEdnQW1QNWJQ?= =?utf-8?B?Wk03SXhIcTFnZDQ5c1h1dTQ4dWZselJ6YnMwZDJhTG4rcTBNQjFWWmJDRCtM?= =?utf-8?B?T0RUZkZuUVk2RUc5TWpvWGlTMDBXNU5LRFgvZ1M0WHh1OXMvSGdldWFZM2tp?= =?utf-8?Q?jSzjqW8v5C9jsK9XInjrjRJFd?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d17629cf-461f-401c-6775-08dab2a9b173 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 14:45:13.1258 (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: S6aMSUVVnHb0iYp6n9K61gy8jihmJDtELjY28WOVUFYlq3az09WpxHStv54FFAKw X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5282 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/20/2022 11:36 AM, Junfeng Guo wrote: > > Support dev_ops mtu_set. > > Signed-off-by: Xiaoyun Li > Signed-off-by: Junfeng Guo > --- > doc/guides/nics/features/gve.ini | 1 + > drivers/net/gve/gve_ethdev.c | 27 +++++++++++++++++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/doc/guides/nics/features/gve.ini b/doc/guides/nics/features/gve.ini > index ae466ad677..d1703d8dab 100644 > --- a/doc/guides/nics/features/gve.ini > +++ b/doc/guides/nics/features/gve.ini > @@ -5,6 +5,7 @@ > ; > [Features] > Link status = Y > +MTU update = Y > Linux = Y > x86-32 = Y > x86-64 = Y > diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c > index ca4a467140..1968f38eb6 100644 > --- a/drivers/net/gve/gve_ethdev.c > +++ b/drivers/net/gve/gve_ethdev.c > @@ -94,12 +94,39 @@ gve_dev_close(struct rte_eth_dev *dev) > return err; > } > > +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); Although this is within new 100 column limit, it is easy to break it without sacrificing the readability, can you break it as something like: 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; > + } > + > + err = gve_adminq_set_mtu(priv, mtu); > + if (err) { > + PMD_DRV_LOG(ERR, "Failed to set mtu as %u err = %d", mtu, err); > + return err; > + } > + > + return 0; > +} configure() (gve_dev_configure()) also get 'mtu' as user config ('eth_conf->rxmode.mtu') which is ignored right now, since there is 'gve_adminq_set_mtu()' command already what do you think to use it within 'gve_dev_configure()'? > + > static const struct eth_dev_ops gve_eth_dev_ops = { > .dev_configure = gve_dev_configure, > .dev_start = gve_dev_start, > .dev_stop = gve_dev_stop, > .dev_close = gve_dev_close, > .link_update = gve_link_update, > + .mtu_set = gve_dev_mtu_set, > }; > > static void > -- > 2.34.1 >