From patchwork Sat Dec 28 07:11:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1215821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.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="gh9+RiBk"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47lFHN3ZLbz9sPW for ; Sat, 28 Dec 2019 18:11:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AC2A5878B3; Sat, 28 Dec 2019 07:11:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rUs4Xxvldp2l; Sat, 28 Dec 2019 07:11:41 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id A4D5A875DA; Sat, 28 Dec 2019 07:11:41 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 834C4C1D85; Sat, 28 Dec 2019 07:11:41 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 48967C1796 for ; Sat, 28 Dec 2019 07:11:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 41CE287874 for ; Sat, 28 Dec 2019 07:11:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7mS6VFfAPVKF for ; Sat, 28 Dec 2019 07:11:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5206F87702 for ; Sat, 28 Dec 2019 07:11:38 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id i6so8925436pfc.1 for ; Fri, 27 Dec 2019 23:11:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EpwgJo48rQcfcD9YmN31eB6K2+FqUmgCOoDWshSLtXI=; b=gh9+RiBkSrlabyQXBAwkEtUiNeQZ2dKN9k1Ew9FE3kfKaQNAre/qkSzMD7wws4kv3b HlOTYLOFqsjgHugbjxbzhyx3ttWuv6HKj8/YejsFHjiqbChJvth5pa8NhmCZQHOh/CV6 pdU/mYjdi8ltXt/VgzvZPsoGApmxXc+8i2d5AI9/qurgWsljZiskSijL5qtEV/iQSl43 a7Q1B8VxQg325dre/1UFxlkTbGwxzFZzLbqlVYRLW1iFPjlDB2Ja2PxFSjc07KAl/LPX O93f5yd2FhxUKRz15iv7MlsVSsdvL+HIVG39zmK5MLIIlHeMH7F+Q/oCaj4iXg/kftKh T3Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EpwgJo48rQcfcD9YmN31eB6K2+FqUmgCOoDWshSLtXI=; b=Rn4XFS37tqWeBE7uTQ1wiNu4jZ//3woTAhJyD9469A4wnwy3VfhHIvmnuESSBSueXk goPlBk4msqv43G6bHnqM/7DKGXuWNSQkqMU+TD2hW73GmDpLucGO9Ia6vId2IWT0bxhK 0ejnqmkIJVB9fdboTUMDQxBTYKkq34yzEcqurNxDPR2DWwbuzNdvLH3gpnTeHN3wLWuw XngiowoKfkD9tdhSwuqjAYtyfAwdicnQQPxY5tLm5FphRSeX1WbSMf91qNY8WiWNqVpa 3QjJrA+d6pKXwHLP5Qu3sCc9krmxGma9mJAQ6x99ci9ImQSE1MTz9U6apbTO+D3XOfib sYSw== X-Gm-Message-State: APjAAAU4Ops1yigPvSu4Jraajfqn9Ab7G5jpMhxGsEUOCIxC32ICXhs5 GS2wzBRoNRZcro3AILU/+VY= X-Google-Smtp-Source: APXvYqymy/jZ1hk1WSs20/8GfFUfbaZgXaIdH+aRn3+ULWqlkQ3QnFfYWmww/a6zG2OOcPPg/TmeIw== X-Received: by 2002:a63:1c1d:: with SMTP id c29mr59380235pgc.14.1577517097993; Fri, 27 Dec 2019 23:11:37 -0800 (PST) Received: from local.opencloud.tech.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id o2sm17380429pjo.26.2019.12.27.23.11.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Dec 2019 23:11:37 -0800 (PST) From: xiangxia.m.yue@gmail.com To: blp@ovn.org, i.maximets@ovn.org, elibr@mellanox.com Date: Sat, 28 Dec 2019 15:11:13 +0800 Message-Id: <1577517076-105041-5-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1577517076-105041-1-git-send-email-xiangxia.m.yue@gmail.com> References: <1577517076-105041-1-git-send-email-xiangxia.m.yue@gmail.com> Cc: dev@openvswitch.org, martinbj2008@gmail.com Subject: [ovs-dev] [ovs-dev 4/7] netdev-offload-provider: Add meter offload struct X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Tonghao Zhang Introduce the meter offload struct and dp_meter use it. Signed-off-by: Tonghao Zhang --- lib/dpif-netdev.h | 2 ++ lib/netdev-offload-provider.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/dpif-netdev.h b/lib/dpif-netdev.h index b5f5c12..123cf99 100644 --- a/lib/dpif-netdev.h +++ b/lib/dpif-netdev.h @@ -21,6 +21,7 @@ #include #include #include "dpif.h" +#include "netdev-offload-provider.h" #include "openvswitch/types.h" #include "dp-packet.h" #include "packets.h" @@ -47,6 +48,7 @@ struct dp_meter { uint64_t used; uint64_t packet_count; uint64_t byte_count; + struct netdev_offload_meter *offload; struct dp_meter_band bands[]; }; diff --git a/lib/netdev-offload-provider.h b/lib/netdev-offload-provider.h index d0d3fb2..fb33309 100644 --- a/lib/netdev-offload-provider.h +++ b/lib/netdev-offload-provider.h @@ -88,6 +88,16 @@ struct netdev_flow_api { int (*init_flow_api)(struct netdev *); }; +struct netdev_offload_meter_api { + void (*meter_destroy)(void *); + void (*meter_update)(void *, void *); +}; + +struct netdev_offload_meter { + void *priv_data; + struct netdev_offload_meter_api *meter_ops; +}; + int netdev_register_flow_api_provider(const struct netdev_flow_api *); int netdev_unregister_flow_api_provider(const char *type);