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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 D4AB3C433E3 for ; Sun, 12 Jul 2020 14:09:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AEB5E2068F for ; Sun, 12 Jul 2020 14:09:31 +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="KefjtlJK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728960AbgGLOJa (ORCPT ); Sun, 12 Jul 2020 10:09:30 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:50857 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728786AbgGLOJ0 (ORCPT ); Sun, 12 Jul 2020 10:09:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1594562965; x=1626098965; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uci+63N0XBlAvV0QBr++Adpov2aPMsyTOj+m1Y0wXT8=; b=KefjtlJKT9lbEweOYeEf6ktOcc49+IysD7EJeeQTJ0X1LhGKRhR2G7Z6 2XEJg0YXwOfmDhUIN/uxMdXtI+G4whbe/yC8DDWAUDrHGpzWGh04141Je /TjreG75DRG/Ss8E3LI1EhOqCympVrsdxPFdDwc9XIfngnB5uz5Ty6FDP Q3KUqAW++xi4GVnXNA9x/Ayy06jxLhaUDA7P1ivDmp18LxSAf3IO1rFok ZRftM4t5czxrmdNtpeUG7MCwKfs4huqfDttz8UqmTncaPzvCWXzCfG5NE fxfZANSpHtnnt5GQSTy2Qmm0/A30kT3Q70f4OGS/hJLdv5CawxgbfNsKy Q==; IronPort-SDR: D/r03IT90FREUMh1iVqM6jf8lzyjPi51aj8ebZKHklO8A6px6fRggRZQlTaetx3YgpHgcdvmco kfGpJi+2xPwi9fTCKpF7VMTb3l/0KYIBl3zsqWBELWTYmeMmSCxFG9as6S2z7jMftF5h59WWBm xJ4wI4CrAb0UgFt7Cvn4XxiI3BWOPm2Eu67gnAZXEdXwX/MiLaJW/enoLn3zT1uXRZPqu7o3W5 dKmKHaY0PBroCjFGLYfTmr8PbthT6jWR3C64uPwgh+nc1l7VVxHsWRcLiz/Bvafi7xOChCahGx hrs= X-IronPort-AV: E=Sophos;i="5.75,343,1589266800"; d="scan'208";a="81541613" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 12 Jul 2020 07:09:24 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Sun, 12 Jul 2020 07:08:55 -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; Sun, 12 Jul 2020 07:08:53 -0700 From: Horatiu Vultur To: , , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH net-next v3 01/12] switchdev: mrp: Extend switchdev API for MRP Interconnect Date: Sun, 12 Jul 2020 16:05:45 +0200 Message-ID: <20200712140556.1758725-2-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200712140556.1758725-1-horatiu.vultur@microchip.com> References: <20200712140556.1758725-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..ff22469143013 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; + u32 in_id; + u32 period; + u8 max_miss; +}; + +#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; + struct net_device *i_port; + u32 ring_id; + u16 in_id; + u8 in_role; +}; + +#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; + u32 in_id; + u8 in_state; +}; + +#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