From: sandr8 <sandr8_NOSPAM_@crocetta.org>
To: hadi@cyberus.ca
Cc: Harald Welte <laforge@netfilter.org>,
devik@cdi.cz, netdev@oss.sgi.com,
netfilter-devel@lists.netfilter.org
Subject: Re: Billing 3: WAS(Re: [PATCH 2/4] deferred drop, __parent workaround, reshape_fail , netdev@oss.sgi.com ,
Date: Mon, 23 Aug 2004 14:27:14 +0200 [thread overview]
Message-ID: <4129E2A2.2050500@crocetta.org> (raw)
In-Reply-To: <1093262296.1040.778.camel@jzny.localdomain>
jamal wrote:
>Let me layout a few things:
>
> ..-->classification --> tcaction
>return code1 --> enqueue
>return code2 ...(packet may be freed here)--> dev.c
>
>The rules are:
>1) A qdisc receiving a STOLEN/QUEUED/SHOT signal from the classification
>result (return code 1) MUST free the packet and immediately stop
>processing that packet.
>The infrastructure code will clone packets if they want to steal or
>queue it. Infact the skbs flow may even change during this path (eg
>packet rewritten)
>Billing issues: In such a case multiple packets may be later reinjected
>(after replicating the one that was stolen) which totaly bypass
>contracking code. Multiple packets may make it out to the wire.
>You need to find a way to bill them ;-> (opposite of what you are trying
>to do).
>
>
i don't know the code that does that, since afaik it
was not yet there in 2.6.8... if it is, please tell me
because i'm eager to have a full viewpoint of the
forthcoming packet action framework :)
>2)Return code (return code 2) of qdisc from enqueue function need to be
>dealt with care if the packet is localy generated so it doesnt confuse
>TCP (SCTP and DCCP sound like two other protocols that could be added)
>
>Here we have two paths:
>i) policy dropped packets.
>Billing issues: You want to unbill dropped but not stolen packets.
>
>ii) packets that are dropped because of a full Q should continue to
>return a XMIT_DROP.
>Billing: MUST unbill.
>
>Again as above shows, billing would work better at the qdisc level.
>
>
yes, sure...
but for the moment i personally don't know which path
STOLEN and QUEUED packets will follow... it's not
a reproach :) it's just that i simply can't know for the
moment, but i don't want to make you hurry, i perfectly
understand that you've got plenty of things to do :)
>>[ i'm not insisting with that patch, i'm just trying to say that, if i don't
>>rave, it should not be dangerous to do that after the enqueue()...
>>then, it's just that for the moment i can't immagine a different
>>way to do things in that place :) yes, there could be a slight
>>variation with a skb_get() right before the enqueue and all the
>>kfree_skb() at their place inside the code, but then somewhere
>>we should always add a kfree_skb... ouch... and we would need
>>a by ref skb anyway to get the packet that has been dropped
>>and if it's not the same as the enqueued one also the enqueued
>>one should pass through one more kfree_skb()... horrible, more
>>complex and slower i'd say... ]
>>
>>
>
>Linux is being efficient by sharing skbs. One of the most expensive
>things in a stack is copying packets around (which is avoided).
>If this was a simple system where allocating and freeing can be mapped
>to exactly a flow then what you suggest can be done. In Linux you cant.
>
>
>
in that patch i was not copying them... just passing them by reference
through a
"struct sk_buff ** const skb" parameter.
what is the difference from before...?
calling:
before) when calling we passed a pointer on the stack.
now) when calling we pass a pointer on the stack
returning:
before) when returning we didn't tell the caller which
packet was dropped
now) when returning we tell the sender which packet
is not queued or is thrown away from our queue to
make place for the packet enqueued.
what happens on the stack now?
for the calling: more or less the same as before :)
for the returning...
1) the external pointer is const, cannot be changed. this
is good to avoid stupid bugs.
2) being the external pointer const, the internal one always
lays in the stack frame of the outmost caller of an enqueue
operation. hust the external one is passed to callees. when
a requeue operation is called, that pointer nevertheless stays
in the stack frame of the outmost caller of an enqueue
operation. that's to say: it never moves from the stack of the
caller of dev->qdisc->enqueue()... [in that case it was dev.c,
but maybe it would be nicer to have it in a sort of
dev->enqueue() that would have to do with device level
conntracking].
additional cost for the function calling? z-e-r-o !!! :)
performance issues? maybe some improvement due
to the elimination of many internal jumps and conditions.
furthermore, telling the caller the packet that we chose to
drop allows it to reshape it without the need for every
qdisc to recur too any callback function.
>>>That is the challenge at the moment.
>>>For starters i dont see it as an issue right now to do locking.
>>>Its a cost for the feature since Haralds patch is in.
>>>
>>>In the future we should make accounting a feature that could be turned
>>>on despite contracking and skbs should carry an accounting metadata with
>>>them.
>>>
>>>
>>>
>>>
>>i need to think thoroughly on it... depending on where that information is
>>kept, the complexity of some operations can change a lot... and i should
>>not only egoistically think to the operations i need but look at it from the
>>outside to have a less partisan viewpoint on the problem and find the
>>most generally good solution possible.
>>
>>
>
>I am begining to think that all contrack should do is mark the packets
>then let the qdisc take care of things.
>
>Cutting email here, since another topic below and this email is too
>long.
>
>cheers,
>jamal
>
>
ciao :)
next prev parent reply other threads:[~2004-08-23 12:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-13 0:48 [PATCH 2/4] deferred drop, __parent workaround, reshape_fail sandr8
2004-08-13 12:51 ` jamal
2004-08-13 14:09 ` sandr8
2004-08-14 21:21 ` jamal
2004-08-16 7:35 ` Harald Welte
2004-08-16 13:29 ` jamal
2004-08-24 18:57 ` Harald Welte
2004-08-25 12:12 ` jamal
2004-08-16 7:20 ` Harald Welte
2004-08-16 13:00 ` jamal
2004-08-16 13:08 ` Harald Welte
2004-08-16 15:19 ` sandr8
2004-08-17 11:52 ` jamal
2004-08-17 13:40 ` [PATCH 2/4] deferred drop, __parent workaround, reshape_fail , netdev@oss.sgi.com , sandr8
2004-08-22 15:17 ` Billing 1: WAS (Re: " jamal
2004-08-23 9:33 ` sandr8
2004-08-24 18:38 ` Harald Welte
2004-08-22 15:38 ` Billing 2: WAS(Re: " jamal
2004-08-22 16:12 ` Billing 3: " jamal
2004-08-23 9:39 ` sandr8
2004-08-23 11:38 ` Billing 3-1: " jamal
2004-08-23 12:04 ` sandr8
2004-08-23 12:31 ` jamal
2004-08-23 11:58 ` Billing 3: " jamal
2004-08-23 12:27 ` sandr8 [this message]
2004-08-25 11:34 ` jamal
2004-08-23 12:15 ` Billing 3-3: " jamal
2004-08-24 18:46 ` Billing 3: " Harald Welte
2004-08-25 11:50 ` jamal
2004-08-17 13:49 ` [PATCH 2/4] deferred drop, __parent workaround, reshape_fail sandr8
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=4129E2A2.2050500@crocetta.org \
--to=sandr8_nospam_@crocetta.org \
--cc=devik@cdi.cz \
--cc=hadi@cyberus.ca \
--cc=laforge@netfilter.org \
--cc=netdev@oss.sgi.com \
--cc=netfilter-devel@lists.netfilter.org \
/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).