* Re: [PATCH 1/1 net-next] cipso: include linux/bug.h instead of asm/bug.h
From: David Miller @ 2014-11-04 20:10 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415128541-10891-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:15:41 +0100
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
This is already the case in the net-next tree, therefore this patch is
not applicable.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] cipso: remove NULL assignment on static
From: David Miller @ 2014-11-04 20:10 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415128759-11264-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:19:19 +0100
> Also add blank line after structure declarations
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] tcp: spelling s/plugable/pluggable
From: David Miller @ 2014-11-04 20:10 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415129138-11901-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:25:38 +0100
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] ipv4: use seq_puts instead of seq_printf where possible
From: David Miller @ 2014-11-04 20:11 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415129486-13185-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:31:26 +0100
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] ipv4: remove 0/NULL assignment on static
From: David Miller @ 2014-11-04 20:11 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415129866-13852-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:37:46 +0100
> static values are automatically initialized to 0
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] ipv4: ip_frag_queue function clean-up
From: David Miller @ 2014-11-04 20:12 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415130097-14490-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:41:37 +0100
> -remove unnecessary else after break
> -declare free_it sk_buff * only once (like prev and next)
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
I disagree.
Declaring a local variable in it's inner-most scope is preferable
to moving it to the top level and making the job of the compiler
and the code auditor more difficult.
I'm not applying this, sorry.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] inet: frags: remove inline on static in c file
From: David Miller @ 2014-11-04 20:12 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415130244-15003-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:44:04 +0100
> remove __inline__ / inline and let compiler decide what to do
> with static functions
>
> Inspired-by: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] udp: remove else after return
From: David Miller @ 2014-11-04 20:12 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415130521-16479-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:48:41 +0100
> else is unnecessary after return 0 in __udp4_lib_rcv()
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] igmp: remove camel case definitions
From: David Miller @ 2014-11-04 20:14 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1415130734-17124-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 20:52:14 +0100
> use standard uppercase for definitions
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH v2 5/5] stmmac: pci: remove FSF address
From: David Miller @ 2014-11-04 20:15 UTC (permalink / raw)
To: xose.vazquez; +Cc: netdev, andriy.shevchenko
In-Reply-To: <54593285.3030201@gmail.com>
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Tue, 04 Nov 2014 21:09:41 +0100
> David Miller wrote:
>
>> Andy Shevchenko wrote:
>>> The FSF address is subject to change, thus remove it from the file.
>>>
>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>
>> I cound 90t instances of this under drivers/net, therefore if this change is
> ^^^^^^^^^^^^^
>> appropriate I'd rather someone script this and kill it across entire
>> subdirectories.
>
> It's a bit more, 555:
I meant "nine hundred something", the 't' it my finger slipping down
one row on my keyboard :-)
^ permalink raw reply
* Re: [PATCH v2 net] tcp: zero retrans_stamp if all retrans were acked
From: Marcelo Ricardo Leitner @ 2014-11-04 20:51 UTC (permalink / raw)
To: Neal Cardwell; +Cc: Netdev, Yuchung Cheng, Eric Dumazet
In-Reply-To: <CADVnQymMioK0USNpaOF2Kb4+zMTDrjJ7r=5Bu51LbirVQPnzyw@mail.gmail.com>
On 04-11-2014 18:10, Neal Cardwell wrote:
> On Tue, Nov 4, 2014 at 2:15 PM, Marcelo Ricardo Leitner
> <mleitner@redhat.com> wrote:
> ...
>> Therefore, now we clear retrans_stamp as soon as all data during the
>> loss window is fully acked.
>>
>> Reported-by: Ueki Kohei
>> Cc: Neal Cardwell <ncardwell@google.com>
>> Cc: Yuchung Cheng <ycheng@google.com>
>> Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
>> ---
>>
>> Notes:
>> v1->v2: fixed compilation issue noticed by Neal
>>
>> net/ipv4/tcp_input.c | 60 +++++++++++++++++++++++++++-------------------------
>> 1 file changed, 31 insertions(+), 29 deletions(-)
>
> Acked-by: Neal Cardwell <ncardwell@google.com>
> Tested-by: Neal Cardwell <ncardwell@google.com>
>
> Code looks fine, and it passes Yuchung's packetdrill test case for this.
>
> Thanks for finding and fixing this, Marcelo.
And thank you guys for all the assistance on it. Btw, would you send me that
packetdrill script? I'm curious to see how such corner case could be written
on it.
Regards,
Marcelo
^ permalink raw reply
* Convert net_msg_warn, NETDEBUG, & LIMIT_NETDEBUG?
From: Joe Perches @ 2014-11-04 20:46 UTC (permalink / raw)
To: netdev
net_msg_warn is a sysctl used to control the printk
of a bundle of mostly ipv4/ipv6 logging messages.
Does anyone use it?
NETDEBUG is used 4 times, 2 of which seem senseless
as they are allocation failures messages after an
alloc_skb. These already get stack dumps.
The other NETDEBUG uses are ESP crypto descriptions.
LIMIT_NETDEBUG is used a lot more.
include/net/sock.h:#define LIMIT_NETDEBUG(fmt, args...) \
include/net/sock.h- do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0)
Most of the LIMIT_NETDEBUG uses are emitted at KERN_DEBUG.
Here is the count of each type of use:
31 KERN_DEBUG
2 KERN_ERR
3 KERN_INFO
11 KERN_WARNING
Should those KERN_DEBUG uses be converted to
net_dbg_ratelimited so that these uses could be
controlled via dynamic_debug instead of the
net_msg_warn sysctl?
net/dccp/ uses LIMIT_NETDEBUG via DCCP_WARN to
control another 38 KERN_WARNING messages.
The others LIMIT_NETDEBUG uses could be converted
to net_<level>_ratelimited if appropriate.
^ permalink raw reply
* Re: [PATCH v2 1/1] ip-link: in human readable output use dynamic precision length
From: Christian Hesse @ 2014-11-04 21:10 UTC (permalink / raw)
To: David Laight; +Cc: Stephen Hemminger, netdev@vger.kernel.org
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1C9E72A7@AcuExch.aculab.com>
[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]
David Laight <David.Laight@ACULAB.COM> on Tue, 2014/11/04 11:06:
> From: Christian Hesse
> ...
> > ...
> > @@ -343,8 +344,11 @@ static void print_num(FILE *fp, unsigned width,
> > uint64_t count) ++prefix;
> > }
> >
> > - snprintf(buf, sizeof(buf), "%.1f%c%s", (double) count / powi,
> > - *prefix, use_iec ? "i" : "");
> > + if ((precision = 3 - snprintf(NULL, 0, "%"PRIu64, count / powi))
> > < 0)
>
> Don't put assignments in conditionals.
Ok. :D
I do not like this at all... snprintf() would be nice for a catch-all, but we
have to take care of negative values. So let's try something different.
I will think about it and send a new patch.
> > + precision = 0;
> > +
> > + snprintf(buf, sizeof(buf), "%.*f%c%s", precision,
> > + (double) count / powi, *prefix, use_iec ? "i" : "");
> >
> > fprintf(fp, "%-*s ", width, buf);
> > }
>
> The above will go wrong in all sorts of horrid ways....
> For instance you are doing a truncating integer divide, but the FP
> value will get rounded for display.
>
> It would be safer to use integers throughout.
My implementation used integers, but Stephen changes this to floating point
with his cleanups.
IMHO the rounding is ok. This is for *human* readability. ;)
Whoever wants correct values should not ask ip to print human readable values
but rely on pure numbers.
> Oh, and a 2Mbit E1 link is actually 2048000 :-)
Sorry? Did not get the point.
--
Best regards,
Chris
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH -next v4 0/3] net: allow setting ecn via routing table
From: David Miller @ 2014-11-04 21:14 UTC (permalink / raw)
To: fw; +Cc: netdev
In-Reply-To: <1415032503-4936-1-git-send-email-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Mon, 3 Nov 2014 17:35:00 +0100
> Here is v4 of the patchset, its exactly the same as v3 except in patch3/3
> where I added the missing 'const' qualifier to a function argument that
> Eric spotted during review.
>
> I preserved Erics Acks so that he doesn't have to resend them.
Looks great, series applied, thanks Florian.
I particularly like how the syncookie code was handled.
^ permalink raw reply
* Re: [Xen-devel] [PATCHv1 net-next] xen-netback: remove unconditional pull_skb_tail in guest Tx path
From: David Miller @ 2014-11-04 21:17 UTC (permalink / raw)
To: zoltan.kiss
Cc: david.vrabel, Ian.Campbell, netdev, malcolm.crossley, wei.liu2,
xen-devel
In-Reply-To: <5457C807.5080509@linaro.org>
From: Zoltan Kiss <zoltan.kiss@linaro.org>
Date: Mon, 03 Nov 2014 18:23:03 +0000
>
>
> On 03/11/14 17:46, David Vrabel wrote:
>> On 03/11/14 17:39, Ian Campbell wrote:
>>> On Mon, 2014-11-03 at 17:23 +0000, David Vrabel wrote:
>>>> From: Malcolm Crossley <malcolm.crossley@citrix.com>
>>>>
>>>> Unconditionally pulling 128 bytes into the linear buffer is not
>>>> required. Netback has already grant copied up-to 128 bytes from the
>>>> first slot of a packet into the linear buffer. The first slot normally
>>>> contain all the IPv4/IPv6 and TCP/UDP headers.
>>>
>>> What about when it doesn't? It sounds as if we now won't pull up,
>>> which
>>> would be bad.
>>
>> The network stack will always pull any headers it needs to inspect
>> (the
>> frag may be a userspace page which has the same security issues as a
>> frag with a foreign page).
> I wouldn't bet my life on this, but indeed it should always happen.
I would bet my life on it.
Every protocol demux starts with pskb_may_pull() to pull frag data
into the linear area, if necessary, before looking at headers.
^ permalink raw reply
* [PATCH v3 1/1] ip-link: in human readable output use dynamic precision length
From: Christian Hesse @ 2014-11-04 21:17 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Christian Hesse
In-Reply-To: <20141104221038.440fd9d7@leda.localdomain>
---
ip/ipaddress.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index e240bb5..db39437 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -324,6 +324,8 @@ static void print_num(FILE *fp, unsigned width, uint64_t count)
const char *prefix = "kMGTPE";
const unsigned int base = use_iec ? 1024 : 1000;
uint64_t powi = 1;
+ uint16_t powj = 1;
+ uint8_t precision = 2;
char buf[64];
if (!human_readable || count < base) {
@@ -343,8 +345,15 @@ static void print_num(FILE *fp, unsigned width, uint64_t count)
++prefix;
}
- snprintf(buf, sizeof(buf), "%.1f%c%s", (double) count / powi,
- *prefix, use_iec ? "i" : "");
+ /* try to guess a good number of digits for precision */
+ for (; precision > 0; precision--) {
+ powj *= 10;
+ if (count / powi < powj)
+ break;
+ }
+
+ snprintf(buf, sizeof(buf), "%.*f%c%s", precision,
+ (double) count / powi, *prefix, use_iec ? "i" : "");
fprintf(fp, "%-*s ", width, buf);
}
--
2.1.3
^ permalink raw reply related
* Re: [PATCHv1 net-next] xen-netback: remove unconditional pull_skb_tail in guest Tx path
From: David Miller @ 2014-11-04 21:41 UTC (permalink / raw)
To: david.vrabel; +Cc: netdev, xen-devel, ian.campbell, wei.liu2, malcolm.crossley
In-Reply-To: <1415035431-27485-1-git-send-email-david.vrabel@citrix.com>
From: David Vrabel <david.vrabel@citrix.com>
Date: Mon, 3 Nov 2014 17:23:51 +0000
> From: Malcolm Crossley <malcolm.crossley@citrix.com>
>
> Unconditionally pulling 128 bytes into the linear buffer is not
> required. Netback has already grant copied up-to 128 bytes from the
> first slot of a packet into the linear buffer. The first slot normally
> contain all the IPv4/IPv6 and TCP/UDP headers.
>
> The unconditional pull would often copy frag data unnecessarily. This
> is a performance problem when running on a version of Xen where grant
> unmap avoids TLB flushes for pages which are not accessed. TLB
> flushes can now be avoided for > 99% of unmaps (it was 0% before).
>
> Grant unmap TLB flush avoidance will be available in a future version
> of Xen (probably 4.6).
>
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Now that this has been discussed a bit, it is possible to get an ack or two?
Thanks.
^ permalink raw reply
* Re: [Xen-devel] [PATCHv1 net-next] xen-netback: remove unconditional pull_skb_tail in guest Tx path
From: Eric Dumazet @ 2014-11-04 21:43 UTC (permalink / raw)
To: David Miller
Cc: zoltan.kiss, david.vrabel, Ian.Campbell, netdev, malcolm.crossley,
wei.liu2, xen-devel
In-Reply-To: <20141104.161704.1690311989900127361.davem@davemloft.net>
On Tue, 2014-11-04 at 16:17 -0500, David Miller wrote:
>
> Every protocol demux starts with pskb_may_pull() to pull frag data
> into the linear area, if necessary, before looking at headers.
eth_get_headlen() might be relevant as well, to perform a single copy of
exactly all headers.
This is known to help a bit.
^ permalink raw reply
* [PATCH V2 net-next] esp4: remove assignment in if condition
From: Fabian Frederick @ 2014-11-04 21:54 UTC (permalink / raw)
To: linux-kernel
Cc: Joe Perches, Fabian Frederick, Steffen Klassert, Herbert Xu,
David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
V2: remove blank line between set and test (suggested by Joe Perches).
net/ipv4/esp4.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 360b565..d2bf02e 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -392,8 +392,10 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
if (elen <= 0)
goto out;
- if ((err = skb_cow_data(skb, 0, &trailer)) < 0)
+ err = skb_cow_data(skb, 0, &trailer);
+ if (err < 0)
goto out;
+
nfrags = err;
assoclen = sizeof(*esph);
--
1.9.3
^ permalink raw reply related
* [PATCH net 0/5] Implement ndo_gso_check() for vxlan nics
From: Joe Stringer @ 2014-11-04 21:56 UTC (permalink / raw)
To: netdev
Cc: sathya.perla, jeffrey.t.kirsher, linux.nics, amirv, shahed.shaikh,
Dept-GELinuxNICDev, therbert, linux-kernel
Most NICs that report NETIF_F_GSO_UDP_TUNNEL support VXLAN, and not other
UDP-based encapsulation protocols where the format and size of the header may
differ. This patch series implements ndo_gso_check() for these NICs,
restricting the GSO handling to something that looks and smells like VXLAN.
Implementation shamelessly stolen from Tom Herbert (with minor fixups):
http://thread.gmane.org/gmane.linux.network/332428/focus=333111
If there are particular differences for your driver on actual support, I'd like
to hear about it. I adjusted the i40e driver to report support with tunnel
headers of up to 64 octets, perhaps there are other specifics that I've missed.
Joe Stringer (5):
be2net: Implement ndo_gso_check()
i40e: Implement ndo_gso_check()
fm10k: Implement ndo_gso_check()
net/mlx4_en: Implement ndo_gso_check()
qlcnic: Implement ndo_gso_check()
drivers/net/ethernet/emulex/benet/be_main.c | 12 ++++++++++++
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 12 ++++++++++++
drivers/net/ethernet/intel/i40e/i40e_main.c | 14 +++++++++++++-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 12 ++++++++++++
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 12 ++++++++++++
5 files changed, 61 insertions(+), 1 deletion(-)
--
1.7.10.4
^ permalink raw reply
* [PATCH net 2/5] i40e: Implement ndo_gso_check()
From: Joe Stringer @ 2014-11-04 21:56 UTC (permalink / raw)
To: netdev
Cc: sathya.perla, jeffrey.t.kirsher, linux.nics, amirv, shahed.shaikh,
Dept-GELinuxNICDev, therbert, linux-kernel
In-Reply-To: <1415138202-1197-1-git-send-email-joestringer@nicira.com>
ndo_gso_check() was recently introduced to allow NICs to report the
offloading support that they have on a per-skb basis. Add an
implementation for this driver which checks for tunnel headers over UDP
of up to 64 octets in length.
Implementation shamelessly stolen from Tom Herbert:
http://thread.gmane.org/gmane.linux.network/332428/focus=333111
Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index c3a7f4a..21829b5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7444,9 +7444,20 @@ static int i40e_ndo_fdb_dump(struct sk_buff *skb,
return idx;
}
-
#endif /* USE_DEFAULT_FDB_DEL_DUMP */
#endif /* HAVE_FDB_OPS */
+
+static bool i40e_gso_check(struct sk_buff *skb, struct net_device *dev)
+{
+ if ((skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL) &&
+ (skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
+ skb->inner_protocol != htons(ETH_P_TEB) ||
+ skb_inner_mac_header(skb) - skb_transport_header(skb) > 64))
+ return false;
+
+ return true;
+}
+
static const struct net_device_ops i40e_netdev_ops = {
.ndo_open = i40e_open,
.ndo_stop = i40e_close,
@@ -7487,6 +7498,7 @@ static const struct net_device_ops i40e_netdev_ops = {
.ndo_fdb_dump = i40e_ndo_fdb_dump,
#endif
#endif
+ .ndo_gso_check = i40e_gso_check,
};
/**
--
1.7.10.4
^ permalink raw reply related
* [PATCH net 3/5] fm10k: Implement ndo_gso_check()
From: Joe Stringer @ 2014-11-04 21:56 UTC (permalink / raw)
To: netdev
Cc: sathya.perla, jeffrey.t.kirsher, linux.nics, amirv, shahed.shaikh,
Dept-GELinuxNICDev, therbert, linux-kernel
In-Reply-To: <1415138202-1197-1-git-send-email-joestringer@nicira.com>
ndo_gso_check() was recently introduced to allow NICs to report the
offloading support that they have on a per-skb basis. Add an
implementation for this driver which checks for something that looks
like VXLAN.
Implementation shamelessly stolen from Tom Herbert:
http://thread.gmane.org/gmane.linux.network/332428/focus=333111
Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
Should this driver report support for GSO on packets with tunnel headers
up to 64B like the i40e driver does?
---
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index 8811364..b9ef622 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -1350,6 +1350,17 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv)
}
}
+static bool fm10k_gso_check(struct sk_buff *skb, struct net_device *dev)
+{
+ if ((skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL) &&
+ (skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
+ skb->inner_protocol != htons(ETH_P_TEB) ||
+ skb_inner_mac_header(skb) - skb_transport_header(skb) != 16))
+ return false;
+
+ return true;
+}
+
static const struct net_device_ops fm10k_netdev_ops = {
.ndo_open = fm10k_open,
.ndo_stop = fm10k_close,
@@ -1372,6 +1383,7 @@ static const struct net_device_ops fm10k_netdev_ops = {
.ndo_do_ioctl = fm10k_ioctl,
.ndo_dfwd_add_station = fm10k_dfwd_add_station,
.ndo_dfwd_del_station = fm10k_dfwd_del_station,
+ .ndo_gso_check = fm10k_gso_check,
};
#define DEFAULT_DEBUG_LEVEL_SHIFT 3
--
1.7.10.4
^ permalink raw reply related
* [PATCH net 4/5] net/mlx4_en: Implement ndo_gso_check()
From: Joe Stringer @ 2014-11-04 21:56 UTC (permalink / raw)
To: netdev
Cc: sathya.perla, jeffrey.t.kirsher, linux.nics, amirv, shahed.shaikh,
Dept-GELinuxNICDev, therbert, linux-kernel
In-Reply-To: <1415138202-1197-1-git-send-email-joestringer@nicira.com>
ndo_gso_check() was recently introduced to allow NICs to report the
offloading support that they have on a per-skb basis. Add an
implementation for this driver which checks for something that looks
like VXLAN.
Implementation shamelessly stolen from Tom Herbert:
http://thread.gmane.org/gmane.linux.network/332428/focus=333111
Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index f3032fe..aca9908 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2344,6 +2344,17 @@ static void mlx4_en_del_vxlan_port(struct net_device *dev,
}
#endif
+static bool mlx4_en_gso_check(struct sk_buff *skb, struct net_device *dev)
+{
+ if ((skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL) &&
+ (skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
+ skb->inner_protocol != htons(ETH_P_TEB) ||
+ skb_inner_mac_header(skb) - skb_transport_header(skb) != 16))
+ return false;
+
+ return true;
+}
+
static const struct net_device_ops mlx4_netdev_ops = {
.ndo_open = mlx4_en_open,
.ndo_stop = mlx4_en_close,
@@ -2374,6 +2385,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
.ndo_add_vxlan_port = mlx4_en_add_vxlan_port,
.ndo_del_vxlan_port = mlx4_en_del_vxlan_port,
#endif
+ .ndo_gso_check = mlx4_en_gso_check,
};
static const struct net_device_ops mlx4_netdev_ops_master = {
--
1.7.10.4
^ permalink raw reply related
* [PATCH net 5/5] qlcnic: Implement ndo_gso_check()
From: Joe Stringer @ 2014-11-04 21:56 UTC (permalink / raw)
To: netdev
Cc: sathya.perla, jeffrey.t.kirsher, linux.nics, amirv, shahed.shaikh,
Dept-GELinuxNICDev, therbert, linux-kernel
In-Reply-To: <1415138202-1197-1-git-send-email-joestringer@nicira.com>
ndo_gso_check() was recently introduced to allow NICs to report the
offloading support that they have on a per-skb basis. Add an
implementation for this driver which checks for something that looks
like VXLAN.
Implementation shamelessly stolen from Tom Herbert:
http://thread.gmane.org/gmane.linux.network/332428/focus=333111
Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index f5e29f7..6184f47 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -505,6 +505,17 @@ static void qlcnic_del_vxlan_port(struct net_device *netdev,
}
#endif
+static bool qlcnic_gso_check(struct sk_buff *skb, struct net_device *dev)
+{
+ if ((skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL) &&
+ (skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
+ skb->inner_protocol != htons(ETH_P_TEB) ||
+ skb_inner_mac_header(skb) - skb_transport_header(skb) != 16))
+ return false;
+
+ return true;
+}
+
static const struct net_device_ops qlcnic_netdev_ops = {
.ndo_open = qlcnic_open,
.ndo_stop = qlcnic_close,
@@ -537,6 +548,7 @@ static const struct net_device_ops qlcnic_netdev_ops = {
.ndo_set_vf_vlan = qlcnic_sriov_set_vf_vlan,
.ndo_set_vf_spoofchk = qlcnic_sriov_set_vf_spoofchk,
#endif
+ .ndo_gso_check = qlcnic_gso_check,
};
static const struct net_device_ops qlcnic_netdev_failed_ops = {
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH V2 net-next] esp4: remove assignment in if condition
From: David Miller @ 2014-11-04 21:58 UTC (permalink / raw)
To: fabf
Cc: linux-kernel, joe, steffen.klassert, herbert, kuznet, jmorris,
yoshfuji, kaber, netdev
In-Reply-To: <1415138076-7036-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Tue, 4 Nov 2014 22:54:36 +0100
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> V2: remove blank line between set and test (suggested by Joe Perches).
Applied, thanks.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox