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=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 9CC27C282D7 for ; Wed, 30 Jan 2019 18:13:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A26D20870 for ; Wed, 30 Jan 2019 18:13:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UK/1G7sX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732837AbfA3SNF (ORCPT ); Wed, 30 Jan 2019 13:13:05 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43761 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbfA3SNF (ORCPT ); Wed, 30 Jan 2019 13:13:05 -0500 Received: by mail-pf1-f195.google.com with SMTP id w73so172085pfk.10 for ; Wed, 30 Jan 2019 10:13:04 -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=Mm7fGgeyXUrsaGSfYHuIQjI5cRZzCc2fx8McB/R8VNI=; b=UK/1G7sXkiWDt8lWJkXARBZNsXRjv/8pX8u4Js8iTwlTu865PuBqWVV6gHmC8X+XIN 7+ZkKF+wPD0pXGaDUJqbZFnX84BHnSPG9HZ8NYH1QOZpZGcCl5SZtYc9f5ZwSAignow2 oMJkcvLyoMQC5ioRu+Fk3QUmak5tRi5YEcap2XHKG0sme9qDvSl9DV30brjB2Wa/zBs6 9Rx56PSVRksXafAAZENt+iTiB62ekyUfOzpH4+9mW5FqD5due8GABqYMrGlAxf4IhJx8 DDQ9tL32KnvnWl/C5VbSmRsaKnHGfGMYE0bUy2CTpGJfwQM3ANw9dv20n91pF3DSJrEY Fa8g== 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=Mm7fGgeyXUrsaGSfYHuIQjI5cRZzCc2fx8McB/R8VNI=; b=jcKGEmcko5ROipQJj8LprVPdJzusXBCAX3JQWPwGy7hfqW4qCRh3xPhSirK9ZOye6I 02oKKHN8xUnMt2hYBxl6JRySjP8R/+acnFw/vIB50hsWzc8Jvzn/2mdx2J5IBjug0bIA J5q22XszCQnyaCQz7bEopV6EqWWO9iyXmai5QJFxrkAwwWmilYbOmGOQySdnc56G/U4M lcAoHGFPujS7GpR8YQvYazUvhqpEGQNobApqPw+zSBFs/7fdECsM2Mq6UB7hD5isP2Dw QZdQ1tC7MvkvcSc2acuL2UIs4/5assBT4GFeMVNrTjAlOSGot+rg9u7WWJQZM68NiFvn Ru/Q== X-Gm-Message-State: AJcUuke/dSobvOyNWXVdD1xR6wy96VcLmPODaM7RJSZ0oPJUkOtB94ca QVMWbeVvUJqhCvUnOx3Q5kM7hkHpjdA= X-Google-Smtp-Source: AHgI3IZjkz2N4SaVVlaylxjNUtGzfi5aZj+YCOxWV0GT4lPai4O8o8hZX4q44x5jRTbyuPHo+du88w== X-Received: by 2002:a62:4618:: with SMTP id t24mr14180447pfa.139.1548871984269; Wed, 30 Jan 2019 10:13:04 -0800 (PST) Received: from localhost (fmdmzpr03-ext.fm.intel.com. [192.55.54.38]) by smtp.gmail.com with ESMTPSA id n73sm3310096pfj.148.2019.01.30.10.13.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Jan 2019 10:13:04 -0800 (PST) Date: Wed, 30 Jan 2019 19:12:48 +0100 From: Maciej Fijalkowski To: Jesper Dangaard Brouer Cc: daniel@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org, jakub.kicinski@netronome.com Subject: Re: [PATCH bpf-next v4 5/7] samples/bpf: Add a "force" flag to XDP samples Message-ID: <20190130191248.00000167@gmail.com> In-Reply-To: <20190129123405.787746f7@redhat.com> References: <20190128191613.11705-1-maciejromanfijalkowski@gmail.com> <20190128191613.11705-6-maciejromanfijalkowski@gmail.com> <20190129090000.3c34b873@redhat.com> <20190129123405.787746f7@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=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 29 Jan 2019 12:34:05 +0100 Jesper Dangaard Brouer wrote: > On Tue, 29 Jan 2019 09:00:00 +0100 > Jesper Dangaard Brouer wrote: > > > On Mon, 28 Jan 2019 20:16:11 +0100 > > Maciej Fijalkowski wrote: > > > > > From: Maciej Fijalkowski > > > > > > Make xdp samples consistent with iproute2 behavior and set the > > > XDP_FLAGS_UPDATE_IF_NOEXIST by default when setting the xdp program on > > > interface. Provide an option for user to force the program loading, > > > which as a result will not include the mentioned flag in > > > bpf_set_link_xdp_fd call. > > > > I like the idea, but what is the error message users get after this > > change? > > $ sudo ./xdp1 mlx5p1 & > [1] 9768 > > $ sudo ./xdp1 mlx5p1 > link set xdp fd failed > > This error message is a little too generic to be a good user experience. > The kernel (in dev_change_xdp_fd) will return errno -EBUSY (-16), but > we don't use or report the return value in these sample programs. > > If my QA see this error message, I will still get an error report > bugzilla that I need to spend time on investigating. Can we please > improve this error message? > > If you are really cool you get inspired by (or use) libbpf_strerror() > code avail in tools/lib/bpf/libbpf_errno.c. Default strerror(EBUSY) > will return "Device or resource busy", but maybe we can do slightly > better and report something more meaningful for this XDP context. > I'll post a v5 with libbpf_strerror() usage when bpf_set_link_xdp_fd failed in samples but at this point it will only give us a standard "device or resource busy" error, so if we need some more meaningful message that libbpf will give us then I guess we need to define a new libbpf_errno entry (as well as entry in libbpf_strerror_table for this new errno value) and set the errno in bpf_set_link_xdp_fd in case of a failure?