From: Nikolay Aleksandrov <nikolay@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, andy@greyhouse.net, fubar@us.ibm.com,
eric.dumazet@gmail.com, vfalico@redhat.com
Subject: Re: [PATCH net-next v2 1/3] flow_dissector: factor out the ports extraction in skb_flow_get_ports
Date: Thu, 26 Sep 2013 01:50:22 +0200 [thread overview]
Message-ID: <524376BE.5010506@redhat.com> (raw)
In-Reply-To: <52437454.6020407@redhat.com>
On 09/26/2013 01:40 AM, Nikolay Aleksandrov wrote:
> On 09/25/2013 08:31 PM, Nikolay Aleksandrov wrote:
>> Factor out the code that extracts the ports from skb_flow_dissect and
>> add a new function skb_flow_get_ports which can be re-used.
>>
>> Suggested-by: Veaceslav Falico <vfalico@redhat.com>
>> Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
>> ---
>> v2: new patch
>> This seems like a good idea because there're other users that can re-use
>> it later as well.
>>
>> include/net/flow_keys.h | 1 +
>> net/core/flow_dissector.c | 38 +++++++++++++++++++++++++++-----------
>> 2 files changed, 28 insertions(+), 11 deletions(-)
>>
>> diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h
>> index ac2439d..621bf11 100644
>> --- a/include/net/flow_keys.h
>> +++ b/include/net/flow_keys.h
>> @@ -14,4 +14,5 @@ struct flow_keys {
>> };
>>
>> bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow);
>> +__be32 skb_flow_get_ports(const struct sk_buff *skb, int nhoff, u8 ip_proto);
>> #endif
>> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
>> index 1929af8..c609faf 100644
>> --- a/net/core/flow_dissector.c
>> +++ b/net/core/flow_dissector.c
>> @@ -25,9 +25,34 @@ static void iph_to_flow_copy_addrs(struct flow_keys *flow, const struct iphdr *i
>> memcpy(&flow->src, &iph->saddr, sizeof(flow->src) + sizeof(flow->dst));
>> }
>>
>> +/**
>> + * skb_flow_get_ports - extract the upper layer ports and return them
>> + * @skb: buffer to extract the ports from
>> + * @nhoff: network header offset
> I hurried too much, this should've said "offset to the end of the network
> header" i.e. nhoff + sizeof(network header), I'll wait until tomorrow to
> see if there aren't any other comments and will edit this and re-post a v3.
>
> Nik
>
Ugh, nevermind this email, I'm going crazy about semantics today :-)
Everything is fine.
next prev parent reply other threads:[~2013-09-25 23:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-25 18:31 [PATCH net-next v2 0/3] bonding: modify the current and add new hash functions Nikolay Aleksandrov
2013-09-25 18:31 ` [PATCH net-next v2 1/3] flow_dissector: factor out the ports extraction in skb_flow_get_ports Nikolay Aleksandrov
2013-09-25 23:40 ` Nikolay Aleksandrov
2013-09-25 23:50 ` Nikolay Aleksandrov [this message]
2013-09-25 18:31 ` [PATCH net-next v2 2/3] bonding: modify the old and add new xmit hash policies Nikolay Aleksandrov
2013-09-25 18:31 ` [PATCH net-next v2 3/3] bonding: document the new xmit policy modes and update the changed ones Nikolay Aleksandrov
2013-09-25 23:56 ` [PATCH net-next v2 0/3] bonding: modify the current and add new hash functions Nikolay Aleksandrov
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=524376BE.5010506@redhat.com \
--to=nikolay@redhat.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=vfalico@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.