Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1036922ybz; Wed, 22 Apr 2020 12:20:49 -0700 (PDT) X-Google-Smtp-Source: APiQypLi/oo+CNLLH5rVrhECSCOYUHNV2YZ5xowH54uZpiQnKY+l3YJVrwNBjWhssS++5JqeY2Ov X-Received: by 2002:a05:6402:204b:: with SMTP id bc11mr140417edb.114.1587583249105; Wed, 22 Apr 2020 12:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587583249; cv=none; d=google.com; s=arc-20160816; b=wp//wWTi6jtJLG36CrMhTBg0UALiGIn/zjKW9q1DDcl62EYTf80TUSTqCK94RP5SWS CnG02FcvOmA/p37Sjs3zeiCbbfIjPjEfxAcI02LrNwcaMR32qDPriv5MFifNAx8EzAPP q7zshiy4cONktRztwsmQIKYxwV7sPpcUrxiw9FPbhm0+ND4NzVml2wCpQWgs1DC3FWOB YAgSBexxrHw0g3+4tRL5KV4AvlWnA7ssk7b2qrymSqtKVdAz2eUEBUvRWweHaw5WzsBk y+4SjOWAbymKSoZul8/cVa9t+RmKPcfOk83H/+1ZSQm2fJj16aXiJiaFppm033lRvFVh HDTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:dkim-signature; bh=sGm0URg00hVpVJgXgVW2GbRAgsVL8Ooj2fAahLp7p7o=; b=GTokeQp8c1sq32/B7+qIRwUCUfgRySZf278SOeAksbdPT7/QPq2X5EncrgMpF96+j8 4xg2gr6H25w2g82IKjHNlH5RtydR8DN/RU1w/uAs43gEH3ToaoEZS0xALxihbZkwpG0u 3E/HELKL1o+mXikdnWBj9CE56I/3feN4/YwBaHijul3rlJIFoEh4Bvxd2QP0dcQKOx+j Y/Ji0H/cr8JapqK3YYMG/G74kJTsoWl0ADSV/g5q1n6+jz/lpEMlFQiEASFZ69Hyuvzc 2clPEmmagjsoPuAFv02eapQnmrd/SvFvhpO4xkGUeGjvmc9jsrEr8HdKzHmtXPHW6m2I WG6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=xawdOcom; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si75056ejr.170.2020.04.22.12.20.25; Wed, 22 Apr 2020 12:20:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=xawdOcom; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726158AbgDVTTO (ORCPT + 99 others); Wed, 22 Apr 2020 15:19:14 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:43502 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbgDVTTN (ORCPT ); Wed, 22 Apr 2020 15:19:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1587583152; x=1619119152; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=wUFdB6s2DW2Sp8KobX3ZW4FX95vp1dXONK3ZKJv9l1E=; b=xawdOcom03yL6DIoD8FbRc7Zj453bsveSbIkEkY7Qc62LnLUrzI3kLj/ smalJPK5T1Rhp4b3PbLqZwo+exvjCbwK2I5m8aLyhjGyeL6M/z9rlVVnS xi0CDMKXxex1DyA7zB/TIC03O03B2TVjVBPLQRna0jSVaY3rPPutIX3Si vgSvw0+rfZDgD7DDtyVLbpdNfAoEqeB+1TdmaoUu+hW6tzBH6uqI8BiG4 J1C4fvTsf3I+FpqPCS3VDcAn9m3yWszrHjTOmPrwJEnWvubDOHijgLJ3/ 4EDQJtctK1IiLiKJX1lsrwwpDYeNEkhYib/uivFIqhh1alnLURrGBe3/g w==; IronPort-SDR: z7PGyBtN0m1w1Trdy4Iw9ZiOw5G/9AfMrzqGDuCKyo30O3sHaFmWHt6wZihosFBZZc9ys4JzLK 63unZUpamyXo2J2hj7xRVOhCklNspn7Pc4cJuSBBsOZ/ynrr68lvLlbg8ls9rJYKjm5Ch4mQ6q FW6MSKz5lMUAEly08vcC6s79eefmcUh9WN2zhCW4Di5lwdp/SLbA6DxHCWdGR6TlIPNjAaF6gK KGkuzkZqRHBFQpLeEQW/zuSpw8VDkWTUwhzhvUp9NmGJS/gD0mJvVKUdJXs1jISgletzUsV70A HHU= X-IronPort-AV: E=Sophos;i="5.73,304,1583218800"; d="scan'208";a="71228360" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Apr 2020 12:19:11 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 22 Apr 2020 12:18:38 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 22 Apr 2020 12:18:38 -0700 Date: Wed, 22 Apr 2020 21:19:10 +0200 From: "Allan W. Nielsen" To: Po Liu CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [v3,net-next 1/4] net: qos: introduce a gate control flow action Message-ID: <20200422191910.gacjlviegrjriwcx@ws.localdomain> References: <20200418011211.31725-5-Po.Liu@nxp.com> <20200422024852.23224-1-Po.Liu@nxp.com> <20200422024852.23224-2-Po.Liu@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Disposition: inline In-Reply-To: <20200422024852.23224-2-Po.Liu@nxp.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Po, Nice to see even more work on the TSN standards in the upstream kernel. On 22.04.2020 10:48, Po Liu wrote: >EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > >Introduce a ingress frame gate control flow action. >Tc gate action does the work like this: >Assume there is a gate allow specified ingress frames can be passed at >specific time slot, and be dropped at specific time slot. Tc filter >chooses the ingress frames, and tc gate action would specify what slot >does these frames can be passed to device and what time slot would be >dropped. >Tc gate action would provide an entry list to tell how much time gate >keep open and how much time gate keep state close. Gate action also >assign a start time to tell when the entry list start. Then driver would >repeat the gate entry list cyclically. >For the software simulation, gate action requires the user assign a time >clock type. > >Below is the setting example in user space. Tc filter a stream source ip >address is 192.168.0.20 and gate action own two time slots. One is last >200ms gate open let frame pass another is last 100ms gate close let >frames dropped. When the frames have passed total frames over 8000000 >bytes, frames will be dropped in one 200000000ns time slot. > >> tc qdisc add dev eth0 ingress > >> tc filter add dev eth0 parent ffff: protocol ip \ > flower src_ip 192.168.0.20 \ > action gate index 2 clockid CLOCK_TAI \ > sched-entry open 200000000 -1 8000000 \ > sched-entry close 100000000 -1 -1 First of all, it is a long time since I read the 802.1Qci and when I did it, it was a draft. So please let me know if I'm completly off here. I know you are focusing on the gate control in this patch serie, but I assume that you later will want to do the policing and flow-meter as well. And it could make sense to consider how all of this work toghether. A common use-case for the policing is to have multiple rules pointing at the same policing instance. Maybe you want the sum of the traffic on 2 ports to be limited to 100mbit. If you specify such action on the individual rule (like done with the gate), then you can not have two rules pointing at the same policer instance. Long storry short, have you considered if it would be better to do something like: tc filter add dev eth0 parent ffff: protocol ip \ flower src_ip 192.168.0.20 \ action psfp-id 42 And then have some other function to configure the properties of psfp-id 42? /Allan