From patchwork Thu Aug 6 20:37:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 247534 Delivered-To: patch@linaro.org Received: by 2002:a50:110d:0:0:0:0:0 with SMTP id e13csp1567658eck; Thu, 6 Aug 2020 13:37:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQfBqOJYhyathmFOM0ZhkSzEuT4+eT4Jan2IoFj5yL8LKJhN5gX/+Bxt8y9B8u8O2Omrmt X-Received: by 2002:a50:e047:: with SMTP id g7mr5691019edl.290.1596746266419; Thu, 06 Aug 2020 13:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596746266; cv=none; d=google.com; s=arc-20160816; b=izKh/8fWUmTsBjyhwMaWz1cOXxzF7n6NQvn1Di287K+dCU1nu8DqhsslbaAR2AVcky kuwHqJ3B2vI2ri9MJScjT6l5csW9+q0S/Pn5S95O53+qd6SfDeSYuRDdxj+b7jZTagzr pZvJKJjA4X3+KXVcOQKo7qhfKvrYIm18IX+Sn8EogiceK5WkXF17Td0NQm8Lxwnij7np Dezom5HYST8ibGv3COGqPltAPlSzlpGMvTuxEGTg+uPgPQmptV0nMTgMQw0Op2b0Tlw7 GwIAxQeFU2I6ZK4CIuLldlI+w+eXRrZN/nHFDloDULj/gc94gct6nXSH2dMxbGnPmlF1 wUQw== 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=TyyBmEg+oDtkNBxbb3CoGvlfAFNE8UNFA/P2Wsl2LMM=; b=L9uDgXpBPOtMnjgaTjUd0fOv/CaMhEtjgTR8wF4EWsN+z7C+9olY5VOr2zTg0dMQKW 8umnmSyPCXtjphUgLBwcMY3BNUp0Ric+y3pQnwtVmbWm9kjdruOUnwZqSXCGe10Rr38C ETh8ZD5vK/M/p2ygzNfdtvot1tQCET8mSLKaIl01pICZDWnXODbAAOWqDAJBCEyf/9yM V8ZM/at8eI91TweQiCVVC2hMGGBBB9rETKOOPIfmE4NNNM1bWiZos14CVCTcNHlBwhe7 +kVksXn4ISjiZ6lHr3kROhRfgMFpK1jsmEGEYOEufDIKExzFzGXlm0uALrKDyVw+N6IK 1spg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cwu9s6a6; 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 dn14si3842554edb.558.2020.08.06.13.37.45; Thu, 06 Aug 2020 13:37:46 -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=cwu9s6a6; 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 S1726197AbgHFUhl (ORCPT + 9 others); Thu, 6 Aug 2020 16:37:41 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:40068 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725272AbgHFUhl (ORCPT ); Thu, 6 Aug 2020 16:37:41 -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 076KbEDn073880; Thu, 6 Aug 2020 15:37:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1596746234; bh=TyyBmEg+oDtkNBxbb3CoGvlfAFNE8UNFA/P2Wsl2LMM=; h=From:To:Subject:Date:In-Reply-To:References; b=cwu9s6a61+ZCK48D0Hx9xq5V0ZeOJqeUKFYNLXDfgVlB/D8zjafzgXC5SQb7PxKTi NyLjWa3Jt3nMF2iytcKiTbWkPPXFSJt5rdnFuhvTG+ub85GgbCEBEDfN79hMWz99a/ zQ7cfOiXzX+Oh+smZzq0l3jtfgU7hkO3SU0eXxk8= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 076KbEap046259 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Aug 2020 15:37:14 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 6 Aug 2020 15:37:13 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE104.ent.ti.com (157.170.170.34) 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; Thu, 6 Aug 2020 15:37:13 -0500 Received: from uda0868495.fios-router.home (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 076KbCei075449; Thu, 6 Aug 2020 15:37:13 -0500 From: Murali Karicheri To: , , , , , , , , Subject: [net-next iproute2 PATCH v4 1/2] iplink: hsr: add support for creating PRP device similar to HSR Date: Thu, 6 Aug 2020 16:37:11 -0400 Message-ID: <20200806203712.2712-2-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806203712.2712-1-m-karicheri2@ti.com> References: <20200806203712.2712-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 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/ip/iplink_hsr.c b/ip/iplink_hsr.c index 7d9167d4e6a3..6ea138a23cbc 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,11 @@ 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_int(PRINT_ANY, + "proto", + "proto %d ", + rta_getattr_u8(tb[IFLA_HSR_PROTOCOL])); } static void hsr_print_help(struct link_util *lu, int argc, char **argv, From patchwork Thu Aug 6 20:37:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 247535 Delivered-To: patch@linaro.org Received: by 2002:a50:110d:0:0:0:0:0 with SMTP id e13csp1567851eck; Thu, 6 Aug 2020 13:38:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpYTPyNaqpxfDgNm7/D+QMgzzy5R5fkhYVo9kg97qvI5BXxf2MDWcX38He2TqzoOBURhp8 X-Received: by 2002:aa7:cd07:: with SMTP id b7mr6067426edw.172.1596746287721; Thu, 06 Aug 2020 13:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596746287; cv=none; d=google.com; s=arc-20160816; b=BVvYtsQU+6i85BF+j9Zq99Sa1PBe01l3/k/XbqV+wS5ZL5/I1szeL4nAnR/ud0M90K fOgipxhIRQ4+pFoMZg4X9J6tqNNYceyYiWgme7qQDzYj/G7rFzEIgz9DbPkOkvRnhI1F eMRRuTzG1/xgZUiiGiuFnWLwDy6dXnpu5a0Vv8IsOi0+apsiJvLnY8HPk7YOuUl/BqUM +ERIFN9I9DaLlB1C+YJ+HxPvrYym7D4B8gZayAxlK0HC20bW8BIk8BR6+mHnll0os6BU Yu/HKxfavWCjPv8ZHLBpYzihnXdRHB0pyUBcOOh78ltVAVIWVHv3Sr61NsLH52JkE2G/ 53Wg== 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=ewLV50VOloCzvqBr+aCJSziRVT2ef7aTSSOnHFWmCBkXzRM/X6WzSOjxZupgjuQdxQ Ajpi8qsvFwmHrEy1Vk17YnqI0M2EAgnD0hR/uh7KbrY4mAlK0mhRNTKQCstYs7RiFerM pRH0Uy5ysaacguWr1l87Cez1zJ9IRej4ziS7uaNXG46mhDZ2FJu6h92dVAIMw8lAxxR/ WpssZL85/v8D6yGI6LNO4bIQGrtET6vYJn4JWbkQJ18Ejr0d8ht58LVw3NYsBpR2rRko Gz4hKCIUR7x/kgxpWIj8yG+3/IwkzkUZRdkV6s+czheTe32Cgq+kv8EAaxrmAG8isNwB C7dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ojUIqog8; 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 ce6si3903724ejb.734.2020.08.06.13.38.07; Thu, 06 Aug 2020 13:38:07 -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=ojUIqog8; 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 S1726448AbgHFUiG (ORCPT + 9 others); Thu, 6 Aug 2020 16:38:06 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:38918 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725272AbgHFUiF (ORCPT ); Thu, 6 Aug 2020 16:38:05 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 076KbENl090321; Thu, 6 Aug 2020 15:37:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1596746234; bh=uxcnSjzUiqDws5N5tXOlhzvsMy7/95fMwMASURHhnmA=; h=From:To:Subject:Date:In-Reply-To:References; b=ojUIqog82tXzTX2Y5cbf8TzZpkgOQ0L56q5x6uNwIIs/mP6RZnppSbDFVIOnEeXUM QMwRF7FZobhYZ5JjMccQvDRQqtfWOezl6u10Sc6GyX627K6Il5b7yrUG9KwdJ8S6B5 gBHhRTu3pKWwIJ+UIE9W9Bg5cJ7D3gKgxum9lAW8= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 076KbEHZ128745; Thu, 6 Aug 2020 15:37:14 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) 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; Thu, 6 Aug 2020 15:37:14 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE108.ent.ti.com (10.64.6.29) 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; Thu, 6 Aug 2020 15:37:14 -0500 Received: from uda0868495.fios-router.home (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 076KbCej075449; Thu, 6 Aug 2020 15:37:14 -0500 From: Murali Karicheri To: , , , , , , , , Subject: [net-next iproute2 PATCH v4 2/2] ip: iplink: prp: update man page for new parameter Date: Thu, 6 Aug 2020 16:37:12 -0400 Message-ID: <20200806203712.2712-3-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806203712.2712-1-m-karicheri2@ti.com> References: <20200806203712.2712-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