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 88646A058B; Wed, 25 Mar 2020 19:43:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5FFF22C6D; Wed, 25 Mar 2020 19:43:35 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2074.outbound.protection.outlook.com [40.107.243.74]) by dpdk.org (Postfix) with ESMTP id DA1772BAE for ; Wed, 25 Mar 2020 19:43:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y4pKtGAmgZUNnBv2D7iuEwBITdMv+wR9Yr+J+nOnQ7SxMOA+5hYC1wdXBKsuHXiagP/2YuVI8UaXPTilUqmHG/HSr84O3Bkn/HDI12oZCjQqANHf2uYCFUt5ollUWzP7UnmnvV64mVNUeRrYOBC7Cay0X4GyDkyqAVHpY6rci1qkOjSWODDcFdNVjnTpE2s5G3ZJrNPU1aE6NDhu4sor41QYXz05eN1u0wLIv+3CtX0iUfqzS1QELsT6uHAAtzIeqV9nfZNdd5ElIAWjkolBBEI0N+RrEFJygXv2PcPwQc3dAuUUpzbdhPR7kgv/Mk4Nz2JF/ujGkwlY0pm6C44DRw== 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=NcP//14z6ctDNGBakE+qZgVetafZ3yiEx3ZjDQy0uHg=; b=P2mls5YHie7/jrP2QZknj1e8m9Bix4dn9+pQRsqQPQDPg/uAaGcYRusxH3ya5IwgsRJkAI/abUqN6UjmmefUECKVxHslZrvj+kl1xb3QL8qiReu4iLvnojeH4Twv8EAyiVNNeW6Cqfeh0AqNxIgh1RLpU3Amk/Qc1DyK9U2etfFn601jNqxv3hwT/L7NAm6C4st4fI/iPXlbplbKXb/GjpNlep4AR1vP/kLyJCkp9aH3l0JvcpHUlhacW9bL5x5Eonsmq++S9y8NfLk1IkmTUD33Fvi07vOohVQnev3UgJBopZIEb+Lux7Tpw2empn3ROIeu1xCDa70le/Ap53vPdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NcP//14z6ctDNGBakE+qZgVetafZ3yiEx3ZjDQy0uHg=; b=APD9uODSlCteLZvbDJmScLLrag50sau3mt8/oC8hYG1xOK9bVj7O6i8OC4lisE+gj8Cv9q4PdqXqtg3qdo1XfVn8Pz7Ai8xDDvdU2b4Atqlf1f/3xBlAwKZFfoQxN0Y6b8m505IAS733pTB1lHNoTxHlNCa5Kt8nyoVNIQU/9wk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=eserra@vmware.com; Received: from BYAPR05MB3989.namprd05.prod.outlook.com (2603:10b6:a02:86::31) by BYAPR05MB5671.namprd05.prod.outlook.com (2603:10b6:a03:19::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.9; Wed, 25 Mar 2020 18:43:32 +0000 Received: from BYAPR05MB3989.namprd05.prod.outlook.com ([fe80::f1be:e437:3f14:2f1a]) by BYAPR05MB3989.namprd05.prod.outlook.com ([fe80::f1be:e437:3f14:2f1a%7]) with mapi id 15.20.2856.017; Wed, 25 Mar 2020 18:43:32 +0000 From: Eduard Serra To: dev@dpdk.org Cc: yongwang@vmware.com Date: Wed, 25 Mar 2020 11:43:21 -0700 Message-Id: <1585161801-24250-1-git-send-email-eserra@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1566353778-14774-1-git-send-email-charles.myers@spirent.com> References: <1566353778-14774-1-git-send-email-charles.myers@spirent.com> Content-Type: text/plain X-ClientProxiedBy: BYAPR02CA0015.namprd02.prod.outlook.com (2603:10b6:a02:ee::28) To BYAPR05MB3989.namprd05.prod.outlook.com (2603:10b6:a02:86::31) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dev.localdomain (76.14.29.240) by BYAPR02CA0015.namprd02.prod.outlook.com (2603:10b6:a02:ee::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2835.21 via Frontend Transport; Wed, 25 Mar 2020 18:43:31 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [76.14.29.240] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 454faac5-2662-4354-b95f-08d7d0ec6ac6 X-MS-TrafficTypeDiagnostic: BYAPR05MB5671:|BYAPR05MB5671: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 0353563E2B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(39860400002)(346002)(376002)(396003)(136003)(66946007)(66556008)(66476007)(6486002)(16526019)(186003)(2616005)(956004)(81166006)(81156014)(6666004)(86362001)(5660300002)(8936002)(8676002)(36756003)(4326008)(52116002)(2906002)(6916009)(107886003)(966005)(6512007)(26005)(6506007)(316002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR05MB5671; H:BYAPR05MB3989.namprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QB04emD9rKtdKq/LLIQOhycklvRealgnjanmwqt0FfeAwE1Qfc9I6ELmgd2HScvqABd9e3PdPGIc8gY884t9gr1ktQHShe9sucIR5YUtILqd6ulP6+Ix8/2mOpBcNS/TrLFesb5ggZZdvhaP2inE/aWgNbpFQydYXCfYejOmf8BIDJ6F1LWO81IZ25OxSA5S+/rZDGbNBMinTNoGXLcUR8Bv77Mi824brrqR6wRAz8waq8HTrThTPc3Ctj4SW9CXwSUkc2a/JVyUBdRCw6wYEQpxyk4Jg0UMnx73E+v3Ld1UPi0VKdIrUSv8pG153DmveWP2pJNGZrbS38X55KAJXNxEFMhJRmGPSlc/RZ6GFcC/rqjP3mIH1kitVCZUWw7ebr7juLAZQmHcV7Smk55VnGtjsPs07QuT7ELnV6VuGPXMI/3hCA7SfhkIV1SVwpNI49cZWA7rt0pny093Dbt4KUBBO/CSc1wk2fHE66rB0wm4yGd6t8vaVmuWaQ3Hi3Lsq+H5igEm05PW5xblOn9O5g== X-MS-Exchange-AntiSpam-MessageData: 8BNWtN59kRL59gQMEmV5gJ/+kBxNlwyuYY2jN+TWAE8fiC7jTEJZPeirsW3+BVYyRN/5g3fdDIwJfHNGfmXHLdDJROFF2yTMeLGw00K2usXGgQ6N+NFmaxk9NQS7weK52CMQmYlfMVYQjO+iA87PAw== X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 454faac5-2662-4354-b95f-08d7d0ec6ac6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2020 18:43:32.0641 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gb9bpVKFAXPulLkeXOM/QWuX1BnQCfH6rEW366mJwRouE5npb8i5kooN9rHQPQ+YuCydR3uf669pIbwHL7M3Ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB5671 Subject: [dpdk-dev] [PATCH v4] 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" (Picked up from @Charles Myers patch https://patchwork.dpdk.org/patch/57771/) 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: Eduard Serra --- drivers/net/vmxnet3/vmxnet3_ethdev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 705e976..40e81a4 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -87,6 +87,7 @@ static int 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); @@ -124,6 +125,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = { .mac_addr_set = vmxnet3_mac_addr_set, .dev_infos_get = vmxnet3_dev_info_get, .dev_supported_ptypes_get = vmxnet3_dev_supported_ptypes_get, + .mtu_set = vmxnet3_dev_mtu_set, .vlan_filter_set = vmxnet3_dev_vlan_filter_set, .vlan_offload_set = vmxnet3_dev_vlan_offload_set, .rx_queue_setup = vmxnet3_dev_rx_queue_setup, @@ -1166,6 +1168,8 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev, dev_info->max_tx_queues = VMXNET3_MAX_TX_QUEUES; dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM; dev_info->max_rx_pktlen = 16384; /* includes CRC, cf MAXFRS register */ + dev_info->min_mtu = VMXNET3_MIN_MTU; + dev_info->max_mtu = VMXNET3_MAX_MTU; dev_info->speed_capa = ETH_LINK_SPEED_10G; dev_info->max_mac_addrs = VMXNET3_MAX_MAC_ADDRS; @@ -1212,6 +1216,18 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev) } static int +vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, __rte_unused 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; +} + +static int vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct vmxnet3_hw *hw = dev->data->dev_private; -- 2.7.4