From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamal Hadi Salim Subject: Re: [PATCH v2 net-next 1/1] net sched actions: mirred add support for setting Dst MAC address Date: Wed, 6 Jul 2016 06:02:51 -0400 Message-ID: <577CD74B.5070805@mojatatu.com> References: <1467470065-17613-1-git-send-email-jhs@emojatatu.com> <20160704.151435.624086916441807197.davem@davemloft.net> <577B942A.2020602@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: David Miller , Linux Kernel Network Developers , Daniel Borkmann , nikolay@cumulusnetworks.com To: Cong Wang Return-path: Received: from mail-io0-f195.google.com ([209.85.223.195]:36016 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751103AbcGFKC7 (ORCPT ); Wed, 6 Jul 2016 06:02:59 -0400 Received: by mail-io0-f195.google.com with SMTP id s63so23274803ioi.3 for ; Wed, 06 Jul 2016 03:02:59 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On 16-07-05 02:19 PM, Cong Wang wrote: > On Tue, Jul 5, 2016 at 4:04 AM, Jamal Hadi Salim wrote: >> Second arguement usability, from: >> to: >> $TC filter add dev $ETH parent 1: protocol ip prio 10 \ >> u32 match ip protocol 1 0xff flowid 1:2 \ >> action mirred egress redirect dev $SPANPORT dst 02:15:15:15:15:15 >> >> given that I have to do this many many times in scripts and the >> second policy is better eye candy. > > How about adding a "wrapper" in iproute2 pedit action to make > it accept "dst mac xx:xx:xx:xx:xx:xx"? Like what we did for u32 > filters. > Thats what we do today. Its fugly and debugging is nasty (having to stare at 10s or hundreds of outputs looking at offset and bytes when something goes wrong). It is ok to use pedit as a starting point because you can quickly craft things without any kernel changes. But when you start heavily using something handcrafted its usability starts affecting you. I will work on and send the skbmod patch next time i get cycles. cheers, jamal