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=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 768ABC433E0 for ; Mon, 6 Jul 2020 09:20:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5577720724 for ; Mon, 6 Jul 2020 09:20:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="v+OlmN0K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728711AbgGFJUp (ORCPT ); Mon, 6 Jul 2020 05:20:45 -0400 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:16636 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728024AbgGFJUo (ORCPT ); Mon, 6 Jul 2020 05:20:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1594027243; x=1625563243; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F/Xu5OUeCzkImk52f/kRtq2F+oAA5VX9yTd6BUssrkU=; b=v+OlmN0KsZH7k7+JmunBfik1zg8iNPQYfuNeI0HwIhrF6wZKC7RJFPWS X/+gha5RSsKzuDWKDuwnqJPLTut1RRfLozl0W4oGsLOcoxS96trHkZiMJ YbJE7CkBC6xKF8PQ6dxK/cfFLKvNNcptvajaMhn0yHKacmgFt6FznMwJn fnE6D8cEIhpEiclpnINbqbMzlTGU5kVS46yTAnnV5OkluFlBtkKTfoQ9w oF08jqBirpFNPAwMTYIIUUXE/0yXIb28ZknKkzxFLSRT4lim1BHXE6uhK ccE9fE90YArKdWiDnLgS6zXTHb5+mwuqEcCc8cTqlxR4BUic66fQFr2yQ A==; IronPort-SDR: NBhGs8IV6chOlyzHO4L7hk7Vnt3huHNlogQnN+1u40qyaV1cVLLd8ZNOyPGrro8LYqfQgg65o9 r5jWdznidPEnpQ/RwRgr4tLUdMw1/0+GNbCei2FhzFAUXsqKWPknASmFQrXflz7bIG/jVYtZlk 2F6JntiwTMFjsrnYEpnX2IAFvwh7wjSpSMyZo2iVdEOVt4LtKfflYeH0LofA/MIFKr6LWrHgI7 ZcF/8VuezG+Z2IWauaTAxLLFYcCbvvbTjpY/b5EfJJGgR3IYKZGTYo7yhuTjLjY5IQgKJuRBgp r2I= X-IronPort-AV: E=Sophos;i="5.75,318,1589266800"; d="scan'208";a="18108964" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 Jul 2020 02:20:43 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 6 Jul 2020 02:20:18 -0700 Received: from soft-dev3.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 6 Jul 2020 02:20:16 -0700 From: Horatiu Vultur To: , , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH net-next 01/12] switchdev: mrp: Extend switchdev API for MRP Interconnect Date: Mon, 6 Jul 2020 11:18:31 +0200 Message-ID: <20200706091842.3324565-2-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200706091842.3324565-1-horatiu.vultur@microchip.com> References: <20200706091842.3324565-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Extend switchdev API to add support for MRP interconnect. The HW is notified in the following cases: SWITCHDEV_OBJ_ID_IN_ROLE_MRP: This is used when the interconnect role of the node changes. The supported roles are MIM and MIC. SWITCHDEV_OBJ_ID_IN_STATE_MRP: This is used when the interconnect ring changes it states to open or closed. SWITCHDEV_OBJ_ID_IN_TEST_MRP: This is used to start/stop sending MRP_InTest frames on all MRP ports. This is called only on nodes that have the interconnect role MIM. Signed-off-by: Horatiu Vultur --- include/net/switchdev.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/include/net/switchdev.h b/include/net/switchdev.h index b8c059b4e06d9..ffa2706d8bc6f 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h @@ -76,6 +76,10 @@ enum switchdev_obj_id { SWITCHDEV_OBJ_ID_RING_TEST_MRP, SWITCHDEV_OBJ_ID_RING_ROLE_MRP, SWITCHDEV_OBJ_ID_RING_STATE_MRP, + SWITCHDEV_OBJ_ID_IN_TEST_MRP, + SWITCHDEV_OBJ_ID_IN_ROLE_MRP, + SWITCHDEV_OBJ_ID_IN_STATE_MRP, + #endif }; @@ -155,6 +159,40 @@ struct switchdev_obj_ring_state_mrp { #define SWITCHDEV_OBJ_RING_STATE_MRP(OBJ) \ container_of((OBJ), struct switchdev_obj_ring_state_mrp, obj) +/* SWITCHDEV_OBJ_ID_IN_TEST_MRP */ +struct switchdev_obj_in_test_mrp { + struct switchdev_obj obj; + /* The value is in us and a value of 0 represents to stop */ + u32 interval; + u8 max_miss; + u32 in_id; + u32 period; +}; + +#define SWITCHDEV_OBJ_IN_TEST_MRP(OBJ) \ + container_of((OBJ), struct switchdev_obj_in_test_mrp, obj) + +/* SWICHDEV_OBJ_ID_IN_ROLE_MRP */ +struct switchdev_obj_in_role_mrp { + struct switchdev_obj obj; + u16 in_id; + u32 ring_id; + u8 in_role; + struct net_device *i_port; +}; + +#define SWITCHDEV_OBJ_IN_ROLE_MRP(OBJ) \ + container_of((OBJ), struct switchdev_obj_in_role_mrp, obj) + +struct switchdev_obj_in_state_mrp { + struct switchdev_obj obj; + u8 in_state; + u32 in_id; +}; + +#define SWITCHDEV_OBJ_IN_STATE_MRP(OBJ) \ + container_of((OBJ), struct switchdev_obj_in_state_mrp, obj) + #endif typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj); -- 2.27.0