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 B7595A046B for ; Wed, 21 Aug 2019 07:19:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DB7701BED3; Wed, 21 Aug 2019 07:19:26 +0200 (CEST) Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710134.outbound.protection.outlook.com [40.107.71.134]) by dpdk.org (Postfix) with ESMTP id 42F9A1BED2 for ; Wed, 21 Aug 2019 07:19:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YYsoDjEvvjxD999lfDybaN6SDHNNmzh3QFz/R6voy3nZAX34FFMiNDLmj+pIzXG0DA7mSsypqFij1xtBCtpB5xhWdIQ1G5YXpbQj272TgyPHpD6gGSsCJJ9fzFOsJ/lBiIT4myibxX2KspAcOXUZWInWR11sqze9Msf9e32uzN7FmeDjENEUzF7jCUJ7bzN60V1SViS1QSr7E68ZuXzY+JZGoWQ4Hz10scqLjqCAJGuahtKwtjUIkhvIoNAZue4kGT9HJM8/0RMVZ4z+1oD3+ZHXSBFYrmArx1oyeoapGWQ11kcY1TD0ztLObD8TJmy16iWc+xVTYjkHfIzV93HMsA== 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-SenderADCheck; bh=0cw7ApqjbaVeTRfOMZh205zk95sGmhiFkx5sjnZVxa0=; b=SY/9o9C1gkso+3vG5W6U0nDbNpA8klnkudxlyi94nJJl84UIpNkoN6WrOmQ2nUHiJpqUQMYOW8QbxaVuYH+HpEbyfO/iO0VCHKFAixRZ20h9qhGH12GYh4gm19m10aNkJlnCyiDprPAOAtvXfsLVXweE/nExYwMuS8Fj3bOuabP7ix/g23k9bXwd0H0f2vcmo+Vtuv/VJ1kCxJGO8QgS1NeibQE81GrH1UCfpA8YHgP8OOF/AFhwIcZvikhQJnD05hqGMEAIJFyvAhrMUwmaLusmStATLjwUcGgbeHaco67pVwsm0gQUfLX4B1LflyTkxvDJcGt25MJrzkNG8vH3Rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=spirent.com; dmarc=pass action=none header.from=spirent.com; dkim=pass header.d=spirent.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spirent1.onmicrosoft.com; s=selector2-spirent1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0cw7ApqjbaVeTRfOMZh205zk95sGmhiFkx5sjnZVxa0=; b=POMl1zeWzP0C7LmY0iyXSGEsR8KeElKkOiDzFKTAxvL5y192N3Nw4wcqYzpv8FIMCasgMVRTgj656lKnPfzUdZ1zFERi1tWATlrHD8/46oQaHQGO/YeL50Iae+5YsDmIdSEdSgP7n+2k2tWuHF4XC8fpkt26uFHndkT5gbdfU74= Received: from BYAPR10MB2664.namprd10.prod.outlook.com (52.135.217.27) by BYAPR10MB3095.namprd10.prod.outlook.com (20.179.154.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.20; Wed, 21 Aug 2019 05:19:22 +0000 Received: from BYAPR10MB2664.namprd10.prod.outlook.com ([fe80::60f5:7961:f02e:6ff1]) by BYAPR10MB2664.namprd10.prod.outlook.com ([fe80::60f5:7961:f02e:6ff1%7]) with mapi id 15.20.2178.018; Wed, 21 Aug 2019 05:19:22 +0000 From: "Myers, Charles" To: Stephen Hemminger CC: Yong Wang , "dev@dpdk.org" Thread-Topic: [PATCH v3] net/vmxnet3: Added mtu_set() function to allow setting MTU. Thread-Index: AQHVV8aCAK2On2B0W0eAFi6EixMfc6cFBkwAgAAAZ/A= Date: Wed, 21 Aug 2019 05:19:22 +0000 Message-ID: References: <1566017542-26938-1-git-send-email-Charles.Myers@spirent.com> <1566353778-14774-1-git-send-email-charles.myers@spirent.com> <20190820214306.6ef7cd7f@hermes.lan> In-Reply-To: <20190820214306.6ef7cd7f@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Charles.Myers@spirent.com; x-originating-ip: [74.87.49.203] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3039d3eb-85db-44b0-1c37-08d725f72085 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BYAPR10MB3095; x-ms-traffictypediagnostic: BYAPR10MB3095: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0136C1DDA4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39860400002)(366004)(376002)(346002)(136003)(199004)(189003)(13464003)(54906003)(99286004)(446003)(3846002)(256004)(6436002)(74316002)(8936002)(64756008)(86362001)(5660300002)(486006)(53936002)(71190400001)(66556008)(14454004)(71200400001)(76116006)(66446008)(66476007)(9686003)(66946007)(7696005)(26005)(305945005)(8676002)(53546011)(6116002)(6506007)(102836004)(316002)(7736002)(52536014)(55016002)(76176011)(6916009)(4326008)(186003)(229853002)(33656002)(478600001)(2906002)(476003)(81166006)(25786009)(81156014)(6246003)(11346002)(66066001); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR10MB3095; H:BYAPR10MB2664.namprd10.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: spirent.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: pc7ASV5foxksdHni0IaXdl1hf1mlPVYuwtpey+vvm8T1jXC4zwMcs1Xyer7Wn0z2+d3F5P1jEHg0hDdBEC8ltn1bNYAv2h1FTi5OHJx0+CswVQUfPB0DiTffuVeGyU9phf6vzone4eNLr4lUURSXgGaq+FV/jWQmpxJXguv6TBttWLVk94SwtoGs+pFKE3kYnXsdsNl5kFQ1oXYap69Kvs2N+EFEWvrO0nlTUatjvhVsGnj612pXFFa/cb2fwTCDrf7lXPP3xLrTcekjjnFw6VGm83UP3AmKdkBISX0iVe060mCxEEK9/LaNCSQCmEUIi6aWxtYTZc8MDhHop8j/GwvqNFanYXspReAqW6PxyCr61aIcdO2tTyWSI9VVkUq3j9KYdA8KEW0YMpdH5cS3K6yJIRpE7Feb4iO+7Z2rbHY= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: spirent.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3039d3eb-85db-44b0-1c37-08d725f72085 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2019 05:19:22.6889 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: eb68cad0-6bd5-483f-a802-0f72f974373f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gdGiidwvG6yaRfSnv0J1p2gI/S59zIiF7RtCkAg2kDdHjec+zO0G5t484GeOZOM+qA/p1il1qaKwWONC1ekJvQRPhfO58SLW0AAsV2+AxJQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3095 Subject: Re: [dpdk-dev] [PATCH v3] net/vmxnet3: Added mtu_set() function to allow setting MTU. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" MTU change is currently only allowed when device is stopped. Current code in master branch already sets MTU in shared data correctly whe= n starting the device: static int vmxnet3_setup_driver_shared(struct rte_eth_dev *dev) { struct rte_eth_conf port_conf =3D dev->data->dev_conf; struct vmxnet3_hw *hw =3D dev->data->dev_private; uint32_t mtu =3D dev->data->mtu; ... devRead->misc.mtu =3D rte_le_to_cpu_32(mtu); ... } However current code in master branch does not implement a mtu_set() functi= on so MTU in the dev->data is never changed from default of 1500: int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) { int ret; struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev =3D &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mtu_set, -ENOTSUP); /* * Check if the device supports dev_infos_get, if it does not * skip min_mtu/max_mtu validation here as this requires values * that are populated within the call to rte_eth_dev_info_get() * which relies on dev->dev_ops->dev_infos_get. */ if (*dev->dev_ops->dev_infos_get !=3D NULL) { rte_eth_dev_info_get(port_id, &dev_info); if (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu) return -EINVAL; } ret =3D (*dev->dev_ops->mtu_set)(dev, mtu); if (!ret) dev->data->mtu =3D mtu; return eth_err(port_id, ret); } The vmxnet3 driver just needs to implement mtu_set() so that rte_eth_dev_se= t_mtu() allows changing the MTU and puts the value in dev->data->mtu . -----Original Message----- From: Stephen Hemminger =20 Sent: Tuesday, August 20, 2019 6:43 PM To: Myers, Charles Cc: Yong Wang ; dev@dpdk.org Subject: Re: [PATCH v3] net/vmxnet3: Added mtu_set() function to allow sett= ing MTU. On Wed, 21 Aug 2019 02:16:58 +0000 "Myers, Charles" wrote: > =20 > static int > +vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { > + if (dev->data->dev_started) { > + PMD_DRV_LOG(ERR, "Port %d must be stopped to configure MTU", > + dev->data->port_id); > + return -EBUSY; > + } > + > + return 0; > +} > + Don't you need to reset the rx ring to change mtu on the fly? At a minimum you need to communicate this value to host through the shared = driver page.