From patchwork Thu Feb 2 18:55:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Kumar X-Patchwork-Id: 723267 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vDq5q0wlFz9s0m for ; Fri, 3 Feb 2017 05:58:39 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 7EF5CC8D; Thu, 2 Feb 2017 18:56:05 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id CEA72C6D for ; Thu, 2 Feb 2017 18:56:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from EX13-EDG-OU-001.vmware.com (ex13-edg-ou-001.vmware.com [208.91.0.189]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 98F93233 for ; Thu, 2 Feb 2017 18:56:00 +0000 (UTC) Received: from sc9-mailhost1.vmware.com (10.113.161.71) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Thu, 2 Feb 2017 10:54:50 -0800 Received: from localhost.localdomain (htb-1s-eng-dhcp259.eng.vmware.com [10.33.79.3]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 3F2A2183F8; Thu, 2 Feb 2017 10:55:57 -0800 (PST) From: Anand Kumar To: Date: Thu, 2 Feb 2017 10:55:38 -0800 Message-ID: <20170202185538.7560-6-kumaranand@vmware.com> X-Mailer: git-send-email 2.9.3.windows.1 In-Reply-To: <20170202185538.7560-1-kumaranand@vmware.com> References: <20170202185538.7560-1-kumaranand@vmware.com> MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-001.vmware.com: kumaranand@vmware.com does not designate permitted sender hosts) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v5 5/5] datapath-windows: Fragment NBL based on MRU size X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This patch adds support for Fragmenting NBL based on the MRU value. MRU value is updated only for Ipv4 fragments, if it is non zero, then fragment the NBL and send out the new NBL to the vnic. Signed-off-by: Anand Kumar --- v4->v5: - Use MRU information in the _OVS_BUFFER_CONTEXT to fragment NBL. v3->v4: No Change v2->v3: - Updated log message v1->v2: No change --- datapath-windows/ovsext/Actions.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index 3dea9a9..1a67d2b 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -34,6 +34,7 @@ #include "Vport.h" #include "Vxlan.h" #include "Geneve.h" +#include "IpFragment.h" #ifdef OVS_DBG_MOD #undef OVS_DBG_MOD @@ -864,6 +865,8 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx) NDIS_STATUS status = STATUS_SUCCESS; POVS_SWITCH_CONTEXT switchContext = ovsFwdCtx->switchContext; PCWSTR dropReason; + PNET_BUFFER_LIST fragNbl = NULL; + POVS_BUFFER_CONTEXT ctx; /* * Handle the case where the some of the destination ports are tunneled @@ -909,6 +912,30 @@ OvsOutputForwardingCtx(OvsForwardingContext *ovsFwdCtx) goto dropit; } + ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(ovsFwdCtx->curNbl); + if (ctx->mru != 0) { + /* Fragment nbl based on mru. If it returns NULL then the original + * reassembled NBL is sent out to the VIF which will be dropped if + * the packet size is more than VIF MTU. + */ + fragNbl = OvsFragmentNBL(ovsFwdCtx->switchContext, + ovsFwdCtx->curNbl, + &(ovsFwdCtx->layers), + ctx->mru, 0, TRUE); + if (fragNbl != NULL) { + OvsCompleteNBLForwardingCtx(ovsFwdCtx, + L"Dropped since fragmenting NBL"); + status = OvsInitForwardingCtx(ovsFwdCtx, + ovsFwdCtx->switchContext, + fragNbl, + ovsFwdCtx->srcVportNo, + ovsFwdCtx->sendFlags, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(fragNbl), + ovsFwdCtx->completionList, + &ovsFwdCtx->layers, FALSE); + } + } + OvsSendNBLIngress(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, ovsFwdCtx->sendFlags); /* End this pipeline by resetting the corresponding context. */