From patchwork Fri Nov 6 03:12:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniele Di Proietto X-Patchwork-Id: 540791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 85A3E1402D7 for ; Fri, 6 Nov 2015 14:12:59 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id F288122C38D; Thu, 5 Nov 2015 19:12:49 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id A0FCC22C388 for ; Thu, 5 Nov 2015 19:12:48 -0800 (PST) Received: from bar3.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 312D0162E46 for ; Thu, 5 Nov 2015 20:12:48 -0700 (MST) X-ASG-Debug-ID: 1446779567-03dd7b577618a80001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar3.cudamail.com with ESMTP id cQ5u2lE0v9SpERLb (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 05 Nov 2015 20:12:47 -0700 (MST) X-Barracuda-Envelope-From: diproiettod@vmware.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO smtp-outbound-2.vmware.com) (208.91.2.13) by mx3-pf3.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 6 Nov 2015 03:24:23 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at _spf.vmware.com designates 208.91.2.13 as permitted sender) X-Barracuda-Apparent-Source-IP: 208.91.2.13 X-Barracuda-RBL-IP: 208.91.2.13 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id DBB1B28448 for ; Thu, 5 Nov 2015 19:12:46 -0800 (PST) Received: from diproiettod-dev.localdomain (unknown [10.33.74.202]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id DDD3D40250; Thu, 5 Nov 2015 19:12:46 -0800 (PST) X-CudaMail-Envelope-Sender: diproiettod@vmware.com From: Daniele Di Proietto To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-1104071688 X-CudaMail-DTE: 110515 X-CudaMail-Originating-IP: 208.91.2.13 Date: Thu, 5 Nov 2015 19:12:38 -0800 X-ASG-Orig-Subj: [##CM-V3-1104071688##][PATCH v2 07/11] dpif-netlink: Implement ct_flush. Message-Id: <1446779562-3837-8-git-send-email-diproiettod@vmware.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446779562-3837-1-git-send-email-diproiettod@vmware.com> References: <1446779562-3837-1-git-send-email-diproiettod@vmware.com> X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1446779567 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-ASG-Whitelist: EmailCat (corporate) Subject: [ovs-dev] [PATCH v2 07/11] dpif-netlink: Implement ct_flush. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" This member function is used by the ct-dpif module to provide its services. It's implemented using the netlink-conntrack module. N.B. The Linux kernel datapaths share the connection tracker among them and with the rest of the system. Therefore the operations are not really dpif specific. Signed-off-by: Daniele Di Proietto --- lib/dpif-netlink.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index 189506c..99457b9 100644 --- a/lib/dpif-netlink.c +++ b/lib/dpif-netlink.c @@ -2331,6 +2331,16 @@ dpif_netlink_ct_dump_done(struct dpif *dpif OVS_UNUSED, return err; } +static int +dpif_netlink_ct_flush(struct dpif *dpif OVS_UNUSED, const uint16_t *zone) +{ + if (zone) { + return nl_ct_flush_zone(*zone); + } else { + return nl_ct_flush(); + } +} + const struct dpif_class dpif_netlink_class = { "system", NULL, /* init */ @@ -2374,7 +2384,7 @@ const struct dpif_class dpif_netlink_class = { dpif_netlink_ct_dump_start, dpif_netlink_ct_dump_next, dpif_netlink_ct_dump_done, - NULL, /* ct_flush */ + dpif_netlink_ct_flush, }; static int