From patchwork Mon Jul 9 16:32:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 941432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AydA2nl3"; dkim-atps=neutral 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 41PW8V0h54z9rvt for ; Tue, 10 Jul 2018 02:32:41 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3BCA8D4C; Mon, 9 Jul 2018 16:32:39 +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 CF6FCCD7 for ; Mon, 9 Jul 2018 16:32:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f44.google.com (mail-pl0-f44.google.com [209.85.160.44]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C16B178D for ; Mon, 9 Jul 2018 16:32:36 +0000 (UTC) Received: by mail-pl0-f44.google.com with SMTP id t6-v6so6274787plo.7 for ; Mon, 09 Jul 2018 09:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=PHeRwGJb2dlBigbmuO29pbVTKAZaQiep3RB7rOb8aPY=; b=AydA2nl3Is5fcKKqNRsC3M3rA+EjKCGYPQvxvrfLNAGDq1xrW7l2VwJ17DhPs1H95m IcxzXJZ6Y+lEQdghP4mDK/KIWdbef23Q6+kFmyX1N0iO9e3SJJ8ks7oEBkqm62J+8m1h Xhj4e1Q1yWzQk0Srb5IQvTe/R/zTUlw8sWNXLOjoQ5EyIgTo6gQS3ziCEzKMadYu80p6 9cpNb+9dgBYBVgf5ZFKtcFPMLEgomv0Z7DCDrfPTC2n22WSwXhdLMmiXk++Fu8rMesyX khBnkgEAHIdFwzQQ4Nh4nT8cQjXfIfScae09XmnL47+IOGgrvVjdRWUOHC+zYoUnezOR ajJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=PHeRwGJb2dlBigbmuO29pbVTKAZaQiep3RB7rOb8aPY=; b=NGTWziUwXIF1dkg6zkyKeG54SD7ce6kLIO4Vq/+vnIJU5Z/5MD5V1tQQrMNNC/5Mty jmT5zK2Rg7DnAVyZfVmfXf6iOP0I8tWZGfvloBJp4XhgQ1rotpmUbh17lXWN/9i7lqfs dVz4+pzZCzwTyce8DNC/yF2VEJL28PCYPDtEChBuRxXzr0HPMR7E+HSVVq+EKTXiBYj/ BCGF1S/lrcXTBmWSBGCQn5kD0xD/xYqlSpR0+mR8GHHgakJkekr+VWboNmMQGETynj0B MtF/Fc03x0RaRC46cgPfZQDHNTL4fMY29SlmyfJsoQqhueU7RaxlklLypUgxETeE7/8P 2a4A== X-Gm-Message-State: APt69E28UyMLW95i/xiaArJ4HvRXzrAhqDYkeb2ikBRLGDZsBOCd6cCr jk406wMZQjaipxEoxoiYf0k= X-Google-Smtp-Source: AAOMgpehWgZNB34wTCBNjqjmrAl++y3m5DL+qbIG8Pm7tVHcw51IAz0OvAN7Hmfj7m19k1zaTTD5Pg== X-Received: by 2002:a17:902:a518:: with SMTP id s24-v6mr21511842plq.144.1531153956264; Mon, 09 Jul 2018 09:32:36 -0700 (PDT) Received: from ubuntu.localdomain (c-73-162-236-45.hsd1.ca.comcast.net. [73.162.236.45]) by smtp.gmail.com with ESMTPSA id u2-v6sm23828301pfn.59.2018.07.09.09.32.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jul 2018 09:32:34 -0700 (PDT) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Mon, 9 Jul 2018 09:32:16 -0700 Message-Id: <1531153945-121300-1-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [patch v7 0/9] Userspace datapath: Add fragmentation support. 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Fragmentation support for userspace datapath conntrack is added; both v4 and v6 are supported. See the patches for additional details. Fragmentation tests for the userspace datapath are enabled by the patches and other test enhancements are added. v6->v7: Address review comments (Thanks Justin). Rebase. Fix a couple bugs. Some enhancements. v5->v6: Rebase Folded patch 4 and some test enablement into patch 3 and brought an earlier patch forward in sequence Enable fragmentation by default Cleaup v4->v5: Added a sub-feature to optionally dump fragmentation lists. This is useful for DOS forensics and debugging. The testing coverage was also extended including checking more counters and frag list occupancies. Fixed a few bugs: 1/ Handle dpdk mempool source restrictions for a batch of packets from multiple sources; this also brings in a purge frag list function to handle pathological cases of stuck frags. 2/ ipf_destroy was missing packet frees for frag lists. 3/ A setting of CS_INVALID was missing for expired packets - I mentioned this earlier for version 4. Some enhancements and coding standards changes for Patch 3. v3->v4: Add V6 support to the patches. Fix possible race cleanup bug when the user disables fragmentation and there are list occupancies, not cleaned up yet. Add missed orig tuple fields for copy from reassembled packet to fragments. Fix an fragment list increment check - shoiuld have been "> 0" rather then "!= 0". Fix max frags calculation in case of theoretical corner case. Add proper lock annotations. Made some other improvements while adding V6 support. v2->v3: Patch 2 was updated: Remove "XXX" todo items by implementing the ones needed, including realloc frag_list contexts to save memory. Fix related bug with max_frag_list_size when min_frag_size is reconfigured. Tighten ip_tot_len sanity check for reassembled packets which was more loose than intended. Add another sanity check for fragment ip_tot_len; even though it be redundant, add for completeness. v1->v2: Few fixes, improvements and cleanups. Darrell Ball (9): dp-packet: Add const qualifiers for checksum apis. flow: Enhance parse_ipv6_ext_hdrs. tests: Add missed local stack checks. conntrack: Reword conntrack_execute() description. Userspace datapath: Add fragmentation handling. ipf: Add command to disable fragmentation handling. ipf: Add set minimum fragment size command. ipf: Add set maximum fragments supported command. ipf: Add fragmentation status reporting. NEWS | 12 + include/sparse/netinet/ip6.h | 1 + lib/automake.mk | 2 + lib/conntrack.c | 17 +- lib/ct-dpif.c | 69 ++ lib/ct-dpif.h | 13 + lib/dp-packet.h | 8 +- lib/dpctl.c | 227 ++++++ lib/dpctl.man | 38 + lib/dpif-netdev.c | 83 +++ lib/dpif-netlink.c | 7 + lib/dpif-provider.h | 25 +- lib/flow.c | 31 +- lib/flow.h | 3 +- lib/ipf.c | 1413 ++++++++++++++++++++++++++++++++++++++ lib/ipf.h | 76 ++ tests/system-kmod-macros.at | 42 +- tests/system-traffic.at | 64 +- tests/system-userspace-macros.at | 148 +++- 19 files changed, 2216 insertions(+), 63 deletions(-) create mode 100644 lib/ipf.c create mode 100644 lib/ipf.h