netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: jamal <hadi@cyberus.ca>, netdev@oss.sgi.com
Subject: Re: [RFC] meta ematch
Date: Thu, 13 Jan 2005 19:54:29 +0100	[thread overview]
Message-ID: <41E6C3E5.2020908@trash.net> (raw)
In-Reply-To: <20050113174111.GP26856@postel.suug.ch>

Thomas Graf wrote:

>Found some cycles today and wrote the meta ematch. It tried to
>find a good compromise between speed and power.
>
>So far I added the following matching possibilies:
> - random
> - load average (0,1,2)
> - dev (numeric and string)
> - indev (numeric and string)
> - realdev (numeric and string)
> - skb priority
> - ... protocol
> - ... security
> - ... pkttype (to easly match on multicast/broadcast)
> - ... pktlen
> - ... datalen
> - ... maclen
> - netfilter mark
> - ... cache
> - ... conntrack info
> - ... debug variable
> - tc index
> - ... verdict
> - ... classid
> - routing classid
> - .... iif
>
>Yet to come are more routing and socket attributes such as queue
>sizes, backlog sizes, neighbour attribute of the route found, ...
>
>It is also possible to compare two kernel meta values, e.g
>realdev equals dev.
>
>Numeric matches may be modified via shift and mask operators
>to for example only consider a part of nfmark.
>
>Binary matches may have a shift modifier to only consider
>a certain amount of the data, e.g. "eth1" with shift 1 would
>end up with "eth". I added this because I wanted something
>like eth% but didn't want to implement expensive string
>operations.
>  
>
Looks great. I have a few doubts about about the set of chosen values
though. Things like nf_debug and nf_cache were never meant to be
userspace-visible. What about backwards compatibility if we want to
remove it, or some other more meaningful value where just returning 0
wouldn't be the same ?

A couple of minor things:

- var_dev sets dst->value to dev->name, meta_var_destroy will try to
  free dev->name.

- meta_int_change only uses 32 bit, but dst->value is unsigned long
  (64 bit on 64-bit arches). nfmark for example is unsigned long, so
  you should also use *(unsigned long *).

- for the same reason meta_int_compare should return long not int

>If its not obvious, random and loadavg are intended for
>load balancing purposes, i.e.
>  
>
I have my doubts about the usefullness of load balancing traffic based
on CPU load, but I guess it doesn't hurt.

Regards
Patrick

  reply	other threads:[~2005-01-13 18:54 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-03 12:56 [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Thomas Graf
2005-01-04  4:13 ` jamal
2005-01-04 12:03   ` Thomas Graf
2005-01-04 13:19     ` jamal
2005-01-04 13:46       ` Thomas Graf
2005-01-04 12:27   ` Thomas Graf
2005-01-04 13:22     ` jamal
2005-01-04 13:41       ` Thomas Graf
2005-01-05  2:54         ` jamal
2005-01-05 11:09           ` Thomas Graf
2005-01-04 22:36 ` Thomas Graf
2005-01-05  3:12   ` jamal
2005-01-05 11:00     ` Thomas Graf
2005-01-05 13:33       ` jamal
2005-01-05 14:45         ` Thomas Graf
2005-01-05 16:48           ` Thomas Graf
2005-01-06 14:03             ` jamal
2005-01-06 13:47           ` jamal
2005-01-06 19:41             ` Thomas Graf
2005-01-07 13:45               ` jamal
2005-01-08 14:54                 ` Thomas Graf
2005-01-10 13:26                   ` jamal
2005-01-10 21:17                     ` Thomas Graf
2005-01-10 22:05                       ` jamal
2005-01-10 23:30                         ` Thomas Graf
2005-01-13 17:41                         ` [RFC] meta ematch Thomas Graf
2005-01-13 18:54                           ` Patrick McHardy [this message]
2005-01-13 19:20                             ` Thomas Graf
2005-01-14  1:13                               ` Patrick McHardy
2005-01-14 15:14                                 ` Thomas Graf
2005-01-16 14:58                                   ` jamal
2005-01-16 15:09                                     ` Thomas Graf
2005-01-16 15:37                                       ` jamal
2005-01-16 15:57                                         ` Thomas Graf
2005-01-16 16:19                                           ` jamal
2005-01-16 16:49                                             ` Thomas Graf
2005-01-16 16:11                                   ` jamal
2005-01-16 16:32                                     ` Thomas Graf
2005-01-16 17:18                                       ` jamal
2005-01-16 18:47                                         ` Thomas Graf
2005-01-16 16:32                                     ` Patrick McHardy
2005-01-16 17:24                                       ` jamal
2005-01-05 13:32 ` [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Florian Weimer
2005-01-05 13:45   ` jamal

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=41E6C3E5.2020908@trash.net \
    --to=kaber@trash.net \
    --cc=hadi@cyberus.ca \
    --cc=netdev@oss.sgi.com \
    --cc=tgraf@suug.ch \
    /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).