From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [iproute2 PATCH v2] tc: flower: Classify packets based port ranges Date: Fri, 9 Nov 2018 08:11:19 -0800 Message-ID: <20181109081119.0cb12505@xeon-e3> References: <154162577012.57835.17845635441983538034.stgit@anamhost.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, jakub.kicinski@netronome.com, sridhar.samudrala@intel.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us To: Amritha Nambiar Return-path: Received: from mail-pg1-f195.google.com ([209.85.215.195]:43415 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727784AbeKJBwf (ORCPT ); Fri, 9 Nov 2018 20:52:35 -0500 Received: by mail-pg1-f195.google.com with SMTP id n10-v6so1025220pgv.10 for ; Fri, 09 Nov 2018 08:11:22 -0800 (PST) In-Reply-To: <154162577012.57835.17845635441983538034.stgit@anamhost.jf.intel.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 07 Nov 2018 13:22:50 -0800 Amritha Nambiar wrote: > Added support for filtering based on port ranges. > > Example: > 1. Match on a port range: > ------------------------- > $ tc filter add dev enp4s0 protocol ip parent ffff:\ > prio 1 flower ip_proto tcp dst_port range 20-30 skip_hw\ > action drop > > $ tc -s filter show dev enp4s0 parent ffff: > filter protocol ip pref 1 flower chain 0 > filter protocol ip pref 1 flower chain 0 handle 0x1 > eth_type ipv4 > ip_proto tcp > dst_port range 20-30 > skip_hw > not_in_hw > action order 1: gact action drop > random type none pass val 0 > index 1 ref 1 bind 1 installed 85 sec used 3 sec > Action statistics: > Sent 460 bytes 10 pkt (dropped 10, overlimits 0 requeues 0) > backlog 0b 0p requeues 0 > > 2. Match on IP address and port range: > -------------------------------------- > $ tc filter add dev enp4s0 protocol ip parent ffff:\ > prio 1 flower dst_ip 192.168.1.1 ip_proto tcp dst_port range 100-200\ > skip_hw action drop > > $ tc -s filter show dev enp4s0 parent ffff: > filter protocol ip pref 1 flower chain 0 handle 0x2 > eth_type ipv4 > ip_proto tcp > dst_ip 192.168.1.1 > dst_port range 100-200 > skip_hw > not_in_hw > action order 1: gact action drop > random type none pass val 0 > index 2 ref 1 bind 1 installed 58 sec used 2 sec > Action statistics: > Sent 920 bytes 20 pkt (dropped 20, overlimits 0 requeues 0) > backlog 0b 0p requeues 0 > > v2: > Addressed Jiri's comment to sync output format with input > > Signed-off-by: Amritha Nambiar Please resubmit to iproute2-next after the UAPI changes have been accepted into kernel (net-next).