From patchwork Mon Aug 17 21:17:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 247883 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2978742ilo; Mon, 17 Aug 2020 14:18:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCOr9/95Pv9yzn9FSAkHY1ZjXUv9MY8/ktV3pVn8mfMm4XH2NsHjxSEiDp+AAGSN5IOgIP X-Received: by 2002:a17:906:3b91:: with SMTP id u17mr16702165ejf.305.1597699091426; Mon, 17 Aug 2020 14:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597699091; cv=none; d=google.com; s=arc-20160816; b=OF2dbHpkxi3+xzXcIDIxeLwIaNSbluM9Sjn0PNwKTm3RV1hLzYYNpV9S3fRLaLzpL5 DZ0FZkkRO9Qw/R5zO6NE+6nFn4UEFwoIiHd7WJbpGILYEezs/+ZjDRS8+9mqvVQiQL0m xvDTMzJ9eWLj0F+h6uVlNw8tOcaGVbsTFW+Vp4aKCWTSomSEuuyDjj6tptdlbPJqlt3d H8O4c3kL6RgihZiEwNhZu40lSLv3AdBI819unri3/7WMYYkpLQ8QShDfqFGzvmr7jPJW sleCekutTNaDVIUCWxWrSESMf/20b6pmQQutLe+7gQy+yfM7Hlg7U91diPg0RJ9Ocb40 aRLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=9391HzA9X31BkYsn5De/TCgEsqAHK3DrCsE1IzlxOYg=; b=z5kJ6ZbxZPkggN+RqKxmQkUv+bALYaibPfcbmRxOnQn6f9z6yltvk6Ehov0qtmUS/6 1bAKh8d7MpOOT0FhG05LyYbB/4WMNW3q746da9b/JCh2KEPssd92DtiELxZ/oHLbfjEH aM2hAJsVfvt4xI4hQccqyR6qBwBrT6lJ4bkfAo7ii/ORXuuvyi9P8gKf3pEFDvEwDa9P 90r09dRFAi/xFZpWqT5FefkmKQnWLeZG43vTxAsi40ythSJjnAbLW/OHBDCwqrjQCsA3 wdhSwB638ihikhV3+lFFhOvrdhe0wX2wfXkKMePamcKl4EJTGdsaIFGntsJBVsFP5/rK soYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vEq1Yo5u; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x10si11941864ejc.114.2020.08.17.14.18.11; Mon, 17 Aug 2020 14:18:11 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vEq1Yo5u; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbgHQVSK (ORCPT + 9 others); Mon, 17 Aug 2020 17:18:10 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:37908 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728073AbgHQVSG (ORCPT ); Mon, 17 Aug 2020 17:18:06 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 07HLHfDB072302; Mon, 17 Aug 2020 16:17:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1597699061; bh=9391HzA9X31BkYsn5De/TCgEsqAHK3DrCsE1IzlxOYg=; h=From:To:Subject:Date:In-Reply-To:References; b=vEq1Yo5uRye1ISLR09m+gltJLPIoVcVi/Hh49LtnUBHWzEJDXGyACOCGXtsR+U97F WIxoH1XDnchosBCLWDkRM+9m+ZkcIXgDqkb+aegHK2T5mdnhpjUuUP79O1aWPPN6qY f0oBR3hGalqcn+wAclIlzw/7RLAqsJRCUXNCKq3c= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 07HLHf2Z083010 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 17 Aug 2020 16:17:41 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 17 Aug 2020 16:17:41 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Mon, 17 Aug 2020 16:17:41 -0500 Received: from uda0868495.fios-router.home (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 07HLHb8S073931; Mon, 17 Aug 2020 16:17:40 -0500 From: Murali Karicheri To: , , , , , , , Subject: [PATCH iproute2 v5 1/2] iplink: hsr: add support for creating PRP device similar to HSR Date: Mon, 17 Aug 2020 17:17:36 -0400 Message-ID: <20200817211737.576-2-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817211737.576-1-m-karicheri2@ti.com> References: <20200817211737.576-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch enhances the iplink command to add a proto parameters to create PRP device/interface similar to HSR. Both protocols are quite similar and requires a pair of Ethernet interfaces. So re-use the existing HSR iplink command to create PRP device/interface as well. Use proto parameter to differentiate the two protocols. Signed-off-by: Murali Karicheri --- ip/iplink_hsr.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/ip/iplink_hsr.c b/ip/iplink_hsr.c index 7d9167d4e6a3..da2d03d4bcbc 100644 --- a/ip/iplink_hsr.c +++ b/ip/iplink_hsr.c @@ -25,7 +25,7 @@ static void print_usage(FILE *f) { fprintf(f, "Usage:\tip link add name NAME type hsr slave1 SLAVE1-IF slave2 SLAVE2-IF\n" - "\t[ supervision ADDR-BYTE ] [version VERSION]\n" + "\t[ supervision ADDR-BYTE ] [version VERSION] [proto PROTOCOL]\n" "\n" "NAME\n" " name of new hsr device (e.g. hsr0)\n" @@ -35,7 +35,9 @@ static void print_usage(FILE *f) " 0-255; the last byte of the multicast address used for HSR supervision\n" " frames (default = 0)\n" "VERSION\n" - " 0,1; the protocol version to be used. (default = 0)\n"); + " 0,1; the protocol version to be used. (default = 0)\n" + "PROTOCOL\n" + " 0 - HSR, 1 - PRP. (default = 0 - HSR)\n"); } static void usage(void) @@ -49,6 +51,7 @@ static int hsr_parse_opt(struct link_util *lu, int argc, char **argv, int ifindex; unsigned char multicast_spec; unsigned char protocol_version; + unsigned char protocol = HSR_PROTOCOL_HSR; while (argc > 0) { if (matches(*argv, "supervision") == 0) { @@ -64,6 +67,13 @@ static int hsr_parse_opt(struct link_util *lu, int argc, char **argv, invarg("version is invalid", *argv); addattr_l(n, 1024, IFLA_HSR_VERSION, &protocol_version, 1); + } else if (matches(*argv, "proto") == 0) { + NEXT_ARG(); + if (!(get_u8(&protocol, *argv, 0) == HSR_PROTOCOL_HSR || + get_u8(&protocol, *argv, 0) == HSR_PROTOCOL_PRP)) + invarg("protocol is invalid", *argv); + addattr_l(n, 1024, IFLA_HSR_PROTOCOL, + &protocol, 1); } else if (matches(*argv, "slave1") == 0) { NEXT_ARG(); ifindex = ll_name_to_index(*argv); @@ -140,6 +150,9 @@ static void hsr_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) RTA_PAYLOAD(tb[IFLA_HSR_SUPERVISION_ADDR]), ARPHRD_VOID, b1, sizeof(b1))); + if (tb[IFLA_HSR_PROTOCOL]) + print_hhu(PRINT_ANY, "proto", "proto %hhu ", + rta_getattr_u8(tb[IFLA_HSR_PROTOCOL])); } static void hsr_print_help(struct link_util *lu, int argc, char **argv, From patchwork Mon Aug 17 21:17:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 247884 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2979882ilo; Mon, 17 Aug 2020 14:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5YLl5Cl/oaPtDOBq+4eQ36MZUXKQfr/fLynkAPqJ7/gB5+ciBG/z2zj1kjxAp+FjJFArW X-Received: by 2002:a17:906:cecd:: with SMTP id si13mr17357013ejb.96.1597699196910; Mon, 17 Aug 2020 14:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597699196; cv=none; d=google.com; s=arc-20160816; b=Zphcc7IMNyUHDHaMN8VCjo2kJg+mcCKDDBJOSLh6JTDrwqSRI7Xy7WfnL/B9IwWtH0 FjhyIrtysti7jxvxeBrOfkN/WLVrROvBUbhKJRd6KfIbR8gxs1/NZiv9VeWF0VS4bBym XDl8vcLhsdJbPnue9kJ0uy/mfFRQ2k/1asli3VgJ3qjiLFzB+GlW0MzwfPI0A+6i19JR vRzOaLlcupBVCvFbpircrWnpyD3mK0Wx3oA0HBS0JWqQqTWxuegyRqs1Juq0W2NuOM26 7I2Rn3maPYaIEeFKDRbS3B0i9bjrtSwXIvV8H266DHVIP57KlbxigeJ4hCNCe0XHBgxo JMBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=uxcnSjzUiqDws5N5tXOlhzvsMy7/95fMwMASURHhnmA=; b=q9mMah34bM0BiBEz3v5yL4pKrCmthA02Ohl0oJdXPt3OwxbryxXJVjmLUPZ7fd2PR3 mGKeCkF9r+79prkMrEOAQ76HFqs3n+ourM+heo29AUidRtT6WSIXm5xHuXwa43gWoUrZ TGBYYTPO4OGztGd3PDvWUX0Coy4OkIeKm6xs1dZmBQvebDmoRXi899alFx1usPNe7JVo IbyGWLgOOAyymgL2qyZEpzSjAIHZhxam0YXkRJC7bP1XeMncQujm4qPsk4bXFYstlNyT BWr5dHijJr4HLmOMRpxGIzRZOR19wzQ5jdRjA81GBOpeDjgoUWe5whETCCz5zD5Eun2q hU2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mjy71Ci9; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si13407553ejq.427.2020.08.17.14.19.56; Mon, 17 Aug 2020 14:19:56 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mjy71Ci9; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728147AbgHQVTx (ORCPT + 9 others); Mon, 17 Aug 2020 17:19:53 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:50676 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbgHQVTw (ORCPT ); Mon, 17 Aug 2020 17:19:52 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 07HLJmou047117; Mon, 17 Aug 2020 16:19:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1597699188; bh=uxcnSjzUiqDws5N5tXOlhzvsMy7/95fMwMASURHhnmA=; h=From:To:Subject:Date:In-Reply-To:References; b=mjy71Ci9c1b2OBxmLhmcMhCR+jMbGAHHNyx3IeXAB8M9uB0BTm84sn3sHcnJ3Ao9y oO/IyPRaY9xRnIlbeNV0lnm+KNFhZB3e5U2/Jt6sGhHiJODmreCKy/ZAxOE/6ayTDp yEtt1NslisbHA/IXV8EGQkJwBd0Pzx/o57t/SFx4= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 07HLJmBr018833 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 17 Aug 2020 16:19:48 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 17 Aug 2020 16:17:42 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Mon, 17 Aug 2020 16:17:43 -0500 Received: from uda0868495.fios-router.home (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 07HLHb8T073931; Mon, 17 Aug 2020 16:17:41 -0500 From: Murali Karicheri To: , , , , , , , Subject: [PATCH iproute2 v5 2/2] ip: iplink: prp: update man page for new parameter Date: Mon, 17 Aug 2020 17:17:37 -0400 Message-ID: <20200817211737.576-3-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817211737.576-1-m-karicheri2@ti.com> References: <20200817211737.576-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org PRP support requires a proto parameter which is 0 for hsr and 1 for prp. Default is hsr and is backward compatible. Signed-off-by: Murali Karicheri --- man/man8/ip-link.8.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index c6bd2c530547..367105b72f44 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -1404,7 +1404,8 @@ the following additional arguments are supported: .BI slave1 " SLAVE1-IF " slave2 " SLAVE2-IF " .RB [ " supervision" .IR ADDR-BYTE " ] [" -.BR version " { " 0 " | " 1 " } ]" +.BR version " { " 0 " | " 1 " } [" +.BR proto " { " 0 " | " 1 " } ]" .in +8 .sp @@ -1425,6 +1426,12 @@ Default option is "0", possible values 0-255. - Selects the protocol version of the interface. Default option is "0", which corresponds to the 2010 version of the HSR standard. Option "1" activates the 2012 version. + +.BR proto " { " 0 " | " 1 " }" +- Selects the protocol at the interface. Default option is "0", which +corresponds to the HSR standard. Option "1" activates the Parallel +Redundancy Protocol (PRP). +. .in -8 .TP