Message ID | 158634675119.707275.11255025996295308217.stgit@firesoul |
---|---|
State | RFC |
Delegated to: | BPF Maintainers |
Headers | show
Return-Path: <bpf-owner@vger.kernel.org> X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UYI8Ua/M; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48y2hQ6Hx2z9sSg for <incoming-bpf@patchwork.ozlabs.org>; Wed, 8 Apr 2020 21:52:38 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728454AbgDHLwi (ORCPT <rfc822;incoming-bpf@patchwork.ozlabs.org>); Wed, 8 Apr 2020 07:52:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:35123 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727612AbgDHLwh (ORCPT <rfc822; bpf@vger.kernel.org>); Wed, 8 Apr 2020 07:52:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586346756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3AsaCSGIzYZvw4mOnWKfUdq3Y1S7ifGzwLeXDOIt/dU=; b=UYI8Ua/M4hOPwTWG4HWMP7aqACFVWLReWZPMZmuOqv6EmPpY9J73WImFnAibfOXYLDW5Qn FveH6CTXoKVLV+NqN786AdUt9Pp9dbkeUhMCzN9jh48N5YKqTRNSIW8SrEYduKU5DBYGuz jAyNJeSqk4JqMdBEH+klLI3jiga36Jk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-390-jiQQhIH7O1e_210osReL_Q-1; Wed, 08 Apr 2020 07:52:34 -0400 X-MC-Unique: jiQQhIH7O1e_210osReL_Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9120F800D5C; Wed, 8 Apr 2020 11:52:32 +0000 (UTC) Received: from firesoul.localdomain (unknown [10.40.208.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FA7B1001F43; Wed, 8 Apr 2020 11:52:32 +0000 (UTC) Received: from [192.168.42.3] (localhost [IPv6:::1]) by firesoul.localdomain (Postfix) with ESMTP id 41424300020FA; Wed, 8 Apr 2020 13:52:31 +0200 (CEST) Subject: [PATCH RFC v2 23/33] ixgbe: fix XDP redirect on archs with PAGE_SIZE above 4K From: Jesper Dangaard Brouer <brouer@redhat.com> To: sameehj@amazon.com Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>, Jesper Dangaard Brouer <brouer@redhat.com>, netdev@vger.kernel.org, bpf@vger.kernel.org, zorik@amazon.com, akiyano@amazon.com, gtzalik@amazon.com, =?utf-8?b?VG9rZSBIw7hp?= =?utf-8?q?land-J=C3=B8rgensen?= <toke@redhat.com>, Daniel Borkmann <borkmann@iogearbox.net>, Alexei Starovoitov <alexei.starovoitov@gmail.com>, John Fastabend <john.fastabend@gmail.com>, Alexander Duyck <alexander.duyck@gmail.com>, Jeff Kirsher <jeffrey.t.kirsher@intel.com>, David Ahern <dsahern@gmail.com>, Willem de Bruijn <willemdebruijn.kernel@gmail.com>, Ilias Apalodimas <ilias.apalodimas@linaro.org>, Lorenzo Bianconi <lorenzo@kernel.org>, Saeed Mahameed <saeedm@mellanox.com> Date: Wed, 08 Apr 2020 13:52:31 +0200 Message-ID: <158634675119.707275.11255025996295308217.stgit@firesoul> In-Reply-To: <158634658714.707275.7903484085370879864.stgit@firesoul> References: <158634658714.707275.7903484085370879864.stgit@firesoul> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: <bpf.vger.kernel.org> X-Mailing-List: bpf@vger.kernel.org |
Series |
[RFC,v2,01/33] xdp: add frame size to xdp_buff
|
expand
|
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 718931d951bc..ea6834bae04c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -2254,7 +2254,8 @@ static void ixgbe_rx_buffer_flip(struct ixgbe_ring *rx_ring, rx_buffer->page_offset ^= truesize; #else unsigned int truesize = ring_uses_build_skb(rx_ring) ? - SKB_DATA_ALIGN(IXGBE_SKB_PAD + size) : + SKB_DATA_ALIGN(IXGBE_SKB_PAD + size) + + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) : SKB_DATA_ALIGN(size); rx_buffer->page_offset += truesize;
The ixgbe driver have another memory model when compiled on archs with PAGE_SIZE above 4096 bytes. In this mode it doesn't split the page in two halves, but instead increment rx_buffer->page_offset by truesize of packet (which include headroom and tailroom for skb_shared_info). This is done correctly in ixgbe_build_skb(), but in ixgbe_rx_buffer_flip which is currently only called on XDP_TX and XDP_REDIRECT, it forgets to add the tailroom for skb_shared_info. This breaks XDP_REDIRECT, for veth and cpumap. Fix by adding size of skb_shared_info tailroom. Maintainers notice: This fix have been queued to Jeff. Fixes: 6453073987ba ("ixgbe: add initial support for xdp redirect") Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)