From patchwork Fri Mar 24 20:51:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Kumar X-Patchwork-Id: 743376 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 3vqbJX5gnzz9s3w for ; Sat, 25 Mar 2017 07:54:36 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 851E9BBF; Fri, 24 Mar 2017 20:51:45 +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 24DA9B55 for ; Fri, 24 Mar 2017 20:51:39 +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 C3AE7D0 for ; Fri, 24 Mar 2017 20:51:38 +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; Fri, 24 Mar 2017 13:50:25 -0700 Received: from localhost.localdomain (htb-1s-eng-dhcp259.eng.vmware.com [10.33.79.3]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 7A25618485; Fri, 24 Mar 2017 13:51:34 -0700 (PDT) From: Anand Kumar To: Date: Fri, 24 Mar 2017 13:51:17 -0700 Message-ID: <20170324205117.8524-6-kumaranand@vmware.com> X-Mailer: git-send-email 2.9.3.windows.1 In-Reply-To: <20170324205117.8524-1-kumaranand@vmware.com> References: <20170324205117.8524-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 v6 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 Acked-by: Sairam Venugopal --- v5->v6: No Change 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 cbc7640..a68679c 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. */