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=-10.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 C2BBDC282C3 for ; Fri, 25 Jan 2019 00:41:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E6E9218D2 for ; Fri, 25 Jan 2019 00:41:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="f+NA2Rsh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbfAYAlY (ORCPT ); Thu, 24 Jan 2019 19:41:24 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:37516 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbfAYAlY (ORCPT ); Thu, 24 Jan 2019 19:41:24 -0500 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0P0Zmvf008124 for ; Thu, 24 Jan 2019 16:41:23 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=Al/SoL83602FjOOkqT1G4X8pQn464gXi2MWKlQ1Jzxk=; b=f+NA2Rsh5/MdCDL4Mx2WAP/OADh7AZ1PUDHlFOrWaglFMHMYjgW/05H8e+j4a4TLTMuC cIGX/5JiJyeybDObvSSwYHVkGWoBtY9SJthoRxmvAqocFe7wXDa8fS6u1N1dhRWfQQ98 ETgXO8ekkYjbJUVqHdyox8jYY90vhYecP28= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2q7p980byu-20 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 24 Jan 2019 16:41:23 -0800 Received: from mx-out.facebook.com (2620:10d:c0a1:3::13) by mail.thefacebook.com (2620:10d:c021:18::173) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1531.3; Thu, 24 Jan 2019 16:41:09 -0800 Received: by devbig003.ftw2.facebook.com (Postfix, from userid 128203) id D13DC3702902; Thu, 24 Jan 2019 16:41:07 -0800 (PST) Smtp-Origin-Hostprefix: devbig From: Yonghong Song Smtp-Origin-Hostname: devbig003.ftw2.facebook.com To: , , , CC: Smtp-Origin-Cluster: ftw2c04 Subject: [PATCH iproute2] bpf: add btf func and func_proto kind support Date: Thu, 24 Jan 2019 16:41:07 -0800 Message-ID: <20190125004107.3075254-1-yhs@fb.com> X-Mailer: git-send-email 2.17.1 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-24_15:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The issue is discovered for bpf selftest test_skb_cgroup.sh. Currently we have, $ ./test_skb_cgroup_id.sh Wait for testing link-local IP to become available ... OK Object has unknown BTF type: 13! [PASS] In the above the BTF type 13 refers to BTF kind BTF_KIND_FUNC_PROTO. This patch added support of BTF_KIND_FUNC_PROTO and BTF_KIND_FUNC during type parsing. With this patch, I got $ ./test_skb_cgroup_id.sh Wait for testing link-local IP to become available ... OK [PASS] Signed-off-by: Yonghong Song --- lib/bpf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/bpf.c b/lib/bpf.c index 5e85cfc0..762f8857 100644 --- a/lib/bpf.c +++ b/lib/bpf.c @@ -2193,12 +2193,16 @@ static int bpf_btf_prep_type_data(struct bpf_elf_ctx *ctx) case BTF_KIND_ENUM: type_cur += var_len * sizeof(struct btf_enum); break; + case BTF_KIND_FUNC_PROTO: + type_cur += var_len * sizeof(struct btf_param); + break; case BTF_KIND_TYPEDEF: case BTF_KIND_PTR: case BTF_KIND_FWD: case BTF_KIND_VOLATILE: case BTF_KIND_CONST: case BTF_KIND_RESTRICT: + case BTF_KIND_FUNC: break; default: fprintf(stderr, "Object has unknown BTF type: %u!\n", kind); -- 2.17.1