Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3487704pxf; Mon, 29 Mar 2021 03:44:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjbXgRZ5flheOnbMnzxYym3vx8pRlR1fJOrNXV7P30ajjIOCLwLly7++StoqzJ7FWa0rXv X-Received: by 2002:a17:907:3e12:: with SMTP id hp18mr27554708ejc.366.1617014678069; Mon, 29 Mar 2021 03:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617014678; cv=none; d=google.com; s=arc-20160816; b=wMh0Qo9WHSp48QbjTdoXOwdNSpr6R8V9QEeZzu4SmUDcDIMdlgZYMypiV9S6UcTdFv VIiwfHCyBq2k1+9OThLjC6geOFM+l8rJWa9BgiYwTvj8vZHEnngluIPVSbMeDa4z4dim +zdmnqLUmgJ2+QBPMJlZVh4g7m+7k20lpbIyVd8/pipRI2X3GjI2DV58faYeaWeB5llb TACPdZtMh1vS2ioEixUDMMz1+PuIN6hSuNL27dL/vP6pQmxIUc4B6DzFC/51i4R0E4Sp y1BhKH9V0G8OQ+k94v/u4Z80r4bjHo1HvAzAOptUccAF1zNua3nexePe8sPuWyrezmQO P63w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=12tqo5PcrT1xuRhYiaYgcMbaZRp3u7HNBMlTJ+647vI=; b=cPYDLNCYPdsfbDOWjzd8QBPWSkukWRBMdMj88vfpcvsyTDTrWbXawR1YD6S99qPNQm gnRUYRzdfWk5FN/Q0MYFm23KMQR0pduXtGPfSTQ4jsxxYPk+Hb3sOZ63o5+8KKwxVOW6 O36fpsAyxPFLdLmfCGOpYRpfnhQFGZozJaIV8YgnlM6cS1VSVyicOiBQKm44/jWblfBT a2uCBPo57fE7f3f0MFz61ObWrCx56HP0DFzSvr4Si9SRlS7tNLOEyweOlLumHJSFqYGj xf4M8/YlCM/fHzSedEEtKuHF4JbbBg8V5vbTjrCTJHGfPQCSSLGDDnW5vdTM+w5wtUDn Cs7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V3UL0UQZ; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp18si12654721ejc.432.2021.03.29.03.44.15; Mon, 29 Mar 2021 03:44:38 -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=@linuxfoundation.org header.s=korg header.b=V3UL0UQZ; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234571AbhC2IdT (ORCPT + 99 others); Mon, 29 Mar 2021 04:33:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:37726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232884AbhC2IUi (ORCPT ); Mon, 29 Mar 2021 04:20:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D335861580; Mon, 29 Mar 2021 08:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006038; bh=mbIcklrKa9uyC5TkTIfMY6FQFk9sK8UD1psPnJ36iqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3UL0UQZjytfXeGT7W2jgyDX/wDII0Fl2iaVCkFS/NkodYTIy6x4G72YlaArp5T+v Oqx35IpdXpkKINmO2xztJ2ZfhGsFPV84OBSROSDAKMa4+qU3QbDqZI3RpRayQUBCI/ iuaorSQ/FAHcO5QHlf8y2zZq7RSHx4mz7CjMa4BI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maciej Fijalkowski , Daniel Borkmann , Toshiaki Makita , Sasha Levin Subject: [PATCH 5.10 094/221] veth: Store queue_mapping independently of XDP prog presence Date: Mon, 29 Mar 2021 09:57:05 +0200 Message-Id: <20210329075632.340556167@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maciej Fijalkowski [ Upstream commit edbea922025169c0e5cdca5ebf7bf5374cc5566c ] Currently, veth_xmit() would call the skb_record_rx_queue() only when there is XDP program loaded on peer interface in native mode. If peer has XDP prog in generic mode, then netif_receive_generic_xdp() has a call to netif_get_rxqueue(skb), so for multi-queue veth it will not be possible to grab a correct rxq. To fix that, store queue_mapping independently of XDP prog presence on peer interface. Fixes: 638264dc9022 ("veth: Support per queue XDP ring") Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Toshiaki Makita Link: https://lore.kernel.org/bpf/20210303152903.11172-1-maciej.fijalkowski@intel.com Signed-off-by: Sasha Levin --- drivers/net/veth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 8c737668008a..be18b243642f 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -301,8 +301,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) if (rxq < rcv->real_num_rx_queues) { rq = &rcv_priv->rq[rxq]; rcv_xdp = rcu_access_pointer(rq->xdp_prog); - if (rcv_xdp) - skb_record_rx_queue(skb, rxq); + skb_record_rx_queue(skb, rxq); } skb_tx_timestamp(skb); -- 2.30.1