From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38730 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754923AbeCSKLE (ORCPT ); Mon, 19 Mar 2018 06:11:04 -0400 Date: Mon, 19 Mar 2018 11:10:57 +0100 From: Jesper Dangaard Brouer To: Jason Wang Cc: netdev@vger.kernel.org, =?UTF-8?B?QmrDtnJuVMO2cGVs?= , magnus.karlsson@intel.com, eugenia@mellanox.com, John Fastabend , Eran Ben Elisha , Saeed Mahameed , galp@mellanox.com, Daniel Borkmann , Alexei Starovoitov , Tariq Toukan , brouer@redhat.com Subject: Re: [bpf-next V3 PATCH 00/15] XDP redirect memory return API Message-ID: <20180319111057.12d3ee71@redhat.com> In-Reply-To: <0cb14140-5632-8b07-9088-2adb7dfedc0b@redhat.com> References: <152062887576.27458.8590966896888512270.stgit@firesoul> <0cb14140-5632-8b07-9088-2adb7dfedc0b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 16 Mar 2018 17:04:17 +0800 Jason Wang wrote: > Looks like the series forget to register memory model for tun and > virtio-net. Well, no. It is actually not strictly necessary to invoke xdp_rxq_info_reg_mem_model() because enum MEM_TYPE_PAGE_SHARED == 0. And if not passing an allocator pointer to the call, then an mem_id is not registered... and __xdp_return_frame() skips the rhashtable_lookup. I designed the API this way, because I want to support later adding an allocator even for the refcnt scheme MEM_TYPE_PAGE_SHARED. (As it would be a performance optimization to return the pages to the originating RX-CPU, and move the page refcnt dec back to that orig CPU). I did add an xdp_rxq_info_reg_mem_model() call to ixgbe, for human programmer "documentation" even-though it isn't strickly necessary. I guess, I could add similar calls to tun and virtio_net, and then we avoid any implicit assumptions. And makes it more clear that XDP_REDIRECT support use the memory model return API. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer