From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0042.outbound.protection.outlook.com [104.47.33.42]) by dpdk.org (Postfix) with ESMTP id 242332931 for ; Sat, 27 Aug 2016 02:54:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SonusNetworks.onmicrosoft.com; s=selector1-sonusnet-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gW9108Kl5/+zP/0W0dW/sONJ2dD/uNsrXaZI6sNUGM8=; b=SLKLLMGBqvC50aopEJ/oLd85H6cqfdMAQvJonr1EC7CSmSAa1K5wh448apDSOjJW5crRProYtUSaVjftMTAiYmguKWIUwLd3xnbnAUDy0N7895s+M/JJLS1qTXse84rT+YfgzvmRv+WCXZtc9/5Un+a0PdFJKllD/43zYoHoCYw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sodey@sonusnet.com; Received: from SODEY-LMA.sonusnet.com (73.114.33.77) by BN6PR03MB2740.namprd03.prod.outlook.com (10.173.144.135) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.13; Sat, 27 Aug 2016 00:54:55 +0000 From: souvikdey33 To: , CC: , souvikdey33 Date: Fri, 26 Aug 2016 20:54:28 -0400 Message-ID: <20160827005428.16556-1-sodey@sonusnet.com> X-Mailer: git-send-email 2.9.3.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [73.114.33.77] X-ClientProxiedBy: DM5PR19CA0014.namprd19.prod.outlook.com (10.175.226.152) To BN6PR03MB2740.namprd03.prod.outlook.com (10.173.144.135) X-MS-Office365-Filtering-Correlation-Id: cac27d51-3031-433c-c295-08d3ce14c308 X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2740; 2:WJaGU35rmrmwUO9pbOn3LQY+8D1qFXFDX1678mOJX/89EASFDIdVSlvjnKz1R/YH2IYa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mmmDMececUQ1GhtkOkrIjmG2YliBxrv/t4APMtRTo5cNjhk8Kd9XFjIoYpM4+y2fevLcIs1+N32Iab8lQ15ykiw4vrRFfKSoc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BN6PR03MB2740; BCL:0; PCL:0; RULEID:; SRVR:BN6PR03MB2740; X-Forefront-PRVS: 0047BC5ADE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(105586002)(50986999)(77096005)(189998001)(92566002)(5001770100001)(66066001)(97736004)(2906002)(19580395003)(5003940100001)(53416004)(42186005)(33646002)(7736002)(106356001)(229853001)(68736007)(36756003)(86152002)(50466002)(1076002)(6116002)(3846002)(5660300001)(48376002)(47776003)(86362001)(101416001)(586003)(7846002)(305945005)(50226002)(107886002)(81166006)(19580405001)(4326007)(81156014)(69596002)(8676002)(4001430100002)(43062003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2740; H:SODEY-LMA.sonusnet.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: sonusnet.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2740; 23:1DzXJu4Rn4BTQpBemEekxFRtD+L0QxLj1+5T/8KsU?= =?us-ascii?Q?MQqSfLUAXpRFn9gIrXo3hClSBtXGyt4os1a1QVFHZgQN4YiiL+gqDXPxWPDA?= =?us-ascii?Q?Ux7ygMh5hMD4Nr4JV2W39mCBOzbXTKGAG/GRZOjgXhxmWxsSv9vyzhJg92oM?= =?us-ascii?Q?6Ib1ekgqCsJMSwErq5zR2FM8Gvgqqnhl1VThcnT08G9sXxN70VGeIAoonst8?= =?us-ascii?Q?fI7vW1tyhf7aPIdr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ascii?Q?eBgVj4/y5K2j27N1L/59KFmkssg9I4hItSgLE2759ObtcLDb7e2UQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2740; 6:CDNrNSTtJswIfNjI+c4/ekGQs+qaXtVcxsxzSRK/aWN/SsFXVOctRMQiiAzZD+q8PoRVn01EKAfBlFAJkF5BjFCv1cHva4aRG+k9Aj7HBI/TqD1oFn8mtIkxwePzTfpwxT8Y2U9MNouHM2AGiI3qh3hZHgikxzLt2CSE2/+d44+oSx30zm4jGSJQdD5ZoQlSseDIh+2yWPIctZVMSZ+Z6LKWSxk3WyESCLcPt9rkiRngmJiXEtS10gxbEivmxsE4/DKuggAGvIDmjvehiwWKnXZpmc2Dq8COAL7fnLCYb2A=; 5:kL7MRgbhlMUJ3RsS8AuyWnduAEH6WQc8U7Z6dDQC1i+TJHLEduRpg1snfVlTnJYV2LtRQvmPK4gZslbtsd/VmcE5OfevUP87yA29zWIGP/22jQWAC0EJt+XxBiGgzgoFIAsgnP0N0IAZ6DdYkYlZ7A==; 24:ruYgknsM+kYKSP8tqPla5uCsrfnco9JPXYv5wAoln9aJmaNEsGcMP/y30MzEZqILT7cSBK29N0HdgeBhly+etZPFOubf5DhHw3q+DwysxMQ=; 7:mEF+lH5bXxPjvi7RMq5i1kHVZE1N8B1PcEIsg3N3CI6zQj45Vu8wcORh4AOv2Fe5ZOLpIWXdeT8YcWeUJsGcVKuuiQnfYLEXLrXOkTGqfbLAhiHL8efSvcwudXgEDIj9BJjzQlbcTefc+PHaU9jfcrvWgMRKqiHzWxlBZJcN3bgv/k2H/YqQi8gV8FWzFNvLU/4WPglRWKddPEl/CFh6yP0IabWWs2c6Wpk00FcXpZ6AscqcEU/72x6jmV390vIJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sonusnet.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2016 00:54:55.0546 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2740 Subject: [dpdk-dev] [PATCH v1] add mtu set in virtio X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2016 00:54:59 -0000 This functionality is required mostly in the cloud infrastructure. For example, if we use gre or vxlan network between compute and controller, then we should not use 1500 mtu in the guest as with encapsulation the sixe of the packet will be more and will get dropped in the infrastructure. So, in that case we should honor the mtu size sent by the dhcp server and configure the same on the virtual interfaces in the guest. This will also keep a consistent mtu through out the infrastructure. souvikdey33 (1): Signed-off-by: Souvik Dey drivers/net/virtio/virtio_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- >>From 2e4b391fe90ba5e617611e341a7d260dd3dd9144 Mon Sep 17 00:00:00 2001 From: souvikdey33 Date: Fri, 26 Aug 2016 20:46:21 -0400 Subject: [PATCH v1] Signed-off-by: Souvik Dey Fixes: 1fb8e8896ca8 ("Signed-off-by: Souvik Dey ") Virtio interfaces should also support setting of mtu, as in case of cloud it is expected to have the consistent mtu across the infrastructure that the dhcp server sends and not hardcoded to 1500(default). --- drivers/net/virtio/virtio_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 07d6449..da16ad4 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -92,6 +92,7 @@ static void virtio_mac_addr_add(struct rte_eth_dev *dev, static void virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index); static void virtio_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr); +static int virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static int virtio_dev_queue_stats_mapping_set( __rte_unused struct rte_eth_dev *eth_dev, @@ -652,6 +653,16 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) PMD_INIT_LOG(ERR, "Failed to disable allmulticast"); } +static int +virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +{ + struct virtio_hw *hw = dev->data->dev_private; + if (unlikely(mtu < (uint32_t)hw->vtnet_hdr_size + ETHER_HDR_LEN)) { + return -1; + } + return 0; +} + /* * dev_ops for virtio, bare necessities for basic operation */ @@ -664,6 +675,7 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .promiscuous_disable = virtio_dev_promiscuous_disable, .allmulticast_enable = virtio_dev_allmulticast_enable, .allmulticast_disable = virtio_dev_allmulticast_disable, + .mtu_set = virtio_mtu_set, .dev_infos_get = virtio_dev_info_get, .stats_get = virtio_dev_stats_get, -- 2.9.3.windows.1