From patchwork Tue Jul 26 13:19:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kavanagh X-Patchwork-Id: 652765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rzJcW5rHZz9t18 for ; Tue, 26 Jul 2016 23:19:23 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id CB90310BB8; Tue, 26 Jul 2016 06:19:22 -0700 (PDT) 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 74A8410BB0 for ; Tue, 26 Jul 2016 06:19:21 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id E10A0162450 for ; Tue, 26 Jul 2016 07:19:20 -0600 (MDT) X-ASG-Debug-ID: 1469539160-0b323703fb599460001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar6.cudamail.com with ESMTP id nWyXvYFnHVX0Or64 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 26 Jul 2016 07:19:20 -0600 (MDT) X-Barracuda-Envelope-From: mark.b.kavanagh@intel.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mga11.intel.com) (192.55.52.93) by mx1-pf2.cudamail.com with SMTP; 26 Jul 2016 13:19:20 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at intel.com designates 192.55.52.93 as permitted sender) X-Barracuda-Apparent-Source-IP: 192.55.52.93 X-Barracuda-RBL-IP: 192.55.52.93 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 26 Jul 2016 06:19:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,424,1464678000"; d="scan'208"; a="1024161701" Received: from silpixa00380299.ir.intel.com ([10.237.222.17]) by orsmga002.jf.intel.com with ESMTP; 26 Jul 2016 06:19:17 -0700 X-CudaMail-Envelope-Sender: mark.b.kavanagh@intel.com From: Mark Kavanagh To: dev@openvswitch.org X-CudaMail-MID: CM-E2-725016137 X-CudaMail-DTE: 072616 X-CudaMail-Originating-IP: 192.55.52.93 Date: Tue, 26 Jul 2016 14:19:17 +0100 X-ASG-Orig-Subj: [##CM-E2-725016137##][ovs-dev][PATCH] netdev-provider: fix comments for netdev_rxq_recv Message-Id: <1469539157-187340-1-git-send-email-mark.b.kavanagh@intel.com> X-Mailer: git-send-email 1.9.3 X-GBUdb-Analysis: 0, 192.55.52.93, Ugly c=0 p=-1 Source Normal X-MessageSniffer-Rules: 0-0-0-6957-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1469539160 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-ASG-Whitelist: EmailCat (corporate) Subject: [ovs-dev] [PATCH] netdev-provider: fix comments for netdev_rxq_recv 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" Commit 64839cf43 applies batch objects to netdev-providers, but some comments were not updated accordingly. Fix these: - replace 'pkts' with 'batch' - replace '*cnt' with 'batch->count' - replace MAX_RX_BATCH with NETDEV_MAX_BURST - remove superfluous whitespace Signed-off-by: Mark Kavanagh Signed-off-by: William Tu Acked-by: William Tu Acked-by: Flavio Leitner --- lib/netdev-provider.h | 4 ++-- lib/netdev.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index 915a5a5..3ded6c1 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -729,8 +729,8 @@ struct netdev_class { /* Attempts to receive a batch of packets from 'rx'. In 'batch', the * caller supplies 'packets' as the pointer to the beginning of an array - * of MAX_RX_BATCH pointers to dp_packet. If successful, the - * implementation stores pointers to up to MAX_RX_BATCH dp_packets into + * of NETDEV_MAX_BURST pointers to dp_packet. If successful, the + * implementation stores pointers to up to NETDEV_MAX_BURST dp_packets into * the array, transferring ownership of the packets to the caller, stores * the number of received packets into 'count', and returns 0. * diff --git a/lib/netdev.c b/lib/netdev.c index 31a6a46..be86519 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -608,14 +608,15 @@ netdev_rxq_close(struct netdev_rxq *rx) } } -/* Attempts to receive a batch of packets from 'rx'. 'pkts' should point to - * the beginning of an array of MAX_RX_BATCH pointers to dp_packet. If - * successful, this function stores pointers to up to MAX_RX_BATCH dp_packets - * into the array, transferring ownership of the packets to the caller, stores - * the number of received packets into '*cnt', and returns 0. +/* Attempts to receive a batch of packets from 'rx'. 'batch' should point to + * the beginning of an array of NETDEV_MAX_BURST pointers to dp_packet. If + * successful, this function stores pointers to up to NETDEV_MAX_BURST + * dp_packets into the array, transferring ownership of the packets to the + * caller, stores the number of received packets in 'batch->count', and returns + * 0. * * The implementation does not necessarily initialize any non-data members of - * 'pkts'. That is, the caller must initialize layer pointers and metadata + * 'batch'. That is, the caller must initialize layer pointers and metadata * itself, if desired, e.g. with pkt_metadata_init() and miniflow_extract(). * * Returns EAGAIN immediately if no packet is ready to be received or another @@ -625,7 +626,7 @@ netdev_rxq_recv(struct netdev_rxq *rx, struct dp_packet_batch *batch) { int retval; - retval = rx->netdev->netdev_class->rxq_recv(rx, batch); + retval = rx->netdev->netdev_class->rxq_recv(rx, batch); if (!retval) { COVERAGE_INC(netdev_received); } else {