netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@infradead.org>
To: Andrei Popa <ierdnah@gmail.com>
Cc: pdoru.kernel@evox.ro, netdev@vger.kernel.org
Subject: Re: tc match MAC destination
Date: Wed, 15 Jun 2011 09:23:06 -0400	[thread overview]
Message-ID: <20110615132306.GA919@canuck.infradead.org> (raw)
In-Reply-To: <1308125523.30324.64.camel@ierdnac-hp>

On Wed, Jun 15, 2011 at 11:12:01AM +0300, Andrei Popa wrote:
> I want to shape PVSTP+ traffic (traffic that has MAC destination
> 01:00:0c:cc:cc:cd) and it doesn't work.
> I've tried
> filter parent 1: protocol 802_3 pref 2 u32 fh 802::11 order 17 key ht
> 802 bkt 0 flowid 1:3 
>   match 01000ccc/ffffffff at 0
> but it doesn't work.

u32 offset 0 corresponds to the network layer and thus will
match the first byte of the ip layer or whatever protocol
is found on that layer.

You can use the cmp ematch to match on the mac layer:

Use something like this:
filter add basic match 'cmp(0x01000ccc at 0 layer link mask 0xffffffff)'

... cmp(>>help<<)...
Usage: cmp(ALIGN at OFFSET [ ATTRS ] { eq | lt | gt } VALUE)
where: ALIGN  := { u8 | u16 | u32 }
       ATTRS  := [ layer LAYER ] [ mask MASK ] [ trans ]
       LAYER  := { link | network | transport | 0..2 }

Example: cmp(u16 at 3 layer 2 mask 0xff00 gt 20


  parent reply	other threads:[~2011-06-15 13:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15  8:12 tc match MAC destination Andrei Popa
2011-06-15  9:43 ` Eric Dumazet
2011-06-15 13:23 ` Thomas Graf [this message]
2011-06-15 13:29 ` Stephen Hemminger
2011-06-16  7:56   ` tc match MAC destination - nothing matches on protocol 802_3 Doru Theodor Petrescu
2011-06-16 15:51     ` Stephen Hemminger
2011-06-16 20:21       ` Doru Petrescu
2011-06-15 14:51 ` tc match MAC destination jamal
  -- strict thread matches above, loose matches on Subject: below --
2011-06-10 14:18 Andrei Popa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110615132306.GA919@canuck.infradead.org \
    --to=tgraf@infradead.org \
    --cc=ierdnah@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pdoru.kernel@evox.ro \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).