From patchwork Tue Sep 12 18:25:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bodireddy, Bhanuprakash" X-Patchwork-Id: 813007 X-Patchwork-Delegate: dlu998@gmail.com 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=) 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 3xsD3q62L4z9s81 for ; Wed, 13 Sep 2017 04:34:47 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 82CA8AB9; Tue, 12 Sep 2017 18:34: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 D21D49F0 for ; Tue, 12 Sep 2017 18:34:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 75F1E101 for ; Tue, 12 Sep 2017 18:34:43 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2017 11:34:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,383,1500966000"; d="scan'208";a="151049985" Received: from silpixa00393942.ir.intel.com (HELO silpixa00393942.ger.corp.intel.com) ([10.237.223.42]) by fmsmga006.fm.intel.com with ESMTP; 12 Sep 2017 11:34:42 -0700 From: Bhanuprakash Bodireddy To: dev@openvswitch.org Date: Tue, 12 Sep 2017 19:25:04 +0100 Message-Id: <1505240705-28120-1-git-send-email-bhanuprakash.bodireddy@intel.com> X-Mailer: git-send-email 2.4.11 X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 1/2] conntrack: Use DP_PACKET_BATCH_FOR_EACH macro. 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 Use DP_PACKET_BATCH_FOR_EACH macro in conntrack_execute(). No change in functionality. Signed-off-by: Bhanuprakash Bodireddy --- lib/conntrack.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index 419cb1d..019092e 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -1141,17 +1141,16 @@ conntrack_execute(struct conntrack *ct, struct dp_packet_batch *pkt_batch, long long now) { - struct dp_packet **pkts = pkt_batch->packets; - size_t cnt = pkt_batch->count; + struct dp_packet *packet; struct conn_lookup_ctx ctx; - for (size_t i = 0; i < cnt; i++) { - if (!conn_key_extract(ct, pkts[i], dl_type, &ctx, zone)) { - pkts[i]->md.ct_state = CS_INVALID; - write_ct_md(pkts[i], zone, NULL, NULL, NULL); + DP_PACKET_BATCH_FOR_EACH (packet, pkt_batch) { + if (!conn_key_extract(ct, packet, dl_type, &ctx, zone)) { + packet->md.ct_state = CS_INVALID; + write_ct_md(packet, zone, NULL, NULL, NULL); continue; } - process_one(ct, pkts[i], &ctx, zone, force, commit, + process_one(ct, packet, &ctx, zone, force, commit, now, setmark, setlabel, nat_action_info, helper); } From patchwork Tue Sep 12 18:25:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bodireddy, Bhanuprakash" X-Patchwork-Id: 813008 X-Patchwork-Delegate: dlu998@gmail.com 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=) 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 3xsD4Q2PwPz9s81 for ; Wed, 13 Sep 2017 04:35:18 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 87292AAB; Tue, 12 Sep 2017 18:34:46 +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 5837B9F0 for ; Tue, 12 Sep 2017 18:34:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1AF7C101 for ; Tue, 12 Sep 2017 18:34:44 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2017 11:34:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,383,1500966000"; d="scan'208";a="151050034" Received: from silpixa00393942.ir.intel.com (HELO silpixa00393942.ger.corp.intel.com) ([10.237.223.42]) by fmsmga006.fm.intel.com with ESMTP; 12 Sep 2017 11:34:43 -0700 From: Bhanuprakash Bodireddy To: dev@openvswitch.org Date: Tue, 12 Sep 2017 19:25:05 +0100 Message-Id: <1505240705-28120-2-git-send-email-bhanuprakash.bodireddy@intel.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1505240705-28120-1-git-send-email-bhanuprakash.bodireddy@intel.com> References: <1505240705-28120-1-git-send-email-bhanuprakash.bodireddy@intel.com> X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 2/2] dpif-netdev: Fix comments for pmd_load_cached_ports. 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 Commit 57eebbb4c315 replaces thread local 'pmd->port_cache' with 'pmd->tnl_port_cache' and 'pmd->send_port_cache' maps. Update the comments accordingly. Fixes: 57eebbb4c315 ("Don't try to output on a device without txqs") Signed-off-by: Bhanuprakash Bodireddy --- lib/dpif-netdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index ca74df8..11d3ab4 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3933,7 +3933,9 @@ pmd_free_cached_ports(struct dp_netdev_pmd_thread *pmd) } /* Copies ports from 'pmd->tx_ports' (shared with the main thread) to - * 'pmd->port_cache' (thread local) */ + * thread-local copies. Copy to 'pmd->tnl_port_cache' if it is a tunnel + * device, otherwise to 'pmd->send_port_cache' if the port has atleast + * one txq. */ static void pmd_load_cached_ports(struct dp_netdev_pmd_thread *pmd) OVS_REQUIRES(pmd->port_mutex)