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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 99F01C282DD for ; Fri, 10 Jan 2020 15:57:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DAFA2080D for ; Fri, 10 Jan 2020 15:57:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gIMEqcL6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728410AbgAJP5J (ORCPT ); Fri, 10 Jan 2020 10:57:09 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:47331 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728363AbgAJP5J (ORCPT ); Fri, 10 Jan 2020 10:57:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578671828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/RcvD6FKueQJNLgQiUovViahlrs5OaZtZ56HWTd/Suk=; b=gIMEqcL6M4uCvjHPMRGmwOktZMmL4APdco6O+bonx3BSFYkUvsfbQXM5czBux75DLVYK/6 xTfmvM8GTbK2Ur0roIDX4o1UQ9Mf8OzeUuSGX7XW3NL8hsqp6JX8PU5nDivzj2oiwVUOyZ lUw/qxrlBQBfhVQSd2gyQ52ssjl4Tt4= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-120-j1BJhNxYNNiIN3GmXhqukg-1; Fri, 10 Jan 2020 10:57:05 -0500 X-MC-Unique: j1BJhNxYNNiIN3GmXhqukg-1 Received: by mail-wr1-f70.google.com with SMTP id y7so1125671wrm.3 for ; Fri, 10 Jan 2020 07:57:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=/RcvD6FKueQJNLgQiUovViahlrs5OaZtZ56HWTd/Suk=; b=WMT64LDXJLwVdRfv4BuSQ2YIWnbJ1P234FmMPalv38JrCM64SwTlhYdA3IrGy6wheR dww1ORAB7Rh9W3jpAcG6QJJuWjWnFvoGHY5IO0GQUTvdKLgQLtY3Irl4f7Rts9OKOB0d AAxHhFmLvtaxnUx1Rw9Umw/+3SET9fvSoaidaFHchv4e90Fn0dRsk706iRbkPD8psfcW K9H7I62GDU8y2uO/DD2d3uzpqu6ajrDQITvl9EYspLmt9M8voX2xNntVj5ytHKHoyJPN ctDjr+WMIVGrSDl7Ukn/XJ07WhWPDgO6cIWMJPkyr/CILT1bxil4rmuQsic+QE/3eZhE TfTg== X-Gm-Message-State: APjAAAXMfZwP5l16NyAJz1Rqkey5PcFtJZtbvgdkI/CWj0W9cETTlzHi hlm6h4oiBXf4lMNZk2jPDOq1nvtLF5/hmNuv+YKEQeqFrVks8TcGCx9A6BiHMlZFxqfb5zz6+6k wNygBoJqD9xWukDwZ X-Received: by 2002:a1c:23d7:: with SMTP id j206mr4956207wmj.39.1578671824005; Fri, 10 Jan 2020 07:57:04 -0800 (PST) X-Google-Smtp-Source: APXvYqx6aX2tXH6n7HTBJHu9Ug+SiHHxXpcs6670AwkCZsHo0YFHEgeopo2vvyYbmh/lPCoQIXjMqA== X-Received: by 2002:a1c:23d7:: with SMTP id j206mr4956195wmj.39.1578671823852; Fri, 10 Jan 2020 07:57:03 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id i11sm2694838wrs.10.2020.01.10.07.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 07:57:03 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 944EE18009F; Fri, 10 Jan 2020 16:57:02 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Netdev , bpf , Daniel Borkmann , Alexei Starovoitov , David Miller , Jesper Dangaard Brouer , John Fastabend Subject: Re: [PATCH bpf-next 2/2] xdp: Use bulking for non-map XDP_REDIRECT In-Reply-To: References: <157866612174.432695.5077671447287539053.stgit@toke.dk> <157866612392.432695.249078779633883278.stgit@toke.dk> <87d0brxr9u.fsf@toke.dk> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 10 Jan 2020 16:57:02 +0100 Message-ID: <87a76vxq29.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Bj=C3=B6rn T=C3=B6pel writes: > On Fri, 10 Jan 2020 at 16:30, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> >> Bj=C3=B6rn T=C3=B6pel writes: >> > [...] >> > >> > After these changes, does the noinline (commit 47b123ed9e99 ("xdp: >> > split code for map vs non-map redirect")) still make sense? >> >> Hmm, good question. The two code paths are certainly close to one >> another; and I guess they could be consolidated further. >> >> The best case would be if we had a way to lookup the ifindex directly in >> the helper. Do you know if there's a way to get the current net >> namespace from the helper? Can we use current->nsproxy->net_ns in that >> context? >> > > Nope, interrupt context. :-( Another (ugly) way is adding a netns > member to the bpf_redirect_info, that is populated by the driver > (driver changes everywhere -- ick). So no. Yup, that's what I thought. OK, too bad; I'll see what other consolidation I can do with the current code, then. > (And *if* one would go the route of changing all drivers, I think the > percpu bpf_redirect_info should be replaced a by a context that is > passed from the driver to the XDP program execution and > xdp_do_redirect/flush. But that's a much bigger patch. :-)) Yeah, let's leave that until the next time we figure out we have to change all the drivers, then ;) -Toke