From patchwork Wed Jun 9 09:52:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 1489770 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=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=YgGWUYpc; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0Mpm399xz9sCD for ; Wed, 9 Jun 2021 19:52:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 297B083C39; Wed, 9 Jun 2021 09:52:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PIN8fZWtQpFS; Wed, 9 Jun 2021 09:52:29 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 1F63C83C30; Wed, 9 Jun 2021 09:52:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id F03FBC000E; Wed, 9 Jun 2021 09:52:27 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id CFA55C000B for ; Wed, 9 Jun 2021 09:52:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BE83A40388 for ; Wed, 9 Jun 2021 09:52:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dIb8m9AwWpsv for ; Wed, 9 Jun 2021 09:52:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by smtp2.osuosl.org (Postfix) with ESMTPS id BAB594034B for ; Wed, 9 Jun 2021 09:52:25 +0000 (UTC) Received: by mail-ed1-x536.google.com with SMTP id b11so28007560edy.4 for ; Wed, 09 Jun 2021 02:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=u7m0qOoLqwHrGlvy2+g/DKnqAv17WVfuSqGrS2e72jI=; b=YgGWUYpcw9tGHL8mqYphfuer1bEoX+W+HrOsjD1ogL5z4byOZBSNwPVMM4lUSLuiSu s2NRq6GjGl3jSno+ISswtmyRakbh3A3NBEXidBNg5YrW/cXAUl3aAlf5T3ClWFZ8K8+J Y7XquWBKETsijUOc2Oi5FqcdUm80fYmx5Upt8cHATA8/AqM4ix+cGioNHo1qoSpzlz54 YlE2rlysRi8OfW2tvA+0+BFfw8UxfoI4jR/RMrXYWhiR9p2TnUV1ZJhoqmlvzTe0sF+z +Smj1hTvVglNktU/In2efXgXlyOFml7TmU22+Hp8jDpLJH9eUOSW7AnXZ0bxuwz1aDIK M8ww== 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:mime-version :content-transfer-encoding; bh=u7m0qOoLqwHrGlvy2+g/DKnqAv17WVfuSqGrS2e72jI=; b=gZ6TmfVUbiRztyPuQGZ5c6ByUtM0p9Ezn0xz/8454vzyw5rxziA7lzAafLMJl+uTa1 /SDxyY2oRmH1Af03qucRlkvU2+xLYWGJzBlXD3RvdIMS5KTNhZx15sWPKAgocQc2TLnj mkvtGaE+kznAxJUKdTDgw65b50cgfaggqM+JzolwMr720zQBtv6faiNk6uEbeqp3slpM loHKOwaOFRAD+EsTsadmy9zFmjbRCeQp08LOix7GTnZ21DWK6+9cLs3OjRgQPgbKFbaI +Fl27oRMS+y09LBy9APUYJDqi5CZsVeChG49HXYNsDKqkiSYjuH01L0Bawj/lzNlXh4G gFeA== X-Gm-Message-State: AOAM532W94CuhGWozfaKPRlJAfWyiXH/i5kODWpqkvPofc8ob9/dnUBw cJxkpyXXUqAKY0OjtRipKvqbiChXhXH+Y7FSXjYU9XfaiJmiu9oO/3T4twjVC7HDhGby2UgdAp0 fTIBsmu3JONG5P6IPUcurbpNDW6NxKUJiZgZzCT37HWxAXwzlfMD34RBUa7v7UEQESKnmnvXion EJ X-Google-Smtp-Source: ABdhPJzwMllEZLErWf4igtcUbSynHINpUxMEV8dyJexe+lHRvfapEGZy4nu9PKViaZzn64EvNa3CtQ== X-Received: by 2002:aa7:c0d3:: with SMTP id j19mr30102326edp.196.1623232343386; Wed, 09 Jun 2021 02:52:23 -0700 (PDT) Received: from momiji.horms.nl ([2001:982:756:703:d63d:7eff:fe99:ac9d]) by smtp.gmail.com with ESMTPSA id nc26sm840636ejc.106.2021.06.09.02.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 02:52:22 -0700 (PDT) From: Simon Horman To: dev@openvswitch.org Date: Wed, 9 Jun 2021 11:52:07 +0200 Message-Id: <20210609095209.6205-1-simon.horman@netronome.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Baowen Zheng , Yong Xu , oss-drivers@netronome.com, Simon Horman , Tianyu Yuan , Marcelo Ricardo Leitner Subject: [ovs-dev] [PATCH v3 0/2] add port-based ingress policing based packet-per-second rate-limiting 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Hi, this short test adds support for add port-based ingress policing based packet-per-second rate-limiting. This builds on existing support for byte-per-second rate limiting. Changes since v2 * Remove the for loop in function nl_msg_put_act_police() * Remove unused enum definition for qos type * Define 1 kpkts as 1000 packets rather than 1024 packets * Update the description for the new item in ovsdb * Fix some format warnings according robot's comments Changes between v1 and v2 * Correct typo: s/comsume/consume/ Tianyu Yuan (1): add test cases for ingress_policing_kpkts parameters Yong Xu (1): add port-based ingress policing based packet-per-second rate-limiting acinclude.m4 | 6 +- include/linux/pkt_cls.h | 6 +- lib/netdev-dpdk.c | 4 +- lib/netdev-linux-private.h | 4 +- lib/netdev-linux.c | 109 ++++++++++++++++++++++--------- lib/netdev-provider.h | 11 ++-- lib/netdev.c | 15 +++-- lib/netdev.h | 3 +- tests/atlocal.in | 17 ++++- tests/ovs-vsctl.at | 23 +++++++ tests/system-offloads-traffic.at | 50 ++++++++++++++ vswitchd/bridge.c | 6 +- vswitchd/vswitch.ovsschema | 10 ++- vswitchd/vswitch.xml | 59 ++++++++++++++++- 14 files changed, 266 insertions(+), 57 deletions(-)