From patchwork Wed Feb 13 23:34:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1041713 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="YkKoFyst"; 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 440GJ46Q33z9rxp for ; Thu, 14 Feb 2019 10:41:24 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B4B9519DA; Wed, 13 Feb 2019 23:39:04 +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 E2444193F for ; Wed, 13 Feb 2019 23:34:54 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 10CA127B for ; Wed, 13 Feb 2019 23:34:52 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id w7so1920874pgp.13 for ; Wed, 13 Feb 2019 15:34:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=fKVmnOi27vsEtsTL8fji/iRYkY5YNyBmUnHL14RPXuE=; b=YkKoFystbeJMCH2kk/d97K1nG2Y4TE5z0Yk7h1jWAAuUYFvfNJo15Njt7fI/l3pDg+ e4XOG5z3QaKyR2SLOz+bTZjOT/OosZ9sJtKgLEnycfiRHBPJ6soHO0zVd6PYIHzwjSKr InbmNyttzlPoasLRvbJRmlYCNeGG9K/Hpnd1pxS7aEThFTeRUONGnPYqegExQy3S4Vnr wJB+8HFpNU+dmQtORycsTPMVoTUF5WpJ9C5O6tkVXWp5bIRN8a3i8vKDJ173FtbwTRQ0 qc0DDH0KtwpphUS1rq9cRjt8nEjXG6LmL/Kah/CJsDP//GCAThAKNYRJCAGRlqbep1RR AEzQ== 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:in-reply-to :references; bh=fKVmnOi27vsEtsTL8fji/iRYkY5YNyBmUnHL14RPXuE=; b=AfWnDd3/T8oqKIj4ssnkz7sqOKxp9GfmzI1nXV1cX1cOm1+d4ZhLzkFbLDKW+BoEij 1ny9tI/vBFPKB2uowfDqAF2pRw1PH653AJEzs0Q9ePnnzeH/1MnxJKk4RYsBOf0sOM4f 6GSi1Bv/XPUZ2g8c1GrDBc0fyV7y/jgvm99oYNlzEG5ILGaj2aETHMsgQSkZ7BAXWcZE h68eflmnuENu0iF4w+Wpb2InhO2Zmqql9mDaDRrnHdp4heclQYZM14VSC9Aq8QimvwCd ZU073P6cluUjuXnQddB5YyPLh/e5YybLDrzW+xLnczz34KRnDMBNQPYSRgKUFvwAIrZU gLDg== X-Gm-Message-State: AHQUAuZSaeTlCl8OjGM3/Q1lK9IW+G2uelfBhv2UjMsSG58yCwujNdim v2Jxv5GuS/HdMcC4ZihVKuc= X-Google-Smtp-Source: AHgI3Ia3MKEKgCZmbApzyRXzEhvOdvamhY/OnNABPFDBAgoxvKWReJgMVEd9SLHGakj5IT1S7oSdhg== X-Received: by 2002:a63:9c1a:: with SMTP id f26mr699214pge.381.1550100892696; Wed, 13 Feb 2019 15:34:52 -0800 (PST) Received: from ubuntu.localdomain ([208.91.2.2]) by smtp.gmail.com with ESMTPSA id k9sm490173pgo.1.2019.02.13.15.34.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Feb 2019 15:34:52 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Wed, 13 Feb 2019 15:34:19 -0800 Message-Id: <1550100861-2086-7-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550100861-2086-1-git-send-email-dlu998@gmail.com> References: <1550100861-2086-1-git-send-email-dlu998@gmail.com> 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 v13 6/8] dp-packet: Add 'dp_packet_batch_is_full()' api. 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 This new api is used in a subsequent patch and may otherwise be useful. Signed-off-by: Darrell Ball --- lib/dp-packet.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 26cfcb9..31c26e5 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -817,6 +817,12 @@ dp_packet_batch_is_empty(const struct dp_packet_batch *batch) return !dp_packet_batch_size(batch); } +static inline bool +dp_packet_batch_is_full(const struct dp_packet_batch *batch) +{ + return dp_packet_batch_size(batch) == NETDEV_MAX_BURST; +} + #define DP_PACKET_BATCH_FOR_EACH(IDX, PACKET, BATCH) \ for (size_t IDX = 0; IDX < dp_packet_batch_size(BATCH); IDX++) \ if (PACKET = BATCH->packets[IDX], true)