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=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable 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 23AEAC4360F for ; Thu, 28 Feb 2019 00:21:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4E8F2171F for ; Thu, 28 Feb 2019 00:21:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="lJq/f7CY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730341AbfB1AVv (ORCPT ); Wed, 27 Feb 2019 19:21:51 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:33786 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728397AbfB1AVu (ORCPT ); Wed, 27 Feb 2019 19:21:50 -0500 Received: by mail-qt1-f193.google.com with SMTP id z39so21604879qtz.0 for ; Wed, 27 Feb 2019 16:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=fs/bu37Mcw+d3VzDjg4phEfm3v6ipkkIUnTmELwpZxQ=; b=lJq/f7CYsaUw/If5sAeCaimB3kylOER64aANv+kN3VDOsrz1pcakMR+H+P7cHy21Cd 6V1P3Dx/DsorQ2fbTljHoK7AD0k2sty6wslmvkR/LWvHAUPzy2ghCInEmAJcgqNByCdU t0cmEztTE59tjQ5115CRCNA1ktM1DL2YAMS5uAAnEoTiW9MnoHaA2nAdclGrOIiEsBDZ 0HJviO0r+GXLM1AXEq4hpMrUiohuQVg0VxXHFgIip4roow1sY3kB7Im01AgH2WGHJpI5 FK2uL8XWNSxiLPBGxSs7BAjRD+i9ri4PN3a8xmsRFGNvBkpM4SNCsmVpma2w2pL5EW5b +3aw== 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:organization:mime-version:content-transfer-encoding; bh=fs/bu37Mcw+d3VzDjg4phEfm3v6ipkkIUnTmELwpZxQ=; b=Oh4elu4agfDPbHhyeIZ08+KzmDVNTKRyrsuI/dq9pIKQWIoKmSeRIxMOVKLhpLSR/m wNx+SS+jE9rOJZUy4RH9OwDFo57qnaYyqyhxAy4flXWKv8viapYPk+Kt3N3PX1OAleCv RDL/AsBt2/QWfaqb+wE0Ke3KdrLDnzuhga7jUCCkQDjxQ55lTxv0+VPfcQuYrliqzQ6j pZTl8tWDDkxwT2chf7paLnaJo/j3mlrfZUHnIq/3A+CvbOETtIGdR2tHRpJstVDi1IeR w1+HMLc4nK9qT4eGXnp1WwvTm9EdrRJngIAzNbRNyZhbSVpWLzO1ROkzvELg67IJZg8r 25FQ== X-Gm-Message-State: APjAAAUxriPv6fKYZ2XDA+hB+3u80htCr/hanSGeJn6SYbgfHrdcDOBj HcwG9vcJploZxukv0DeCwDdRFg== X-Google-Smtp-Source: APXvYqyMDxMRC/ukpI50r/SUkepN7cW8LyrNlFlDoCNAKooftX6RD1APjICAc1mgcfGJxC4YKCtIew== X-Received: by 2002:a0c:9802:: with SMTP id c2mr4227037qvd.13.1551313309627; Wed, 27 Feb 2019 16:21:49 -0800 (PST) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id b50sm7665909qtk.50.2019.02.27.16.21.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 16:21:49 -0800 (PST) Date: Wed, 27 Feb 2019 16:21:44 -0800 From: Jakub Kicinski To: Andrii Nakryiko Cc: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org, bpf@vger.kernel.org, oss-drivers@netronome.com Subject: Re: [PATCH bpf-next 4/5] samples: bpf: use libbpf where easy Message-ID: <20190227162144.43273307@cakuba.netronome.com> In-Reply-To: References: <20190227233046.11718-1-jakub.kicinski@netronome.com> <20190227233046.11718-5-jakub.kicinski@netronome.com> Organization: Netronome Systems, Ltd. 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 Wed, 27 Feb 2019 16:05:45 -0800, Andrii Nakryiko wrote: > > if (object) { > > - assert(!load_bpf_file((char *)object)); > > - return prog_fd[0]; > > + assert(!bpf_prog_load(object, 0, &obj, &prog_fd)); > > Here and in few more places below: is it possible to specify correct > bpf_prog_type instead of 0? Some of them yes, some of them no. There are objects with multiple program types IIRC. This program type argument is only used for checking if kernel versions are needed, and they are provided in samples so it doesn't matter. I'll try to add where possible.