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.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 DF2D4C43381 for ; Thu, 21 Feb 2019 16:31:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD6A42084D for ; Thu, 21 Feb 2019 16:31:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KZO0ivCJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727253AbfBUQbJ (ORCPT ); Thu, 21 Feb 2019 11:31:09 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43701 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfBUQbJ (ORCPT ); Thu, 21 Feb 2019 11:31:09 -0500 Received: by mail-pl1-f196.google.com with SMTP id m10so4758500plt.10 for ; Thu, 21 Feb 2019 08:31:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YhrWvDH5YRxJfzyQ4fFb0vT6jA4v4Y2ZxyrPTXF1W8Y=; b=KZO0ivCJ2meyhGCEG0VRPEUNpbGvA+T65lY9yusapOZSLP04xzFiVOeZqxbzx0fG9R cSt10nPAo6owfnxWow02eDsIQhpeuvbzgMud1GucUVnqtWt8kKKowcDEIm2Dehq/5fpd SD0+N1KG1fBAjs74JAlSiNPIYDV+hqV5OpMggyip44m2K3bV7bgeulav74n1gB5Z/6tt Qu3OtzCs1rcLpNA4fZkc/f4OPO2EWj7OmGLPSuZaEokiLpBbkxw5e+tKCY/Z9Xi45eUG oHe2kf91PceCuATfYyGYEkSgtNk35tSc9ebmQ9ksnghweRHA0LyYcutGxD6D/kF6hg8v dI5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YhrWvDH5YRxJfzyQ4fFb0vT6jA4v4Y2ZxyrPTXF1W8Y=; b=ARLm4aMVi6BOuhEByrM/q8vXBCkiFQgaUkMJ6RUIar29eQtQda7SaWcYa3otZfyw0S XAtBCfFZA7bev4KGWcL3sAV4cvsBZ3FGeJkFeQZG/dR/vuEyiNYTJoDtGNuhEAyRMjzO 3tdeMcCz32fYpcuEv/i0jULD/4xGc/aKNpDP/1gD3KASWpzp17Ps2c3j1LR/J9qnIH9D dLEApVTqIahDQLWA5WmyZbxM18mjt07HQY2AHv3HXhXNQSskUt8R3tSn7Kqemh1Y9KWo SdrxT+sNTY2rx/iYL48B39W8dDb5P/sJxK1ygPF3c87CiNAc9kroTlD86pIT0sWX9f8g OJPg== X-Gm-Message-State: AHQUAub+sMl5bPrGm5/vH+nWzEBY80N/f6wwdQuTIXnTzXmlQB5M8jq8 nbt87jVoQK1DXF/Ywq1ASuI= X-Google-Smtp-Source: AHgI3IbcZ84E2A0/6pjL6x5bLFULSJCRZxd6WuEB0xL+F9AYOLuJSawy61VUy1RyXK3y/l+Bk+qVxQ== X-Received: by 2002:a17:902:147:: with SMTP id 65mr43621590plb.116.1550766667534; Thu, 21 Feb 2019 08:31:07 -0800 (PST) Received: from localhost ([192.55.54.41]) by smtp.gmail.com with ESMTPSA id l12sm26665990pgn.83.2019.02.21.08.31.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Feb 2019 08:31:07 -0800 (PST) Date: Thu, 21 Feb 2019 17:30:54 +0100 From: Maciej Fijalkowski To: Toke =?ISO-8859-1?Q?H=F8iland-J=F8rgensen?= Cc: netdev@vger.kernel.org Subject: Re: [PATCH] samples/bpf: Fix dummy program unloading for xdp_redirect samples Message-ID: <20190221173054.00006df2@gmail.com> In-Reply-To: <20190221160539.32132-1-toke@redhat.com> References: <20190221160539.32132-1-toke@redhat.com> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 21 Feb 2019 17:05:39 +0100 Toke H=F8iland-J=F8rgensen wrote: > The xdp_redirect and xdp_redirect_map sample programs both load a dummy > program onto the egress interfaces. However, the unload code checks these > programs against the wrong fd number, and thus refuses to unload them. Fix > the comparison to avoid this. >=20 > Fixes: 3b7a8ec2dec3 ("samples/bpf: Check the prog id before exiting") > Signed-off-by: Toke H=F8iland-J=F8rgensen > --- > samples/bpf/xdp_redirect_map_user.c | 2 +- > samples/bpf/xdp_redirect_user.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/samples/bpf/xdp_redirect_map_user.c b/samples/bpf/xdp_redire= ct_map_user.c > index 327226be5a06..1dbe7fd3a1a8 100644 > --- a/samples/bpf/xdp_redirect_map_user.c > +++ b/samples/bpf/xdp_redirect_map_user.c > @@ -57,7 +57,7 @@ static void int_exit(int sig) > printf("bpf_get_link_xdp_id failed\n"); > exit(1); > } > - if (prog_id =3D=3D curr_prog_id) > + if (dummy_prog_id =3D=3D curr_prog_id) > bpf_set_link_xdp_fd(ifindex_out, -1, xdp_flags); > else if (!curr_prog_id) > printf("couldn't find a prog id on iface OUT\n"); > diff --git a/samples/bpf/xdp_redirect_user.c b/samples/bpf/xdp_redirect_u= ser.c > index a5d8ad3129ed..e9054c0269ff 100644 > --- a/samples/bpf/xdp_redirect_user.c > +++ b/samples/bpf/xdp_redirect_user.c > @@ -57,7 +57,7 @@ static void int_exit(int sig) > printf("bpf_get_link_xdp_id failed\n"); > exit(1); > } > - if (prog_id =3D=3D curr_prog_id) > + if (dummy_prog_id =3D=3D curr_prog_id) > bpf_set_link_xdp_fd(ifindex_out, -1, xdp_flags); > else if (!curr_prog_id) > printf("couldn't find a prog id on iface OUT\n"); It seems that I confused this in last version of patchset...my bad. Acked-by: Maciej Fijalkowski