diff mbox

[v2,net-next,1/7] net: Export inet_offloads and inet6_offloads

Message ID 1410750483-3236-2-git-send-email-therbert@google.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Tom Herbert Sept. 15, 2014, 3:07 a.m. UTC
Want to be able to call this in foo-over-udp offloads, etc.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 net/ipv4/protocol.c | 1 +
 net/ipv6/protocol.c | 1 +
 2 files changed, 2 insertions(+)

Comments

Or Gerlitz Sept. 15, 2014, 1:33 p.m. UTC | #1
On Mon, Sep 15, 2014 at 6:07 AM, Tom Herbert <therbert@google.com> wrote:
> Want to be able to call this in foo-over-udp offloads, etc.

In the L2 gro case, we did dedicated helpers
gro_find_receive/complete_by_type, not sure what was
the exact rational there but worth checking, jerry?


>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
>  net/ipv4/protocol.c | 1 +
>  net/ipv6/protocol.c | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
> index 46d6a1c..4b7c0ec 100644
> --- a/net/ipv4/protocol.c
> +++ b/net/ipv4/protocol.c
> @@ -30,6 +30,7 @@
>
>  const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS] __read_mostly;
>  const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS] __read_mostly;
> +EXPORT_SYMBOL(inet_offloads);
>
>  int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol)
>  {
> diff --git a/net/ipv6/protocol.c b/net/ipv6/protocol.c
> index e048cf1..e3770ab 100644
> --- a/net/ipv6/protocol.c
> +++ b/net/ipv6/protocol.c
> @@ -51,6 +51,7 @@ EXPORT_SYMBOL(inet6_del_protocol);
>  #endif
>
>  const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS] __read_mostly;
> +EXPORT_SYMBOL(inet6_offloads);
>
>  int inet6_add_offload(const struct net_offload *prot, unsigned char protocol)
>  {
> --
> 2.1.0.rc2.206.gedb03e5
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tom Herbert Sept. 15, 2014, 3:13 p.m. UTC | #2
On Mon, Sep 15, 2014 at 6:33 AM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> On Mon, Sep 15, 2014 at 6:07 AM, Tom Herbert <therbert@google.com> wrote:
>> Want to be able to call this in foo-over-udp offloads, etc.
>
> In the L2 gro case, we did dedicated helpers
> gro_find_receive/complete_by_type, not sure what was
> the exact rational there but worth checking, jerry?
>
It allows offload_base to be kept a static, but then
gro_find_receive_by_type can't be inlined.

>
>>
>> Signed-off-by: Tom Herbert <therbert@google.com>
>> ---
>>  net/ipv4/protocol.c | 1 +
>>  net/ipv6/protocol.c | 1 +
>>  2 files changed, 2 insertions(+)
>>
>> diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
>> index 46d6a1c..4b7c0ec 100644
>> --- a/net/ipv4/protocol.c
>> +++ b/net/ipv4/protocol.c
>> @@ -30,6 +30,7 @@
>>
>>  const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS] __read_mostly;
>>  const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS] __read_mostly;
>> +EXPORT_SYMBOL(inet_offloads);
>>
>>  int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol)
>>  {
>> diff --git a/net/ipv6/protocol.c b/net/ipv6/protocol.c
>> index e048cf1..e3770ab 100644
>> --- a/net/ipv6/protocol.c
>> +++ b/net/ipv6/protocol.c
>> @@ -51,6 +51,7 @@ EXPORT_SYMBOL(inet6_del_protocol);
>>  #endif
>>
>>  const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS] __read_mostly;
>> +EXPORT_SYMBOL(inet6_offloads);
>>
>>  int inet6_add_offload(const struct net_offload *prot, unsigned char protocol)
>>  {
>> --
>> 2.1.0.rc2.206.gedb03e5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Or Gerlitz Sept. 15, 2014, 5:15 p.m. UTC | #3
On Mon, Sep 15, 2014 at 6:13 PM, Tom Herbert <therbert@google.com> wrote:
> On Mon, Sep 15, 2014 at 6:33 AM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
>> On Mon, Sep 15, 2014 at 6:07 AM, Tom Herbert <therbert@google.com> wrote:
>>> Want to be able to call this in foo-over-udp offloads, etc.
>>
>> In the L2 gro case, we did dedicated helpers
>> gro_find_receive/complete_by_type, not sure what was
>> the exact rational there but worth checking, jerry?
>>
> It allows offload_base to be kept a static, but then
> gro_find_receive_by_type can't be inlined.


so we have two similar locations in the networking stack acting
differently on the same/similar simple
matter... a bit problematic maintainance wise, I would say.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tom Herbert Sept. 15, 2014, 5:32 p.m. UTC | #4
On Mon, Sep 15, 2014 at 10:15 AM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> On Mon, Sep 15, 2014 at 6:13 PM, Tom Herbert <therbert@google.com> wrote:
>> On Mon, Sep 15, 2014 at 6:33 AM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
>>> On Mon, Sep 15, 2014 at 6:07 AM, Tom Herbert <therbert@google.com> wrote:
>>>> Want to be able to call this in foo-over-udp offloads, etc.
>>>
>>> In the L2 gro case, we did dedicated helpers
>>> gro_find_receive/complete_by_type, not sure what was
>>> the exact rational there but worth checking, jerry?
>>>
>> It allows offload_base to be kept a static, but then
>> gro_find_receive_by_type can't be inlined.
>
>
> so we have two similar locations in the networking stack acting
> differently on the same/similar simple
> matter... a bit problematic maintainance wise, I would say.

Yes, these should be similar. I think we'd need to cleanup
gro_find_receive_by_type first: export udp_offload base and inline
these functions. Have skb_mac_gso_segment call this also.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 15, 2014, 6:21 p.m. UTC | #5
From: Tom Herbert <therbert@google.com>
Date: Sun, 14 Sep 2014 20:07:57 -0700

> Want to be able to call this in foo-over-udp offloads, etc.
> 
> Signed-off-by: Tom Herbert <therbert@google.com>

I don't think inet{,6}_offloads are symbols you can "call" :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
index 46d6a1c..4b7c0ec 100644
--- a/net/ipv4/protocol.c
+++ b/net/ipv4/protocol.c
@@ -30,6 +30,7 @@ 
 
 const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS] __read_mostly;
 const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS] __read_mostly;
+EXPORT_SYMBOL(inet_offloads);
 
 int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol)
 {
diff --git a/net/ipv6/protocol.c b/net/ipv6/protocol.c
index e048cf1..e3770ab 100644
--- a/net/ipv6/protocol.c
+++ b/net/ipv6/protocol.c
@@ -51,6 +51,7 @@  EXPORT_SYMBOL(inet6_del_protocol);
 #endif
 
 const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS] __read_mostly;
+EXPORT_SYMBOL(inet6_offloads);
 
 int inet6_add_offload(const struct net_offload *prot, unsigned char protocol)
 {