From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [net PATCH] Revert "net: thunderx: Add support for xdp redirect" Date: Wed, 14 Feb 2018 09:49:15 +0100 Message-ID: <20180214094915.10fc6c36@redhat.com> References: <151854116184.18303.13476104443853509134.stgit@firesoul> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Linux Netdev List , Sunil Goutham , Aleksey Makarov , "David S. Miller" , Christina Jacob , Daniel Borkmann , Alexei Starovoitov , LAKML , brouer@redhat.com, =?UTF-8?B?Qmo=?= =?UTF-8?B?w7ZybiBUw7ZwZWw=?= , "Karlsson, Magnus" To: Sunil Kovvuri Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46990 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754404AbeBNItW (ORCPT ); Wed, 14 Feb 2018 03:49:22 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 14 Feb 2018 01:05:16 +0530 Sunil Kovvuri wrote: > On Tue, Feb 13, 2018 at 10:29 PM, Jesper Dangaard Brouer > wrote: > > This reverts commit aa136d0c82fcd6af14535853c30e219e02b2692d. > > > > As I previously[1] pointed out this implementation of XDP_REDIRECT is > > wrong. XDP_REDIRECT is a facility that must work between different > > NIC drivers. Another NIC driver can call ndo_xdp_xmit/nicvf_xdp_xmit, > > but your driver patch assumes payload data (at top of page) will > > contain a queue index and a DMA addr, this is not true and worse will > > likely contain garbage. > > > > Given you have not fixed this in due time (just reached v4.16-rc1), > > the only option I see is a revert. > > Sorry that i missed your email ie didn't respond. > > This driver is not for a generic PCI endpoint NIC, it's an on-silicon > ethernet device found only on Cavium's ThunderX or OCTEONTX SOCs > which supports upto 16 ports. XDP_REDIRECT here is mainly aimed at > forwarding packets from one port to another > port of same type. > > The only way I could have avoided the payload data is by unmapping > and remapping of DMA buffer which is quite expensive especially when > IOMMU is enabled. So I thought this small optimization should be > acceptable. It is good that you bring up the need to avoid this DMA unmap+remap issue, but we need to solve this in a generic way, as all drivers would/should benefit from this optimization. > If you still think that this shouldn't be done this way then go ahead > and revert the patch, > I will try to redo this as and when i find time. Yes, please revert. In connection with AF_XDP we need to improve/adjust the ndo_xdp_xmit API. We/I will try to incorporate the DMA mapping avoidance into the API design. Then it should hopefully be easier to redo this patch later. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer