From patchwork Wed Aug 11 03:30:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: liyang_12921 X-Patchwork-Id: 1515560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=kSumfAMm; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GkwMH1nHRz9sWl for ; Wed, 11 Aug 2021 13:30:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 92F8C4044D; Wed, 11 Aug 2021 03:30:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T0svQoARiDV9; Wed, 11 Aug 2021 03:30:42 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id E4BA440368; Wed, 11 Aug 2021 03:30:41 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BBB0DC001A; Wed, 11 Aug 2021 03:30:41 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 963E6C000E for ; Wed, 11 Aug 2021 03:30:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 72B6A82CE5 for ; Wed, 11 Aug 2021 03:30:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=163.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2fl_B5mJ9DQY for ; Wed, 11 Aug 2021 03:30:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from m1366.mail.163.com (m1366.mail.163.com [220.181.13.66]) by smtp1.osuosl.org (Postfix) with ESMTP id D4C2482974 for ; Wed, 11 Aug 2021 03:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=ALXM4 YQkxfOzDCGt18v/879QVydpgP03rUGvqLn2tYw=; b=kSumfAMmfCXpL4uwbA9my Dj92/EPSQsaxFm0hWY1DPuzWSicBGangnZOIUxHNM2wgP/0DjXY7ryhumDZArgO7 Ap56qiX6jbHt16YIven4moOI9LSul1rKX3xfSu0qI+lzoszdqfZIZnAGbZv3m8Di 5O4CGnToFJHPkDXobGlbj4= Received: from liyang_12921$163.com ( [115.236.119.135] ) by ajax-webmail-wmsvr66 (Coremail) ; Wed, 11 Aug 2021 11:30:33 +0800 (GMT+08:00) X-Originating-IP: [115.236.119.135] Date: Wed, 11 Aug 2021 11:30:33 +0800 (GMT+08:00) From: liyang_12921 To: "ovs-dev@openvswitch.org" X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.13 build 20201118(88fc36b2) MailMasterPC/4.15.6.1016_(Windows_10_20H1) Copyright (c) 2002-2021 www.mailtech.cn 163com MIME-Version: 1.0 Message-ID: <5eb89ed2.6b88.17b3342feb0.Coremail.liyang_12921@163.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: QsGowADXHrxZRBNhY0RvAA--.19809W X-CM-SenderInfo: pol1t0tjbrjmisr6il2tof0z/1tbiLx3rTFUMZmyNnAABsW X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [ovs-dev] Execute the DPIF_OP_FLOW_PUT action after the slowpath packet is sent X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" We encountered a problem when using ovs to provide forwarding for vm. A process in the vm frequently uploads files to the NOS server, and the tcp sessons of uploading is often reset by NOS server. Through packet capture, we found that when the session is reset, the packets sent by the vm are always out of order, and reset packet is sent only when the ack packet of the three-way handshake is out of order. Note that the ack packet of the three-way handshake is the first packet of ct table with ct_state is -new. We use skb_tracer to trace the sending order of packets in client host, then we find that after DPIF_OP_FLOW_PUT action and before the slow path packets were sent, some subsequent packets directly match the datapath flow and were sent. After discovering the above problems, we made a simple change to the code,make DPIF_OP_FLOW_PUT action be executed after the slowpath packets were sent. The reset never happened again after this. However, I am not sure whether this change will bring other problems. Who can help give an accurate assessment: 1) What was the reason for this design that execute the DPIF_OP_FLOW_PUT action first? 2) Whether this change will cause other problems?If not, can we merge this change into the master? In this way, the out-of-order packets can be effectively avoided. op->ukey = NULL; @@ -1610,6 +1601,15 @@ handle_upcalls(struct udpif *udpif, struct upcall *upcalls, op->dop.execute.mtu = upcall->mru; op->dop.execute.skb_hash = upcall->skb_hash; } + + if (should_install_flow(udpif, upcall)) { + struct udpif_key *ukey = upcall->ukey; + + if (ukey_install(udpif, ukey)) { + upcall->ukey_persists = true; + put_op_init(&ops[n_ops++], ukey, DPIF_FP_CREATE); + } + } } /* Execute batch. */ | | liyang_12921 | | liyang_12921@163.com | 签名由网易邮箱大师定制 diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 05ff8cd72..63214def6 100755 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -1586,15 +1586,6 @@ handle_upcalls(struct udpif *udpif, struct upcall *upcalls, const struct dp_packet *packet = upcall->packet; struct ukey_op *op; - if (should_install_flow(udpif, upcall)) { - struct udpif_key *ukey = upcall->ukey; - - if (ukey_install(udpif, ukey)) { - upcall->ukey_persists = true; - put_op_init(&ops[n_ops++], ukey, DPIF_FP_CREATE); - } - } - if (upcall->odp_actions.size) { op = &ops[n_ops++];