From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EEF3C282D8 for ; Fri, 1 Feb 2019 07:02:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFEC620869 for ; Fri, 1 Feb 2019 07:02:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbfBAHCp (ORCPT ); Fri, 1 Feb 2019 02:02:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45680 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbfBAHCp (ORCPT ); Fri, 1 Feb 2019 02:02:45 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83AC2CF481; Fri, 1 Feb 2019 07:02:44 +0000 (UTC) Received: from localhost (ovpn-200-36.brq.redhat.com [10.40.200.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 574595D9D1; Fri, 1 Feb 2019 07:02:38 +0000 (UTC) Date: Fri, 1 Feb 2019 08:02:36 +0100 From: Jesper Dangaard Brouer To: Jakub Kicinski Cc: daniel@iogearbox.net, ast@kernel.org, David Miller , Maciej Fijalkowski , netdev@vger.kernel.org, john.fastabend@gmail.com, David Ahern , brouer@redhat.com, Saeed Mahameed Subject: Co-existing XDP generic and native mode? (Re: [PATCH bpf-next v5 5/8] xdp: Provide extack messages when prog attachment failed) Message-ID: <20190201080236.446d84d4@redhat.com> In-Reply-To: <20190131191101.2e9dc9f6@cakuba.hsd1.ca.comcast.net> References: <20190201001954.4130-1-maciej.fijalkowski@intel.com> <20190201001954.4130-6-maciej.fijalkowski@intel.com> <20190131191101.2e9dc9f6@cakuba.hsd1.ca.comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 01 Feb 2019 07:02:44 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 31 Jan 2019 19:11:01 -0800 Jakub Kicinski wrote: > On Fri, 1 Feb 2019 01:19:51 +0100, Maciej Fijalkowski wrote: > > if (__dev_xdp_query(dev, bpf_chk, XDP_QUERY_PROG) || > > - __dev_xdp_query(dev, bpf_chk, XDP_QUERY_PROG_HW)) > > + __dev_xdp_query(dev, bpf_chk, XDP_QUERY_PROG_HW)) { > > + NL_SET_ERR_MSG(extack, "native and generic XDP can't be active at the same time"); > > return -EEXIST; > > + } > > This reminds me, since we allowed native/driver and offloaded XDP > programs to coexist in a25717d2b604 ("xdp: support simultaneous > driver and hw XDP attachment") I got an internal feature request > to also allow generic and native mode. Would anyone object to that? Well, I will object ;-) I have two refactor ideas [1] and [2], that depend on not allowing XDP-native and XDP-generic to co-exist. The general idea is to let XDP-native use the same fields in net_device->rx[] as XDP-generic given they (currently) cannot co-exist. The goal is (1) to move stuff out of driver code, and (2) hopefully make it easier to implement per RXq XDP progs. These are only refactor ideas, so if you can argue why your internal feature request for simultaneous generic and native make more sense, then I'm open for allowing this ? [1] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp_per_rxq01.org#refactor-idea-move-xdp_rxq_info-to-net_devicenetdev_rx_queue [2] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp_per_rxq01.org#refactor-idea-xdpbpf_prog-into-netdev_rx_queuenet_device > Apart from a touch up to test_offload.py I don't think anything > would care. netlink can already carry multiple IDs, iproute2 > understands it, too.. And we did notice you added support for HW+native: [3] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp_per_rxq01.org -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer