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 8B583A046B for ; Tue, 20 Aug 2019 06:07:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF2871BEA4; Tue, 20 Aug 2019 06:06:59 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790128.outbound.protection.outlook.com [40.107.79.128]) by dpdk.org (Postfix) with ESMTP id C0C8F1BEA3 for ; Tue, 20 Aug 2019 06:06:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Onul9eHiYMtIApNsGBIqoFVVEjRae4rFY/9WLM8nuxWo3+FAulFUAXxDP4EAo7gl5Tg17bVuXIoaZH+W3b4BwbZCYmxkVYdX4VqLSlzzi7Cpi5XmljMRSxpHGlc2n8op5VZRamdb+8D9ts4+KMOPpzdsxEU+WS7qlOMZsqY0CSndRrqleIXnbQ7H8yHzUSIRYwIaD5INjGvt91xvF6cMBG9V4aooaGFri/oqAbEKVdvxjRym8V4pmV+U2SwcjfJubaR3UqnaFfPUPOKrr5GsC+RdHi1VAR4wYjrxOYSHCTUuI2L0VnFoJsFjIL7F90sJGn6F9uLPeWL1QVQCGDeNDw== 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=ksmGbjLB8A/bDVW/y9t6JPrm2aXlT/1UnYXGzCYfK2w=; b=ITAdKEZrOLdxa9ckQQKsjMN2zicg6fhwR3KHuy63c8+Y4kVZ/oZbtfSQCm9kOonUDcJGBMFAp7N4UUXp+uHWR11HfBmnByqM7KZpPIQ20Ude/7EzIe1oUEMfnRcxSRRrtsZa0OO6j6UknUdb8T0jKmTNfQs6XiVbLr6pW7LQ0xO8M230wmWcTwzYQ0mVjRxs2Jc80RP36Nmg6JQBGv8sC7W6wQDU86V+vCnUFXE4Y3uB+fk5LrESLRqKkecIBOBGmHMoKK4yn+hpVO5I7SphjVmUJwSBKHs5EVtFuCaD3xGdt/BJg70A3iEc2Nt1cTzSqv6JJXlzseGnO5jawOFyTg== 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=ksmGbjLB8A/bDVW/y9t6JPrm2aXlT/1UnYXGzCYfK2w=; b=Re/RNfZBHglACDNslnX2QaYJdOtnsjoMgZblciDppxvbc+Fp0smywLLhoIY/PMZv+KFxMbZCbcVYfhv1X++fOh69a3dszouqZZgeP7raTwKLU/iRcHyIQeVEPHdXyZSJyCrox6db63zdUMnabEqUaSEs1U/hdDR+ETjRkcS8ACs= Received: from BYAPR10MB2664.namprd10.prod.outlook.com (52.135.217.27) by BYAPR10MB2598.namprd10.prod.outlook.com (52.135.216.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Tue, 20 Aug 2019 04:06:53 +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; Tue, 20 Aug 2019 04:06:53 +0000 From: "Myers, Charles" To: Yong Wang CC: "dev@dpdk.org" , "Myers, Charles" Thread-Topic: [PATCH v2] net/vmxnet3: Added mtu_set() function to allow setting MTU. Thread-Index: AQHVVwyzkn9evvOWPkGYFQCGcJX3lA== Date: Tue, 20 Aug 2019 04:06:53 +0000 Message-ID: <1566273996-24368-1-git-send-email-charles.myers@spirent.com> References: <1566017542-26938-1-git-send-email-Charles.Myers@spirent.com> In-Reply-To: <1566017542-26938-1-git-send-email-Charles.Myers@spirent.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [74.87.49.203] x-clientproxiedby: BYAPR01CA0026.prod.exchangelabs.com (2603:10b6:a02:80::39) To BYAPR10MB2664.namprd10.prod.outlook.com (2603:10b6:a02:b2::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Charles.Myers@spirent.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 562b7388-e1d1-4382-f672-08d72523d557 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:BYAPR10MB2598; x-ms-traffictypediagnostic: BYAPR10MB2598: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 013568035E x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(366004)(376002)(39860400002)(396003)(136003)(189003)(199004)(5660300002)(14444005)(256004)(71190400001)(316002)(8936002)(99286004)(446003)(11346002)(50226002)(2616005)(476003)(8676002)(81166006)(81156014)(486006)(36756003)(54906003)(6916009)(53936002)(86362001)(4326008)(71200400001)(66066001)(478600001)(107886003)(26005)(386003)(6506007)(186003)(102836004)(25786009)(2906002)(14454004)(6116002)(3846002)(52116002)(6436002)(66446008)(64756008)(66556008)(66476007)(66946007)(76176011)(7736002)(305945005)(6512007)(6486002); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR10MB2598; H:BYAPR10MB2664.namprd10.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: Tpikmw35QEBqpV+VtKiWRcpMfcK44THrynozHkapJ5mbZHMdldZLoRVxgcIucuaapRsfuz+Rc7sDsLWEo/mnvcImsAnRegGJM5MQL2zc1ANhSQGhnBh4Ns0opkouWpZ1tXvHqO27kUOFd96oVzMczcmmnJ9H0BNUFD86bwt026XDzuen8XsM2ZBwj11uB3ZcZwOPnn0DSHd4HENVryB/uKu5COGUQqOMkPfdIeTXWg7NpyR0J6EI5YyDf7+WJwz6ZoR+98n7ja2eJgHxMy7KjN6ukt9iRMqaOI5l30J+qkPARcTvyl10Fp4OMIm1qM40tR+H2diGUgWmvzC0ORUoEiQGcUCom/eYP7HxhqYuc9f2yM4Tsv6dhOy+iKvlqY8keRdGOyoAfw8xUkTaXCxA5nt01a3Y4BzjsEiHF2rLBNk= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: spirent.com X-MS-Exchange-CrossTenant-Network-Message-Id: 562b7388-e1d1-4382-f672-08d72523d557 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2019 04:06:53.2267 (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: 0bgfp/+0MnkpsNFMA2ic3HelwUiz1RLIJ5e2tT7bQD5j3+AcXHHiMrVMIZbMRy2xQKjyHPBGYmQP6UCFInLSsg9ltDo+t9GyBDEe1SX+iU4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2598 Subject: [dpdk-dev] [PATCH v2] 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" From: Charles Myers When the mtu_set() function is not implemented, rte_eth_dev_set_mtu() fails with -ENOTSUP and mtu is not stored in the mtu field in the rte_eth_dev_data. This causes the mtu in Vmxnet3_MiscConf which is shared with hypervisor to always be set to 1500. This may cause issues receiving jumbo frames on Enhanced Data Path N-VDS. Signed-off-by: Charles Myers --- SMTP server overwrote the From address display name in previous e-mail. Hopefully this resubmission fixes it. drivers/net/vmxnet3/vmxnet3_ethdev.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmx= net3_ethdev.c index 57feb37..c32c92d 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -88,6 +88,7 @@ static void vmxnet3_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); static const uint32_t * vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev); +static int vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vid, int on); static int vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)= ; @@ -125,6 +126,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops =3D= { .mac_addr_set =3D vmxnet3_mac_addr_set, .dev_infos_get =3D vmxnet3_dev_info_get, .dev_supported_ptypes_get =3D vmxnet3_dev_supported_ptypes_get, + .mtu_set =3D vmxnet3_dev_mtu_set, .vlan_filter_set =3D vmxnet3_dev_vlan_filter_set, .vlan_offload_set =3D vmxnet3_dev_vlan_offload_set, .rx_queue_setup =3D vmxnet3_dev_rx_queue_setup, @@ -1161,6 +1163,8 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev __rte_un= used, dev_info->max_tx_queues =3D VMXNET3_MAX_TX_QUEUES; dev_info->min_rx_bufsize =3D 1518 + RTE_PKTMBUF_HEADROOM; dev_info->max_rx_pktlen =3D 16384; /* includes CRC, cf MAXFRS register */ + dev_info->min_mtu =3D VMXNET3_MIN_MTU; + dev_info->max_mtu =3D VMXNET3_MAX_MTU; dev_info->speed_capa =3D ETH_LINK_SPEED_10G; dev_info->max_mac_addrs =3D VMXNET3_MAX_MAC_ADDRS; =20 @@ -1205,6 +1209,24 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev = *dev) } =20 static int +vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +{ + if (mtu < VMXNET3_MIN_MTU || mtu > VMXNET3_MAX_MTU) { + PMD_DRV_LOG(ERR, "MTU should be between %d and %d", + VMXNET3_MIN_MTU, VMXNET3_MAX_MTU); + return -EINVAL; + } + + 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; +} + +static int vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_a= ddr) { struct vmxnet3_hw *hw =3D dev->data->dev_private; --=20 2.7.4