* Re: [PATCH -next 0/2] net: allow setting ecn via routing table
From: Eric Dumazet @ 2014-10-30 23:05 UTC (permalink / raw)
To: Florian Westphal; +Cc: David Miller, netdev
In-Reply-To: <20141030221501.GA9416@breakpoint.cc>
On Thu, 2014-10-30 at 23:15 +0100, Florian Westphal wrote:
> Do you think a fallback to non-ecn for retransmitted syns would help?
> If not, do you think having ecn tunable available via route is helpful?
Unfortunately some firewalls are buggy and accept a single SYN per flow.
You would need to blacklist ecn at first sign of a possible ecn problem,
for all following connections attempts.
Note that ECN problems are not only contained in SYN packets being
eventually dropped. You might have a success to establish a flow, and
later get CE marks for all packets and cwnd converges to 1.
This is really a lot of work to get all sorted out.
^ permalink raw reply
* Re: [PATCH v2 net 1/2] drivers/net: Disable UFO through virtio
From: Eric Dumazet @ 2014-10-30 23:16 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, Hannes Frederic Sowa, virtualization
In-Reply-To: <1414707602.16849.70.camel@decadent.org.uk>
On Thu, 2014-10-30 at 22:20 +0000, Ben Hutchings wrote:
> Could do. I'm trying to make small fixes that are suitable for stable.
Oh right, makes sense ;)
^ permalink raw reply
* Re: [PATCH -next 0/2] net: allow setting ecn via routing table
From: Florian Westphal @ 2014-10-30 23:16 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Florian Westphal, David Miller, netdev
In-Reply-To: <1414710342.15352.14.camel@edumazet-glaptop2.roam.corp.google.com>
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2014-10-30 at 23:15 +0100, Florian Westphal wrote:
>
> > Do you think a fallback to non-ecn for retransmitted syns would help?
>
> Unfortunately some firewalls are buggy and accept a single SYN per flow.
[..]
> Note that ECN problems are not only contained in SYN packets being
> eventually dropped. You might have a success to establish a flow, and
> later get CE marks for all packets and cwnd converges to 1.
I see. So that makes ecn=1 default a pure fantasy.
Thanks for explaining this.
^ permalink raw reply
* Re: [PATCH RESEND v2] ipv4: Do not cache routing failures due to disabled forwarding.
From: David Miller @ 2014-10-30 23:21 UTC (permalink / raw)
To: nicolas.cavallari; +Cc: kuznet, jmorris, yoshfuji, kaber, netdev, linux-kernel
In-Reply-To: <1414660193-4177-1-git-send-email-nicolas.cavallari@green-communications.fr>
From: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Date: Thu, 30 Oct 2014 10:09:53 +0100
> If we cache them, the kernel will reuse them, independently of
> whether forwarding is enabled or not. Which means that if forwarding is
> disabled on the input interface where the first routing request comes
> from, then that unreachable result will be cached and reused for
> other interfaces, even if forwarding is enabled on them. The opposite
> is also true.
>
> This can be verified with two interfaces A and B and an output interface
> C, where B has forwarding enabled, but not A and trying
> ip route get $dst iif A from $src && ip route get $dst iif B from $src
>
> Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
> Reviewed-by: Julian Anastasov <ja@ssi.bg>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* DONATION!!!
From: Mrs Birgit Rausing @ 2014-10-30 23:23 UTC (permalink / raw)
I,Birgit authenticate this email, you can read about me on:
http://en.wikipedia.org/wiki/Birgit_Rausing
I have funds for you to manage and disburse to various charities of your
choice. If you are sure you can handle this, it will be of help to you and
others. Please reply if you are interested for more details.please
Contact my private email;( mrs_BirgitRausin0@qq.com ) for more
information
With love,
Mrs Birgit Rausing
^ permalink raw reply
* Re: [PATCH net-next 5/8] net/mlx4_en: Remove redundant code from RX/GRO path
From: Or Gerlitz @ 2014-10-30 23:25 UTC (permalink / raw)
To: Eric Dumazet
Cc: Or Gerlitz, David S. Miller, Linux Netdev List, Matan Barak,
Amir Vadai, Saeed Mahameed, Shani Michaeli, Ido Shamay
In-Reply-To: <1414695631.15352.5.camel@edumazet-glaptop2.roam.corp.google.com>
On Thu, Oct 30, 2014 at 9:00 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2014-10-30 at 18:06 +0200, Or Gerlitz wrote:
>> Remove the code which goes through napi_gro_frags() on the RX path,
>> use only napi_gro_receive().
> Hmpff... napi_gro_frags() should be faster.
> Have you benchmarked this ?
yep we did, napi_gro_frags() was somehow better for single stream. Do
you think we need to do it the other way around, e.g converge to use
napi_gro_frags()?
^ permalink raw reply
* Re: [PATCH net-next 8/8] net/mlx4_en: Extend checksum offloading by CHECKSUM COMPLETE
From: Or Gerlitz @ 2014-10-30 23:28 UTC (permalink / raw)
To: Jerry Chu
Cc: Or Gerlitz, David S. Miller, netdev@vger.kernel.org, Matan Barak,
Amir Vadai, Saeed Mahameed, Shani Michaeli
In-Reply-To: <CAPshTChwewGiP712ki-BGu6VWhZTVOfZDzFm8NEqvon7uLhEWA@mail.gmail.com>
On Thu, Oct 30, 2014 at 11:20 PM, Jerry Chu <hkchu@google.com> wrote:
> Acked-by: H.K. Jerry Chu <hkchu@google.com>
>
> BTW, will the patch work for all versions of the chip?
If you'll look carefully, you'll see we go that path only when
priv->flags & MLX4_EN_FLAG_RX_CSUM_NON_TCP_UDP is true. This currently
holds only for ConnectX3 and not ConnectX3-pro. Down the road, the
feature will also be available for the -pro too.
^ permalink raw reply
* Re: [PATCH -next 0/2] net: allow setting ecn via routing table
From: Eric Dumazet @ 2014-10-30 23:30 UTC (permalink / raw)
To: Florian Westphal; +Cc: David Miller, netdev
In-Reply-To: <20141030231637.GF10069@breakpoint.cc>
On Fri, 2014-10-31 at 00:16 +0100, Florian Westphal wrote:
> I see. So that makes ecn=1 default a pure fantasy.
Well, I had this dream about 2 or 3 years ago, but I eventually came to
this (sad) conclusion.
^ permalink raw reply
* DONATION!!!
From: Mrs Birgit Rausing @ 2014-10-30 23:30 UTC (permalink / raw)
I,Birgit authenticate this email, you can read about me on:
http://en.wikipedia.org/wiki/Birgit_Rausing
I have funds for you to manage and disburse to various charities of your
choice. If you are sure you can handle this, it will be of help to you and
others. Please reply if you are interested for more details.please
Contact my private email;( mrs_BirgitRausin0@qq.com ) for more
information
With love,
Mrs Birgit Rausing
^ permalink raw reply
* Re: [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr
From: David Miller @ 2014-10-30 23:40 UTC (permalink / raw)
To: michele; +Cc: vyasevich, nhorman, linux-sctp, netdev
In-Reply-To: <1414661356-17255-1-git-send-email-michele@acksyn.org>
From: Michele Baldessari <michele@acksyn.org>
Date: Thu, 30 Oct 2014 10:29:15 +0100
> It is often quite helpful to be able to know the state of a transport
> outside of the application itself (for troubleshooting purposes or for
> monitoring purposes). Add it under /proc/net/sctp/remaddr.
>
> Signed-off-by: Michele Baldessari <michele@acksyn.org>
Applied.
^ permalink raw reply
* Re: [net-next 2/2] sctp: replace seq_printf with seq_puts
From: David Miller @ 2014-10-30 23:40 UTC (permalink / raw)
To: michele; +Cc: vyasevich, nhorman, linux-sctp, netdev
In-Reply-To: <1414661356-17255-2-git-send-email-michele@acksyn.org>
From: Michele Baldessari <michele@acksyn.org>
Date: Thu, 30 Oct 2014 10:29:16 +0100
> Fixes checkpatch warning:
> "WARNING: Prefer seq_puts to seq_printf"
>
> Signed-off-by: Michele Baldessari <michele@acksyn.org>
Applied.
^ permalink raw reply
* DONATION!!!
From: Mrs Birgit Rausing @ 2014-10-30 23:43 UTC (permalink / raw)
I,Birgit authenticate this email, you can read about me on:
http://en.wikipedia.org/wiki/Birgit_Rausing
I have funds for you to manage and disburse to various charities of your
choice. If you are sure you can handle this, it will be of help to you and
others. Please reply if you are interested for more details.please
Contact my private email;( mrs_BirgitRausin0@qq.com ) for more
information
With love,
Mrs Birgit Rausing
^ permalink raw reply
* Re: [PATCH] stmmac: pci: set default of the filter bins
From: David Miller @ 2014-10-30 23:44 UTC (permalink / raw)
To: andriy.shevchenko; +Cc: peppe.cavallaro, netdev, hock.leong.kweh, vbridgers2013
In-Reply-To: <1414661965-1140-1-git-send-email-andriy.shevchenko@linux.intel.com>
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Thu, 30 Oct 2014 11:39:25 +0200
> @@ -32,7 +32,10 @@ static struct stmmac_dma_cfg dma_cfg;
>
> static void stmmac_default_data(void)
> {
> + struct plat_stmmacenet_data *plat = &plat_dat;
> +
> memset(&plat_dat, 0, sizeof(struct plat_stmmacenet_data));
> +
> plat_dat.bus_id = 1;
> plat_dat.phy_addr = 0;
> plat_dat.interface = PHY_INTERFACE_MODE_GMII;
> @@ -47,6 +50,12 @@ static void stmmac_default_data(void)
> dma_cfg.pbl = 32;
> dma_cfg.burst_len = DMA_AXI_BLEN_256;
> plat_dat.dma_cfg = &dma_cfg;
> +
> + /* Set default value for multicast hash bins */
> + plat->multicast_filter_bins = HASH_TABLE_SIZE;
> +
> + /* Set default value for unicast filter entries */
> + plat->unicast_filter_entries = 1;
Don't do this.
The rest of the function goes "plat_dat.foo" so it looks terribly
inconsistent when you add the local variable to dereference it like
this.
So just do "plat_dat.multicast_filter_bins = x;" etc.
^ permalink raw reply
* DONATION!!!
From: Mrs Birgit Rausing @ 2014-10-30 23:45 UTC (permalink / raw)
I,Birgit authenticate this email, you can read about me on:
http://en.wikipedia.org/wiki/Birgit_Rausing
I have funds for you to manage and disburse to various charities of your
choice. If you are sure you can handle this, it will be of help to you and
others. Please reply if you are interested for more details.please
Contact my private email;( mrs_BirgitRausin0@qq.com ) for more
information
With love,
Mrs Birgit Rausing
^ permalink raw reply
* Re: [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30
From: David Miller @ 2014-10-30 23:47 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
In-Reply-To: <1414672436-20616-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 30 Oct 2014 05:33:52 -0700
> This series contains updates to e1000, igb and ixgbe.
>
> Francesco Ruggeri fixes an issue with e1000 where in a VM the driver did
> not support unicast filtering.
>
> Roman Gushchin fixes an issue with igb where the driver was re-using
> mapped pages so that packets were still getting dropped even if all
> the memory issues are gone and there is free memory.
>
> Junwei Zhang found where in the ixgbe_clean_rx_ring() we were repeating
> the assignment of NULL to the receive buffer skb and fixes it.
>
> Emil fixes a race condition between setup_link and SFP detection routine
> in the watchdog when setting the advertised speed.
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [PATCH net 0/2] mlx4 driver encapsulation/steering fixes
From: David Miller @ 2014-10-30 23:49 UTC (permalink / raw)
To: ogerlitz; +Cc: netdev, matanb, amirv, saeedm
In-Reply-To: <1414677568-28409-1-git-send-email-ogerlitz@mellanox.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Thu, 30 Oct 2014 15:59:26 +0200
> The 1st patch fixes a bug in the TX path that supports offloading the
> TX checksum of (VXLAN) encapsulated TCP packets. It turns out that the
> bug is revealed only when the receiver runs in non-offloaded mode, so
> we somehow missed it so far... please queue it for -stable >= 3.14
>
> The 2nd patch makes sure not to leak steering entry on error flow,
> please queue it to 3.17-stable
Applied and queue up for -stable.
^ permalink raw reply
* DONATION!!!
From: Mrs Birgit Rausing @ 2014-10-30 23:51 UTC (permalink / raw)
I,Birgit authenticate this email, you can read about me on:
http://en.wikipedia.org/wiki/Birgit_Rausing
I have funds for you to manage and disburse to various charities of your
choice. If you are sure you can handle this, it will be of help to you and
others. Please reply if you are interested for more details.please
Contact my private email;( mrs_BirgitRausin0@qq.com ) for more
information
With love,
Mrs Birgit Rausing
^ permalink raw reply
* Re: [PATCH net] gre: Use inner mac length when computing tunnel length
From: David Miller @ 2014-10-30 23:52 UTC (permalink / raw)
To: therbert; +Cc: alexander.duyck, netdev
In-Reply-To: <1414683656-26493-1-git-send-email-therbert@google.com>
From: Tom Herbert <therbert@google.com>
Date: Thu, 30 Oct 2014 08:40:56 -0700
> Currently, skb_inner_network_header is used but this does not account
> for Ethernet header for ETH_P_TEB. Use skb_inner_mac_header which
> handles TEB and also should work with IP encapsulation in which case
> inner mac and inner network headers are the same.
>
> Tested: Ran TCP_STREAM over GRE, worked as expected.
>
> Signed-off-by: Tom Herbert <therbert@google.com>
Applied and queued up for -stable.
Thanks everyone.
^ permalink raw reply
* Re: [PATCH net-next 8/8] net/mlx4_en: Extend checksum offloading by CHECKSUM COMPLETE
From: Jerry Chu @ 2014-10-30 23:53 UTC (permalink / raw)
To: Or Gerlitz
Cc: Or Gerlitz, David S. Miller, netdev@vger.kernel.org, Matan Barak,
Amir Vadai, Saeed Mahameed, Shani Michaeli
In-Reply-To: <CAJ3xEMgC75anCmeKie8NZBZHfR8OW67pBiPQhyLUPK9cNJZHMg@mail.gmail.com>
On Thu, Oct 30, 2014 at 4:28 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
>
> On Thu, Oct 30, 2014 at 11:20 PM, Jerry Chu <hkchu@google.com> wrote:
> > Acked-by: H.K. Jerry Chu <hkchu@google.com>
> >
> > BTW, will the patch work for all versions of the chip?
>
> If you'll look carefully, you'll see we go that path only when
> priv->flags & MLX4_EN_FLAG_RX_CSUM_NON_TCP_UDP is true. This currently
> holds only for ConnectX3 and not ConnectX3-pro. Down the road, the
> feature will also be available for the -pro too.
It didn't dawn on me that flag will be tied to CX3 but this makes sense.
Thanks,
Jerry
^ permalink raw reply
* DONATION!!!
From: Mrs Birgit Rausing @ 2014-10-30 23:53 UTC (permalink / raw)
I,Birgit authenticate this email, you can read about me on:
http://en.wikipedia.org/wiki/Birgit_Rausing
I have funds for you to manage and disburse to various charities of your
choice. If you are sure you can handle this, it will be of help to you and
others. Please reply if you are interested for more details.please
Contact my private email;( mrs_BirgitRausin0@qq.com ) for more
information
With love,
Mrs Birgit Rausing
^ permalink raw reply
* Re: [PATCH net-next] tcp: Correction to RFC number in comment
From: David Miller @ 2014-10-30 23:54 UTC (permalink / raw)
To: sowmini.varadhan; +Cc: netdev
In-Reply-To: <20141030164808.GH650@oracle.com>
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Thu, 30 Oct 2014 12:48:08 -0400
> Challenge ACK is described in RFC 5961, fix typo.
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCHv2 net-next 0/2] sunvnet: Use multiple Tx queues.
From: David Miller @ 2014-10-30 23:57 UTC (permalink / raw)
To: sowmini.varadhan; +Cc: netdev
In-Reply-To: <20141030164547.GE650@oracle.com>
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Thu, 30 Oct 2014 12:45:47 -0400
>
> v2: moved tcp fix out of this series per David Miller feedback
>
> The primary objective of this patch-set is to address the suggestion from
> http://marc.info/?l=linux-netdev&m=140790778931563&w=2
> With the changes in Patch 2, every vnet_port will get packets from
> a single tx-queue, and flow-control/head-of-line-blocking is
> confined to the vnet_ports that share that tx queue (as opposed to
> flow-controlling *all* peers).
>
> Patch 1 is an optimization that resets the DATA_READY bit when
> we re-enable Rx interrupts. This optimization lets us exit quickly
> from vnet_event_napi() when new data has not triggered an interrupt.
This looks great, series applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next 8/8] net/mlx4_en: Extend checksum offloading by CHECKSUM COMPLETE
From: Tom Herbert @ 2014-10-30 23:59 UTC (permalink / raw)
To: Or Gerlitz
Cc: David S. Miller, Linux Netdev List, Matan Barak, Amir Vadai,
Saeed Mahameed, Shani Michaeli, Jerry Chu
In-Reply-To: <1414685216-28907-9-git-send-email-ogerlitz@mellanox.com>
On Thu, Oct 30, 2014 at 9:06 AM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
> From: Shani Michaeli <shanim@mellanox.com>
>
> When processing received traffic, pass CHECKSUM_COMPLETE status to the
> stack, with calculated checksum for non TCP/UDP packets (such
> as GRE or ICMP).
>
Hi Or,
This is very exciting work! One question though, what would mlx4
return in the case of a zero UDP checksum? (I assume this patch won't
affect this case but would like to make sure).
Thanks,
Tom
> Although the stack expects checksum which doesn't include the pseudo
> header, the HW adds it. To address that, we are subtracting the pseudo
> header checksum from the checksum value provided by the HW.
>
> In the IPv6 case, we also compute/add the IP header checksum which
> is not added by the HW for such packets.
>
> Cc: Jerry Chu <hkchu@google.com>
> Signed-off-by: Shani Michaeli <shanim@mellanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> ---
> drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 2 +-
> drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 5 +
> drivers/net/ethernet/mellanox/mlx4/en_port.c | 2 +
> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 116 +++++++++++++++++++++-
> drivers/net/ethernet/mellanox/mlx4/main.c | 9 ++
> drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 5 +-
> include/linux/mlx4/device.h | 1 +
> 7 files changed, 132 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> index 8ea4d5b..6c64323 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> @@ -115,7 +115,7 @@ static const char main_strings[][ETH_GSTRING_LEN] = {
> "tso_packets",
> "xmit_more",
> "queue_stopped", "wake_queue", "tx_timeout", "rx_alloc_failed",
> - "rx_csum_good", "rx_csum_none", "tx_chksum_offload",
> + "rx_csum_good", "rx_csum_none", "rx_csum_complete", "tx_chksum_offload",
>
> /* packet statistics */
> "broadcast", "rx_prio_0", "rx_prio_1", "rx_prio_2", "rx_prio_3",
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 0efbae9..d1eb25d 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -1893,6 +1893,7 @@ static void mlx4_en_clear_stats(struct net_device *dev)
> priv->rx_ring[i]->packets = 0;
> priv->rx_ring[i]->csum_ok = 0;
> priv->rx_ring[i]->csum_none = 0;
> + priv->rx_ring[i]->csum_complete = 0;
> }
> }
>
> @@ -2503,6 +2504,10 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
> /* Query for default mac and max mtu */
> priv->max_mtu = mdev->dev->caps.eth_mtu_cap[priv->port];
>
> + if (mdev->dev->caps.rx_checksum_flags_port[priv->port] &
> + MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP)
> + priv->flags |= MLX4_EN_FLAG_RX_CSUM_NON_TCP_UDP;
> +
> /* Set default MAC */
> dev->addr_len = ETH_ALEN;
> mlx4_en_u64_to_mac(dev->dev_addr, mdev->dev->caps.def_mac[priv->port]);
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_port.c b/drivers/net/ethernet/mellanox/mlx4/en_port.c
> index 134b12e..6cb8007 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_port.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_port.c
> @@ -155,11 +155,13 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
> stats->rx_bytes = 0;
> priv->port_stats.rx_chksum_good = 0;
> priv->port_stats.rx_chksum_none = 0;
> + priv->port_stats.rx_chksum_complete = 0;
> for (i = 0; i < priv->rx_ring_num; i++) {
> stats->rx_packets += priv->rx_ring[i]->packets;
> stats->rx_bytes += priv->rx_ring[i]->bytes;
> priv->port_stats.rx_chksum_good += priv->rx_ring[i]->csum_ok;
> priv->port_stats.rx_chksum_none += priv->rx_ring[i]->csum_none;
> + priv->port_stats.rx_chksum_complete += priv->rx_ring[i]->csum_complete;
> }
> stats->tx_packets = 0;
> stats->tx_bytes = 0;
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> index 2a29a1a..f8a0449 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> @@ -42,6 +42,10 @@
> #include <linux/vmalloc.h>
> #include <linux/irq.h>
>
> +#if IS_ENABLED(CONFIG_IPV6)
> +#include <net/ip6_checksum.h>
> +#endif
> +
> #include "mlx4_en.h"
>
> static int mlx4_alloc_pages(struct mlx4_en_priv *priv,
> @@ -642,6 +646,86 @@ static void mlx4_en_refill_rx_buffers(struct mlx4_en_priv *priv,
> }
> }
>
> +/* When hardware doesn't strip the vlan, we need to calculate the checksum
> + * over it and add it to the hardware's checksum calculation
> + */
> +static inline __wsum get_fixed_vlan_csum(__wsum hw_checksum,
> + struct vlan_hdr *vlanh)
> +{
> + return csum_add(hw_checksum, *(__wsum *)vlanh);
> +}
> +
> +/* Although the stack expects checksum which doesn't include the pseudo
> + * header, the HW adds it. To address that, we are subtracting the pseudo
> + * header checksum from the checksum value provided by the HW.
> + */
> +static void get_fixed_ipv4_csum(__wsum hw_checksum, struct sk_buff *skb,
> + struct iphdr *iph)
> +{
> + __u16 length_for_csum = 0;
> + __wsum csum_pseudo_header = 0;
> +
> + length_for_csum = (be16_to_cpu(iph->tot_len) - (iph->ihl << 2));
> + csum_pseudo_header = csum_tcpudp_nofold(iph->saddr, iph->daddr,
> + length_for_csum, iph->protocol, 0);
> + skb->csum = csum_sub(hw_checksum, csum_pseudo_header);
> +}
> +
> +#if IS_ENABLED(CONFIG_IPV6)
> +/* In IPv6 packets, besides subtracting the pseudo header checksum,
> + * we also compute/add the IP header checksum which
> + * is not added by the HW.
> + */
> +static int get_fixed_ipv6_csum(__wsum hw_checksum, struct sk_buff *skb,
> + struct ipv6hdr *ipv6h)
> +{
> + __wsum csum_pseudo_header = 0;
> +
> + if (ipv6h->nexthdr == IPPROTO_FRAGMENT || ipv6h->nexthdr == IPPROTO_HOPOPTS)
> + return -1;
> + hw_checksum = csum_add(hw_checksum, (__force __wsum)(ipv6h->nexthdr << 8));
> +
> + csum_pseudo_header = csum_ipv6_magic_nofold(&ipv6h->saddr,
> + &ipv6h->daddr,
> + ntohs(ipv6h->payload_len),
> + ipv6h->nexthdr,
> + 0);
> + skb->csum = csum_sub(hw_checksum, csum_pseudo_header);
> + skb->csum = csum_add(skb->csum, csum_partial(ipv6h, sizeof(struct ipv6hdr), 0));
> + return 0;
> +}
> +#endif
> +
> +static int check_csum(struct mlx4_cqe *cqe, struct sk_buff *skb, int hwtstamp_rx_filter)
> +{
> + __wsum hw_checksum = 0;
> +
> + void *hdr = (u8 *)skb->data + sizeof(struct ethhdr);
> +
> + hw_checksum = csum_unfold((__force __sum16)cqe->checksum);
> +
> + if (((struct ethhdr *)skb->data)->h_proto == htons(ETH_P_8021Q) &&
> + hwtstamp_rx_filter != HWTSTAMP_FILTER_NONE) {
> + /* next protocol non IPv4 or IPv6 */
> + if (((struct vlan_hdr *)hdr)->h_vlan_encapsulated_proto
> + != htons(ETH_P_IP) ||
> + ((struct vlan_hdr *)hdr)->h_vlan_encapsulated_proto
> + != htons(ETH_P_IPV6))
> + return -1;
> + hw_checksum = get_fixed_vlan_csum(hw_checksum, hdr);
> + hdr += sizeof(struct vlan_hdr);
> + }
> +
> + if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV4))
> + get_fixed_ipv4_csum(hw_checksum, skb, hdr);
> +#if IS_ENABLED(CONFIG_IPV6)
> + else if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV6))
> + if (get_fixed_ipv6_csum(hw_checksum, skb, hdr))
> + return -1;
> +#endif
> + return 0;
> +}
> +
> int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int budget)
> {
> struct mlx4_en_priv *priv = netdev_priv(dev);
> @@ -743,13 +827,26 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> (cqe->vlan_my_qpn & cpu_to_be32(MLX4_CQE_L2_TUNNEL));
>
> if (likely(dev->features & NETIF_F_RXCSUM)) {
> - if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
> - (cqe->checksum == cpu_to_be16(0xffff))) {
> - ring->csum_ok++;
> - ip_summed = CHECKSUM_UNNECESSARY;
> + if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_TCP |
> + MLX4_CQE_STATUS_UDP)) {
> + if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
> + cqe->checksum == cpu_to_be16(0xffff)) {
> + ip_summed = CHECKSUM_UNNECESSARY;
> + ring->csum_ok++;
> + } else {
> + ip_summed = CHECKSUM_NONE;
> + ring->csum_none++;
> + }
> } else {
> - ip_summed = CHECKSUM_NONE;
> - ring->csum_none++;
> + if (priv->flags & MLX4_EN_FLAG_RX_CSUM_NON_TCP_UDP &&
> + (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV4 |
> + MLX4_CQE_STATUS_IPV6))) {
> + ip_summed = CHECKSUM_COMPLETE;
> + ring->csum_complete++;
> + } else {
> + ip_summed = CHECKSUM_NONE;
> + ring->csum_none++;
> + }
> }
> } else {
> ip_summed = CHECKSUM_NONE;
> @@ -767,6 +864,13 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
> goto next;
> }
>
> + if (ip_summed == CHECKSUM_COMPLETE) {
> + if (check_csum(cqe, skb, ring->hwtstamp_rx_filter)) {
> + ip_summed = CHECKSUM_NONE;
> + ring->csum_none++;
> + }
> + }
> +
> skb->ip_summed = ip_summed;
> skb->protocol = eth_type_trans(skb, dev);
> skb_record_rx_queue(skb, cq->ring);
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index 9f82196..2f6ba42 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -1629,6 +1629,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
> struct mlx4_init_hca_param init_hca;
> u64 icm_size;
> int err;
> + struct mlx4_config_dev_params params;
>
> if (!mlx4_is_slave(dev)) {
> err = mlx4_QUERY_FW(dev);
> @@ -1762,6 +1763,14 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
> goto unmap_bf;
> }
>
> + /* Query CONFIG_DEV parameters */
> + err = mlx4_config_dev_retrieval(dev, ¶ms);
> + if (err && err != -ENOTSUPP) {
> + mlx4_err(dev, "Failed to query CONFIG_DEV parameters\n");
> + } else if (!err) {
> + dev->caps.rx_checksum_flags_port[1] = params.rx_csum_flags_port_1;
> + dev->caps.rx_checksum_flags_port[2] = params.rx_csum_flags_port_2;
> + }
> priv->eq_table.inta_pin = adapter.inta_pin;
> memcpy(dev->board_id, adapter.board_id, sizeof dev->board_id);
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> index ef83d12..de45674 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> @@ -326,6 +326,7 @@ struct mlx4_en_rx_ring {
> #endif
> unsigned long csum_ok;
> unsigned long csum_none;
> + unsigned long csum_complete;
> int hwtstamp_rx_filter;
> cpumask_var_t affinity_mask;
> };
> @@ -449,6 +450,7 @@ struct mlx4_en_port_stats {
> unsigned long rx_alloc_failed;
> unsigned long rx_chksum_good;
> unsigned long rx_chksum_none;
> + unsigned long rx_chksum_complete;
> unsigned long tx_chksum_offload;
> #define NUM_PORT_STATS 9
> };
> @@ -507,7 +509,8 @@ enum {
> MLX4_EN_FLAG_ENABLE_HW_LOOPBACK = (1 << 2),
> /* whether we need to drop packets that hardware loopback-ed */
> MLX4_EN_FLAG_RX_FILTER_NEEDED = (1 << 3),
> - MLX4_EN_FLAG_FORCE_PROMISC = (1 << 4)
> + MLX4_EN_FLAG_FORCE_PROMISC = (1 << 4),
> + MLX4_EN_FLAG_RX_CSUM_NON_TCP_UDP = (1 << 5),
> };
>
> #define MLX4_EN_MAC_HASH_SIZE (1 << BITS_PER_BYTE)
> diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
> index 5cc5eac..3d9bff0 100644
> --- a/include/linux/mlx4/device.h
> +++ b/include/linux/mlx4/device.h
> @@ -497,6 +497,7 @@ struct mlx4_caps {
> u16 hca_core_clock;
> u64 phys_port_id[MLX4_MAX_PORTS + 1];
> int tunnel_offload_mode;
> + u8 rx_checksum_flags_port[MLX4_MAX_PORTS + 1];
> };
>
> struct mlx4_buf_list {
> --
> 1.7.1
>
> --
> 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
^ permalink raw reply
* Re: [PATCH] net: skb_fclone_busy() needs to detect orphaned skb
From: David Miller @ 2014-10-30 23:59 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, ncardwell
In-Reply-To: <1414690354.9028.9.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 30 Oct 2014 10:32:34 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> Some drivers are unable to perform TX completions in a bound time.
> They instead call skb_orphan()
>
> Problem is skb_fclone_busy() has to detect this case, otherwise
> we block TCP retransmits and can freeze unlucky tcp sessions on
> mostly idle hosts.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Fixes: 1f3279ae0c13 ("tcp: avoid retransmits of TCP packets hanging in host queues")
Applied, and queued up for -stable, thanks Eric.
> This problem is known to hurt users of linux-3.16 kernels used by guests kernels.
> David, I can provide backports if you want.
Since 3.16 is no longer active, I'll only need to put this into 3.17-stable
which I should be able to handle on my own.
But thanks for offering, sometimes difficult backports take up a lot
of time.
^ permalink raw reply
* Re: [PATCH v2 net 0/2] drivers/net,ipv6: Fix IPv6 fragment ID selection for virtio
From: David Miller @ 2014-10-31 0:02 UTC (permalink / raw)
To: ben; +Cc: netdev, hannes, virtualization
In-Reply-To: <1414693592.16849.61.camel@decadent.org.uk>
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 30 Oct 2014 18:26:32 +0000
> The virtio net protocol supports UFO but does not provide for passing a
> fragment ID for fragmentation of IPv6 packets. We used to generate a
> fragment ID wherever such a packet was fragmented, but currently we
> always use ID=0!
>
> v2: Add blank lines after declarations
Series applied and queued up for -stable, thanks Ben.
^ 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