netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Tariq Toukan <tariqt@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: Re: [PATCH net] mlx4: reduce OOM risk on arches with large pages
Date: Mon, 20 Feb 2017 10:44:19 +0200	[thread overview]
Message-ID: <e0d311ac-50a8-362b-a7bd-c00e520bb49c@gmail.com> (raw)
In-Reply-To: <1487442858.1311.104.camel@edumazet-glaptop3.roam.corp.google.com>



On 18/02/2017 8:34 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Since mlx4 NIC are used on PowerPC with 64K pages, we need to adapt
> MLX4_EN_ALLOC_PREFER_ORDER definition.
>
> Otherwise, a fragment sitting in an out of order TCP queue can hold
> 0.5 Mbytes and it is a serious OOM risk.
>
> Fixes: 51151a16a60f ("mlx4: allow order-0 memory allocations in RX path")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  drivers/net/ethernet/mellanox/mlx4/mlx4_en.h |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> index cec59bc264c9ac197048fd7c98bcd5cf25de0efd..0f6d2f3b7d54f51de359d4ccde21f4585e6b7852 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> @@ -102,7 +102,8 @@
>  /* Use the maximum between 16384 and a single page */
>  #define MLX4_EN_ALLOC_SIZE	PAGE_ALIGN(16384)
>
> -#define MLX4_EN_ALLOC_PREFER_ORDER	PAGE_ALLOC_COSTLY_ORDER
> +#define MLX4_EN_ALLOC_PREFER_ORDER min_t(int, get_order(32768),		\
> +					 PAGE_ALLOC_COSTLY_ORDER)
>
>  /* Receive fragment sizes; we use at most 3 fragments (for 9600 byte MTU
>   * and 4K allocations) */
>
>

Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Thanks Eric!

  reply	other threads:[~2017-02-20  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-18 18:34 [PATCH net] mlx4: reduce OOM risk on arches with large pages Eric Dumazet
2017-02-20  8:44 ` Tariq Toukan [this message]
2017-02-20 15:32 ` David Miller

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=e0d311ac-50a8-362b-a7bd-c00e520bb49c@gmail.com \
    --to=ttoukan.linux@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=tariqt@mellanox.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 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).