lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <407513f4-1140-a5a0-9eb3-ed09abec4273@cogentembedded.com>
Date:   Thu, 29 Sep 2016 20:11:11 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Cc:     "David S. Miller" <davem@...emloft.net>,
        Bogdan Hamciuc <bogdan.hamciuc@...escale.com>,
        Ben Greear <greearb@...delatech.com>
Subject: Re: [PATCH net] net: pktgen: fix pkt_size

Hello.

On 09/29/2016 05:04 PM, Paolo Abeni wrote:

> The commit 879c7220e828 ("net: pktgen: Observe needed_headroom
> of the device") increased the 'pkt_overhead' field value by
> LL_RESERVED_SPACE.
> As a side effect the generated packet size, computed as:
>
> 	/* Eth + IPh + UDPh + mpls */
> 	datalen = pkt_dev->cur_pkt_size - 14 - 20 - 8 -
> 		  pkt_dev->pkt_overhead;
>
> is decreased by the same value.
> The above changed slightly the behavior of existing pktgen users,
> and made the interface somewhat inconsistent.
> Fix it by restoring the previous pkt_overhead value and using
> LL_RESERVED_SPACE as extralen in skb allocation.
> Also, change pktgen_alloc_skb() to only partially reserve
> the headroom to allow the caller to prefetch from ll header
> start.
>
> Fixes: 879c7220e828 ("net: pktgen: Observe needed_headroom of the device")
> Suggested-by: Ben Greear <greearb@...delatech.com>
> Signed-off-by: Paolo Abeni <pabeni@...hat.com>
> ---
>  net/core/pktgen.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> index bbd118b..5c9b397 100644
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
[...]
> @@ -2796,8 +2796,9 @@ static struct sk_buff *pktgen_alloc_skb(struct net_device *dev,
>  		 skb = __netdev_alloc_skb(dev, size, GFP_NOWAIT);
>  	}
>
> +	/* the caller prefetch from skb->data and reserve for the mac hdr */

    Pre-fetches and reserves?

[...]

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ