From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59898 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751815AbeB0CZm (ORCPT ); Mon, 26 Feb 2018 21:25:42 -0500 Subject: Re: [net PATCH 1/4] virtio_net: disable XDP_REDIRECT in receive_mergeable() case To: "Michael S. Tsirkin" , Jesper Dangaard Brouer Cc: netdev@vger.kernel.org, John Fastabend , Alexei Starovoitov , Saeed Mahameed , Daniel Borkmann , "David S. Miller" , Tariq Toukan References: <151913348634.28247.17519468037896960567.stgit@firesoul> <151913352486.28247.12339812865877070160.stgit@firesoul> <20180227023529-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: <86ea9887-0ea2-1f58-7710-26d4d126a76d@redhat.com> Date: Tue, 27 Feb 2018 10:25:30 +0800 MIME-Version: 1.0 In-Reply-To: <20180227023529-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 2018年02月27日 08:40, Michael S. Tsirkin wrote: >> IMHO we should consider NOT supporting XDP in receive_mergeable() at >> all, because the principles behind XDP are to gain speed by (1) code >> simplicity, (2) sacrificing memory and (3) where possible moving >> runtime checks to setup time. These principles are clearly being >> violated in receive_mergeable(), that e.g. runtime track average >> buffer size to save memory consumption. >> >> In the longer run, we should consider introducing a separate receive >> function when attaching an XDP program, and also change the memory >> model to be compatible with XDP when attaching an XDP prog. > I agree with a separate function approach. > > So each buffer is tagged as xdp/non xdp, we check that > and handle appropriately - where non xdp could be handled > by the generic path. If we want to have separated function, should we do it for all XDP capable drivers instead of virtio-net only? Thanks