Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp966375yba; Thu, 4 Apr 2019 01:17:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwj5/S26C2b9Jn/Nb8Gsj8c6eNQ277rOwutyh+ZMT82W9xqw4dILXiSZxYW17snOU5TnkQ3 X-Received: by 2002:a62:4290:: with SMTP id h16mr4481766pfd.8.1554365840181; Thu, 04 Apr 2019 01:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554365840; cv=none; d=google.com; s=arc-20160816; b=QSjg0yKkikqpc1B3ZkmxkWQWzqyBtSfHeOSouQwOHWAzewa9l85rrsuIgTsWJIqhJR 6dBmbTrO2Vv+e0U+6lyrwIYOTKX678aWOq/qVXf1o1RYE1MFkBIun6Q5wxpvIBPzASUB tDdnSqYUPzMSjPMMAP7atX8kPJaxhyqxQIk9oMboJhbbfzdeCZHGjIaLxSuzjNQ+67Md sz3ce/T3OOH+Yrbm5AqGp9zB60q1SqezFXzkeZJUQFsSNO4YuD0Y7164iwzXji2sD9Ow vK7gBw00jH9YhkVYLrRvALqUBO2ysnJtS/AJnuKuyrKZT33DuUnk0SO59LS0bFOym7az nQNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:mail-followup-to:message-id :subject:cc:to:from:date:dkim-signature; bh=cDaTSDZgwH1tEyxeK1FWu9PQ+2EvkmR6IA94ykP8ez8=; b=q5VsW29jERQ5MV3h2a+hPDMcAqThRkAvPVPhCwi/gGQ5xtYpS6YLc9EMU3aOTMgeJj qSt+I3ckwOJOIRpvj//7++vB4rsbBnaZMcubM3ELeDXBPp712qK1s65fbzJxmV4h3VQy NU1fEVrfFqGUTeuMrBANsgGydgisjvwwITdsdxtgDohz2xVKe688mPHF8gdcds9b0CWf MPFPb8ZqH0oBzBuz4OAFtNM7V2CgKip2SBsqFaMniAz0/bNu0cY+OHKfZMWOhvtNc60X s28HGJei8bGalRwuCAibu82oxGaxhUAuLjiuO4hW568jXrUbrfC3hZIFUvydltK7ubxm OQKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="U8I/KkTB"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si16175535ple.299.2019.04.04.01.17.04; Thu, 04 Apr 2019 01:17:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="U8I/KkTB"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbfDDIQY (ORCPT + 99 others); Thu, 4 Apr 2019 04:16:24 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:35248 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbfDDIQY (ORCPT ); Thu, 4 Apr 2019 04:16:24 -0400 Received: by mail-yw1-f66.google.com with SMTP id d132so656320ywa.2; Thu, 04 Apr 2019 01:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=cDaTSDZgwH1tEyxeK1FWu9PQ+2EvkmR6IA94ykP8ez8=; b=U8I/KkTB7UVhjNfpPCw3GwiL3pdRGT1ZlKaenHOQgoBse9ydTXqf4BFYxJ84DcDype qjU1HGL5cllchRxEBNNnraPuOut+jiGfxBd2Oc6bYnkVLDcOb6t5ABicvoNeUGxgLRvg 9ecZckne18kSHudZvx8pegi7SkdU5GN3hwPjmZndIYVlWdxwFu6ZzsdKwoZx+A/MpZdn 6jHDVa1SQDZSkAwACFoeuEh0D5di1KeIB7s2y5oqHtjVpt4OoFEenM45tL6NmF7DT+bJ W8ezQ8wy18EwLWA6Jvi5PqARmtpViTNj4yjcTPzGcdkd72JOlKfoj63Ik9EWxkQ5hQKD FP5Q== 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 :mail-followup-to:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=cDaTSDZgwH1tEyxeK1FWu9PQ+2EvkmR6IA94ykP8ez8=; b=c/2XkgJwRmNb/zKjsmkVUepE38+AffaaIjCalDL1bQ2LgFMuStUhO9lvYtBHQnJaZW G4d62GYC0M1COX0j3GCA31Sdog/I2ZYw4cWOjqN/VCJZSni8thdpmlykU2CdB66yKnqf ASK88GF+dYCv7kahxpMBVKefe15k4Chk2W8tzfbFxhldVNZZjnIP28TIj5l1huiMhD5f FrfTa/6C9jUjbRlRL8cs8NHv8zIgxtqmFx57lIJ1doO0R4zh/g8vLsCTJt6opW5e0XTk s999vl0KMrNfpow7mqGbDJ+AET7BkOmhKj2lPLzO8t4vC5GJzKaADq7x4fQWhIWdNtef 2oaA== X-Gm-Message-State: APjAAAV2UO9FD/OlpD6y5/qVZxklVQchwy94PUCmTrapYa67uJhBI5E5 NQgy+CcN6/Du3I1e+ImFr50= X-Received: by 2002:a0d:eb13:: with SMTP id u19mr3459315ywe.110.1554365783343; Thu, 04 Apr 2019 01:16:23 -0700 (PDT) Received: from yubo-2 ([191.101.9.198]) by smtp.gmail.com with ESMTPSA id 131sm7049810ywp.20.2019.04.04.01.16.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 01:16:23 -0700 (PDT) Date: Thu, 4 Apr 2019 04:16:21 -0400 From: Bo YU To: ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, netdev@vger.kernel.org, yhs@fb.com Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH] bpf:sample: fix field 'lock' has incomplete type in hbm.h Message-ID: <20190404081620.zx5rt2j2rjvdcglt@yubo-2> Mail-Followup-To: ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, netdev@vger.kernel.org, yhs@fb.com, linux-kernel@vger.kernel.org, bpf@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20180512-62-03f98a Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When compiling sample/bpf: samples/bpf/hbm.h:12:23: error: field ‘lock’ has incomplete type struct bpf_spin_lock lock; Fixes: 187d0738ff35(bpf: Sample HBM BPF program to limit egress bw) Signed-off-by: Bo YU --- samples/bpf/hbm.h | 2 +- samples/bpf/hbm_out_kern.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/bpf/hbm.h b/samples/bpf/hbm.h index 518e8147d084..7ce18cb9e365 100644 --- a/samples/bpf/hbm.h +++ b/samples/bpf/hbm.h @@ -9,7 +9,7 @@ * Include file for Host Bandwidth Management (HBM) programs */ struct hbm_vqueue { - struct bpf_spin_lock lock; + struct bpf_spin_lock *lock; /* 4 byte hole */ unsigned long long lasttime; /* In ns */ int credit; /* In bytes */ diff --git a/samples/bpf/hbm_out_kern.c b/samples/bpf/hbm_out_kern.c index f806863d0b79..04c4f3d6ab9a 100644 --- a/samples/bpf/hbm_out_kern.c +++ b/samples/bpf/hbm_out_kern.c @@ -90,7 +90,7 @@ int _hbm_out_cg(struct __sk_buff *skb) curtime = bpf_ktime_get_ns(); // Begin critical section - bpf_spin_lock(&qdp->lock); + bpf_spin_lock(qdp->lock); credit = qdp->credit; delta = curtime - qdp->lasttime; /* delta < 0 implies that another process with a curtime greater @@ -105,7 +105,7 @@ int _hbm_out_cg(struct __sk_buff *skb) } credit -= len; qdp->credit = credit; - bpf_spin_unlock(&qdp->lock); + bpf_spin_unlock(qdp->lock); // End critical section // Check if we should update rate -- 2.11.0