Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp120229ybg; Mon, 8 Jun 2020 18:10:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxZJq49YWO0M+Cu5uokwSBWcI8SjwPqnPbZYEbQ49pSdAEQAeRXwWN8bFWJkqLyrOEPD4n X-Received: by 2002:a17:906:fc1a:: with SMTP id ov26mr22825664ejb.226.1591665031992; Mon, 08 Jun 2020 18:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591665031; cv=none; d=google.com; s=arc-20160816; b=mmKyQgi1xSiaj+v/prra2G7JMRcv0QtBGOFVTnIiGZJ7/blN1jhUwYhj1RM946EChN o+5oyjZlbE58tfkszFC10X8sVHX7B04eiaDDSiCwzVqf+dsVpwUJorls21x28R3gHO6Y pHgi0/N9jf8RxNPt7cv5O5RAFxFKkyRz0/9P74jwYGM+mUhIpYuSEwxCzacYFeEAZS6K sjbJbgz0LT/nNeNrNQ0xTOfMEJ841MV54zKdQCXCOwBM9texZf+S6NBGWJCvoQJR9CCJ ouF/k7M6XE8H6akcL1rN6Ix9dZybYpqIl2ag5eD8JGabhEHeTXZN1HlWnJ4G89WrtnJB P9kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iwkA3sw6iiAaiGUYQJifAGDAvNaWQZS+1r38/LWIVcU=; b=gfPju1AiY6+TM3ImQ6QjHfC67l9te/QxrIU2kma592Clxxj915qYvfLLsjWvcIaIFD ppI6wGemGpVQGF7sR9XWqH6jsaNpSwjx2KukzhuVyiWkQ4En5tdC32y4WBs3/1Y8Frct 3t9nBva0TmOMKBrrmtpfz4HBg7h7vSW8M/Ur+S5/YGcJ0uX40GpkryIwv4cu/jynIoHR /MxodODzJMXNtdFW+QCDdZlSR/Bya7FhgIjLH472MwHEcpjfnFHNgqsvju8Xu670uf/M aHx1PD2P9SbGijGzpE/1ONe5mH8CL+70WKfRNhUF+BYJQ0VSHz6bkIlt06KWCQPv4HNi +KlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=atsd5W3f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si9895088edt.9.2020.06.08.18.10.08; Mon, 08 Jun 2020 18:10:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=atsd5W3f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730117AbgFIBG3 (ORCPT + 99 others); Mon, 8 Jun 2020 21:06:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:50942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727811AbgFHXHJ (ORCPT ); Mon, 8 Jun 2020 19:07:09 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 150E620823; Mon, 8 Jun 2020 23:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657629; bh=r2ZD/z74CHUpWNLziOf1yJLE0NiqYpuEhktxmoHnFwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=atsd5W3fOooIvGAn7Ii+ey0UKWoK/4lMyzkazsdqqTUV7NxofNf2QRzjhqu6MQ5ea yppIJV5DEG9yd2R5dQE2ojqX0eGi2AqgLjXd45dx8VmLNF5re61l9R2lRBVny26TeC gFI0y2zFjAG87yNfwgQx0j6WV/pBUIflUsFN/k3k= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jesper Dangaard Brouer , Alexei Starovoitov , Jeff Kirsher , Sasha Levin , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 048/274] ixgbe: Fix XDP redirect on archs with PAGE_SIZE above 4K Date: Mon, 8 Jun 2020 19:02:21 -0400 Message-Id: <20200608230607.3361041-48-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jesper Dangaard Brouer [ Upstream commit 88eb0ee17b2ece64fcf6689a4557a5c2e7a89c4b ] 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") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Cc: Jeff Kirsher Link: https://lore.kernel.org/bpf/158945344946.97035.17031588499266605743.stgit@firesoul Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.25.1