From patchwork Thu Sep 17 20:29:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 519017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 61A5E1402A2 for ; Fri, 18 Sep 2015 06:30:14 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 65ABD10B39; Thu, 17 Sep 2015 13:30:13 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 8989B10B2F for ; Thu, 17 Sep 2015 13:30:12 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id 3927A618968 for ; Thu, 17 Sep 2015 14:30:10 -0600 (MDT) X-ASG-Debug-ID: 1442521808-03dc21486604b80001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar4.cudamail.com with ESMTP id PLA6z0rfNHIJVTFj (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 17 Sep 2015 14:30:08 -0600 (MDT) X-Barracuda-Envelope-From: zoltan.kiss@linaro.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mail-wi0-f174.google.com) (209.85.212.174) by mx3-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 17 Sep 2015 20:30:02 -0000 Received-SPF: pass (mx3-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.212.174 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.212.174 X-Barracuda-RBL-IP: 209.85.212.174 Received: by wicfx3 with SMTP id fx3so39102049wic.1 for ; Thu, 17 Sep 2015 13:29:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VkHiEim22Gt8mzYtFR9ZmJwpKg8b5FYLXxemNik0JcY=; b=mcel/kc5JT6ZM6mOYpTHrJ5cmG5gbpbhz65DihRoODNXS0pMs4t5cPAZ3ulwBfNZ66 O/0Y38aS7B1FB1JP8LUMbjCe2xSdPuCIv0CHftLQgv3pXruXz1M2gOd+164hrNINc1SO C5SkdSnNKk2PDv7vQzmvHm/Oei1pUhKQ3uWbkA32a3VWCIuIHFXTPtUhq9ifEeSfuF7W /D8t3ZwUU5LwDkhKGHWjHpFa6VFFEm6pSc43E2pTCMjk9Fq4gDQ6yPigVyRt57XXPTl9 PGp+50TQJ88nuJ0jcMIVIv+6Aj2/IPksp0VGz83pJ/e+96/GBQxvkvUyc9UZOVFYa9xt CVKA== X-Gm-Message-State: ALoCoQmvJANvwWJtZKNK1HjnumEjY25PfyYINm79Ag4nIgYKUpCny0GwqrBMppror03sRdZ8SAqF X-Received: by 10.180.24.102 with SMTP id t6mr34207017wif.83.1442521799158; Thu, 17 Sep 2015 13:29:59 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id xt1sm5170870wjb.32.2015.09.17.13.29.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Sep 2015 13:29:58 -0700 (PDT) X-CudaMail-Envelope-Sender: zoltan.kiss@linaro.org From: Zoltan Kiss To: dev@openvswitch.org X-CudaMail-MID: CM-V1-916056799 X-CudaMail-DTE: 091715 X-CudaMail-Originating-IP: 209.85.212.174 Date: Thu, 17 Sep 2015 21:29:45 +0100 X-ASG-Orig-Subj: [##CM-V1-916056799##][PATCH] dpif-netdev: move header prefetch earlier into the receive function Message-Id: <1442521785-32423-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-GBUdb-Analysis: 0, 209.85.212.174, Ugly c=0.495897 p=-0.349593 Source Normal X-MessageSniffer-Rules: 0-0-0-4904-c X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1442521808 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.22645 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH] dpif-netdev: move header prefetch earlier into the receive function 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" It's better to have it in the cache as soon as possible. On my test setup it meant a 0.7 Mpps increase. Signed-off-by: Zoltan Kiss diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 72e5653..3312cc0 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3229,11 +3229,6 @@ emc_processing(struct dp_netdev_pmd_thread *pmd, struct dp_packet **packets, continue; } - if (i != cnt - 1) { - /* Prefetch next packet data */ - OVS_PREFETCH(dp_packet_data(packets[i+1])); - } - miniflow_extract(packets[i], &key.mf); key.len = 0; /* Not computed yet. */ key.hash = dpif_netdev_packet_get_rss_hash(packets[i], &key.mf); diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index e4e3d2c..c3c7ec0 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1015,7 +1015,7 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets, struct netdev_rxq_dpdk *rx = netdev_rxq_dpdk_cast(rxq_); struct netdev *netdev = rx->up.netdev; struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); - int nb_rx; + int nb_rx, i; /* There is only one tx queue for this core. Do not flush other * queues. @@ -1033,6 +1033,9 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet **packets, return EAGAIN; } + for (i = 0; i < nb_rx; i++) + OVS_PREFETCH(dp_packet_data(packets[i])); + *c = nb_rx; return 0;