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=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,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 A46A3C433E3 for ; Fri, 31 Jul 2020 18:28:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D99B22BF5 for ; Fri, 31 Jul 2020 18:28:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="jI+kXod4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387911AbgGaS2w (ORCPT ); Fri, 31 Jul 2020 14:28:52 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:39208 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387907AbgGaS2u (ORCPT ); Fri, 31 Jul 2020 14:28:50 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06VIGQPT000780 for ; Fri, 31 Jul 2020 11:28:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=JgfEaGwNQRVUqJr1ZSWmaVimqm5x282W48cubRvrXek=; b=jI+kXod4DW2ig+rcNzGnhg5SEv/8oIdKYTYtujj19TWBbhHllxBtSnB402S6yg/7bFcx U2zW+iQQC7E5qqZs9E5Hyh2Fr66evQEFumVvJ5NGlvGtJhJCQSyZMjJRv7opac8WCh0A gxcRZyMXE5jBCQiagii0f98we0S2EY4Ny8g= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 32mn7g94e8-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 31 Jul 2020 11:28:49 -0700 Received: from intmgw002.08.frc2.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 31 Jul 2020 11:28:47 -0700 Received: by devbig012.ftw2.facebook.com (Postfix, from userid 137359) id 050E92EC4E02; Fri, 31 Jul 2020 11:28:42 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Andrii Nakryiko Smtp-Origin-Hostname: devbig012.ftw2.facebook.com To: , , , CC: , , Andrii Nakryiko , Song Liu Smtp-Origin-Cluster: ftw2c04 Subject: [PATCH v2 bpf-next 5/5] tools/bpftool: add documentation and bash-completion for `link detach` Date: Fri, 31 Jul 2020 11:28:30 -0700 Message-ID: <20200731182830.286260-6-andriin@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200731182830.286260-1-andriin@fb.com> References: <20200731182830.286260-1-andriin@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-31_07:2020-07-31,2020-07-31 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 phishscore=0 adultscore=0 impostorscore=0 mlxlogscore=985 mlxscore=0 priorityscore=1501 clxscore=1015 suspectscore=8 bulkscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007310137 X-FB-Internal: deliver Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Add info on link detach sub-command to man page. Add detach to bash-compl= etion as well. Acked-by: Song Liu Signed-off-by: Andrii Nakryiko --- tools/bpf/bpftool/Documentation/bpftool-link.rst | 8 ++++++++ tools/bpf/bpftool/bash-completion/bpftool | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/bpf/bpftool/Documentation/bpftool-link.rst b/tools/bpf= /bpftool/Documentation/bpftool-link.rst index 38b0949a185b..4a52e7a93339 100644 --- a/tools/bpf/bpftool/Documentation/bpftool-link.rst +++ b/tools/bpf/bpftool/Documentation/bpftool-link.rst @@ -21,6 +21,7 @@ LINK COMMANDS =20 | **bpftool** **link { show | list }** [*LINK*] | **bpftool** **link pin** *LINK* *FILE* +| **bpftool** **link detach *LINK* | **bpftool** **link help** | | *LINK* :=3D { **id** *LINK_ID* | **pinned** *FILE* } @@ -49,6 +50,13 @@ DESCRIPTION contain a dot character ('.'), which is reserved for future extensions of *bpffs*. =20 + **bpftool link detach** *LINK* + Force-detach link *LINK*. BPF link and its underlying BPF + program will stay valid, but they will be detached from the + respective BPF hook and BPF link will transition into + a defunct state until last open file descriptor for that + link is closed. + **bpftool link help** Print short help message. =20 diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftoo= l/bash-completion/bpftool index 257fa310ea2b..f53ed2f1a4aa 100644 --- a/tools/bpf/bpftool/bash-completion/bpftool +++ b/tools/bpf/bpftool/bash-completion/bpftool @@ -1122,7 +1122,7 @@ _bpftool() ;; link) case $command in - show|list|pin) + show|list|pin|detach) case $prev in id) _bpftool_get_link_ids @@ -1139,7 +1139,7 @@ _bpftool() COMPREPLY=3D( $( compgen -W "$LINK_TYPE" -- "$cur" )= ) return 0 ;; - pin) + pin|detach) if [[ $prev =3D=3D "$command" ]]; then COMPREPLY=3D( $( compgen -W "$LINK_TYPE" -- "$cu= r" ) ) else --=20 2.24.1