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=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 14BDAC169C4 for ; Tue, 29 Jan 2019 11:34:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DBC4520844 for ; Tue, 29 Jan 2019 11:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727962AbfA2LeM (ORCPT ); Tue, 29 Jan 2019 06:34:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7196 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbfA2LeM (ORCPT ); Tue, 29 Jan 2019 06:34:12 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F002C0578F8; Tue, 29 Jan 2019 11:34:12 +0000 (UTC) Received: from localhost (ovpn-200-36.brq.redhat.com [10.40.200.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 212E85D73F; Tue, 29 Jan 2019 11:34:06 +0000 (UTC) Date: Tue, 29 Jan 2019 12:34:05 +0100 From: Jesper Dangaard Brouer To: Maciej Fijalkowski Cc: daniel@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org, jakub.kicinski@netronome.com, brouer@redhat.com Subject: Re: [PATCH bpf-next v4 5/7] samples/bpf: Add a "force" flag to XDP samples Message-ID: <20190129123405.787746f7@redhat.com> In-Reply-To: <20190129090000.3c34b873@redhat.com> References: <20190128191613.11705-1-maciejromanfijalkowski@gmail.com> <20190128191613.11705-6-maciejromanfijalkowski@gmail.com> <20190129090000.3c34b873@redhat.com> 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 29 Jan 2019 11:34:12 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer