From patchwork Mon May 15 22:47:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9728173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DAD360387 for ; Mon, 15 May 2017 22:48:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7983D28464 for ; Mon, 15 May 2017 22:48:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CDD02882F; Mon, 15 May 2017 22:48:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7A1F2882F for ; Mon, 15 May 2017 22:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752324AbdEOWsB (ORCPT ); Mon, 15 May 2017 18:48:01 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:60329 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752341AbdEOWr4 (ORCPT ); Mon, 15 May 2017 18:47:56 -0400 X-IronPort-AV: E=Sophos;i="5.38,346,1491235200"; d="scan'208";a="17886600" Received: from mail-sn1nam01lp0116.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([207.46.163.116]) by ob1.hgst.iphmx.com with ESMTP; 16 May 2017 06:47:46 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=X1MiakuJpfyyxIqIrkZ6TBofGAwKvpjH3nB2zG1c93M=; b=ZiyewgrpdTpqy0hJ3l9uXtN4s6UyyStY2XCCYlvR4i8frA92XJwGb1k65LqDIwQ3BXYIA8rfwAzEnNin7txmzRqgUaA441f9eJ8yL+VF+VvhYx2J8tDL/GR9H4aJHqGvPwqKIMaIinHIv5DOcMz9b6gNPeX7YG9PzhEEl2gQwEc= Received: from CO2PR04CA016.namprd04.prod.outlook.com (10.141.240.144) by BLUPR04MB707.namprd04.prod.outlook.com (10.141.206.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Mon, 15 May 2017 22:47:43 +0000 Received: from CO1NAM04FT040.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::205) by CO2PR04CA016.outlook.office365.com (2a01:111:e400:1428::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16 via Frontend Transport; Mon, 15 May 2017 22:47:43 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by CO1NAM04FT040.mail.protection.outlook.com (10.152.91.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Mon, 15 May 2017 22:47:42 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 3A.32.19026.D003A195; Mon, 15 May 2017 15:47:41 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Mon, 15 May 2017 15:47:36 -0700 X-AuditID: 0ac94371-41ba798000004a52-08-591a300d6ab8 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 83.E3.11415.8003A195; Mon, 15 May 2017 15:47:36 -0700 (PDT) From: Bart Van Assche To: Doug Ledford CC: , Jason Gunthorpe , Leon Romanovsky , Bart Van Assche Subject: [PATCH rdma-core 5/5] srp_daemon.service: Add support for hot-plugging Date: Mon, 15 May 2017 15:47:27 -0700 Message-ID: <20170515224733.29586-6-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170515224733.29586-1-bart.vanassche@sandisk.com> References: <20170515224733.29586-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsXCddJ5kS6vgVSkwaJJGhYvz39gtfh+w9Ti ZN8/Zotnh3pZHFg8nk0/zOTxfUcvo8f7fVfZPD5vkgtgieKySUnNySxLLdK3S+DKWPfuD0vB cpeKC0s3sDUwnrfuYuTkkBAwkZh/egtLFyMXh5DAUiaJPQcnsEM4OxglOiedZ+ti5ACr+tuQ AxHfzChxc8VddpBuNgEjiW/vZ7KA2CICahKbXi0Ca2YWWMMo8WPLL7AiYQF/ic6L/xhBbBYB VYktH36ygdi8AvYS3V3nWCHOkJc4u2UnM4jNKeAg8ffmUyaQxUJANT9Pq4HMlBBoYpU4d/I1 M0SvoMTJmU/AFjMLSEgcfPECLC4koC5xcsl8pgmMQrOQlM1CUraAkWkVo1huZk5xbnpqgaGJ XnFiXkpmcbZecn7uJkZIYBfuYHx92/sQowAHoxIP74oVkpFCrIllxZW5hxglOJiVRHg5uKUi hXhTEiurUovy44tKc1KLDzFKc7AoifNmyU6NEBJITyxJzU5NLUgtgskycXBKNTCmT3y1z333 5hSlYIEpnenmzSbZ1ZVpNosWSlRkb9ymwNQhw2duJvvFge0c12v7BT/SMt6viPh+9ErnEuMT R5bkeJS+ltywOuj/lLwFlht/adaorV7zKunn7orFIZs+nSnaGKuzefbn21c615myeT1Vunu3 awaHV03yA6GvwW+fC91in6/xw+elEktxRqKhFnNRcSIA1h+x7GgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEJMWRmVeSWpSXmKPExsXCtZEjRZfDQCrS4Pljc4uDP9sYLV6e/8Bq 8f2GqcXJvn/MFs8O9bI4sHo8m36YyeP7jl5Gj/f7rrJ5TFtznsnj8ya5ANYoLpuU1JzMstQi fbsErox17/6wFCx3qbiwdANbA+N56y5GDg4JAROJvw05XYycHEICGxklNnR7gNhsAkYS397P ZAGxRQTUJDa9WsQOYjMLrGGU2LgXLC4s4C/RefEfI4jNIqAqseXDTzYQm1fAXmLRhyawGgkB eYmzW3Yyg9icAg4Sf28+ZQJZKwRU8/O02gRG7gWMDKsYxXIzc4pz0zMLDA31ihPzUjKLs/WS 83M3MYJDgTNyB+PTieaHGJk4OKUaGJfMffWaMbCVp0mi0o1H8oDPQenVIsH3CwP2bYoJZJBR W2PpeDuC5Ue40YEPPQVrgxhfpvDV/uFybv3jPT1hAq/une2Rd3y/fhF/ttAxqHjl40e/Lhmb Vp5Lu+zzNzJs3bIVf04JT/j4nHePkMJaPYtkpVg78XWFH29xub1aJ8V5UlZRhWWFkhJLcUai oRZzUXEiAKo58c21AQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39840400002)(39450400003)(39860400002)(39850400002)(39400400002)(2980300002)(438002)(199003)(189002)(9170700003)(36756003)(50466002)(8676002)(189998001)(356003)(5660300001)(38730400002)(110136004)(107886003)(8936002)(50226002)(53936002)(72206003)(47776003)(478600001)(54906002)(76176999)(50986999)(77096006)(2906002)(2950100002)(305945005)(86362001)(4326008)(6916009)(6666003)(33646002)(81166006)(106466001)(1076002)(5003940100001)(5890100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR04MB707; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT040; 1:CP5ovKIHRPGg7QXtkbevdw63UN4WRs26C5iTgH7zTHQbzhePdaXwHTPHWioMPqJXXAvk6OClOA09oaNpzgrDCNuFks+6n/lsTfTUfFNmLAcfxwRgnjrx0/QQoCXb3P5+prqbeZPJFUOfdPF4Lppgi9u/Ojy9A6NTkRe1GIZaOjc/aGgO+bdJeojGQzvwR3RsoKW6uTET+GK1vp01TguSA0vVVy5meTCl2y3VL5H/pkkyReMDDj/Ne2ESQFHb0Opz6jaccLV1TDqVHrxUzrrp2KVGoY3OUH4Gg22CbWzEykx4snZykm5UTlVd53nySlCACQmDbzxyybIORKmOzGOChq3c33QONjkC98ShzCFMQ5a/p+UwheDIxpR4i18u/WU/4YrFuJpRvm6RLsn41MtgThpIIV1H+zR77zwccNUEZ1ve1/ZGfx84LNFnL2kR03Ifs7S0uQbArcYmHqdK2dyF3ALzhUAtxZdLN0qChydrTI/m/SWU0CAJX59ljtR6OA9SpQdhGAewd+PXtJ2iXNRJrDCL/Boc6qtZbasZ3Ojvjlhd6evZp8QrywRDRQvjgp62 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2002db98-0485-47e8-c469-08d49be465cb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081);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MZ641qC+maHUCh+4=; 31:LGLzHOiw4oEcjk0I26HJAhnz08zb4X8yWizj07pN07uRfisloQaB63CdkcR8/VHU9zJ/GViU5CsSiyMNRkPycU2oc5k4Gz+y32+YyGLqzhRhZNBHVb/YOSxHarURgwQZR9gfkk0yP9Fg21Gjzez8YxRuJZGwtlSdICfoOQpZA41/k+AgCIowYgQGN/g1T9RMvPwLVwaxAvFC3+j8+E5JGSBHtRB8J5WL32/9zuYfO8dcagD1w3zc45bxTfPhIDzSYtpFNWG6Wt4GQ7PrOi/UnQ== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB707; 20:9hPKc7Xigp1Wv2gQvVcMyouYRTOLONZcIbXnyc1vZ29I7stnh+Ru8FIH1Qsi49wSjwvhJ0PeHsXIII8un9VVZFuYWIJVxoTpJ/brrT4djADwwVWCTtwNvawdQrA5Tf5ODGUbmodJH6szGoIEBUu6/iDi47Wdb1hiMKLuUr2yKQavt8NiyW5cjJuRLvYsxY2JvbFnklLfME6GMnySdJbd/tkkp/AJ/EzvC193hk4FU1nqKwwHLAtZJm/1OQykIgKN4D9oPm4+DCX1KhxGQvOXQhj6V/+/p4fOLjsxjZg50veUTgGZEK6V4/SxMTDlPzzoLgd0Yas8a9FlW3FAQnGiFz2rWN4wSvRqCM2aeQ4BrqpyZkADotxv/gFnSaw6HWmu6Xh12pVeuadBi2xZSp30sK2VpWPnGHC64YN/u8v324S5Yxx8JTuS1EJqU7Bt3aOJ/b4oaa81T/7RroF04oBs4cDy0CrjOJkBKwGd+LHym1vCTTWvAnC360HnIO5MQGgz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170088055959)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(3002001)(93006095)(93004095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:BLUPR04MB707; BCL:0; PCL:0; RULEID:; SRVR:BLUPR04MB707; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB707; 4:ECuUFou11lW/ttLIWcIbPSN9bCYP6fHz+YNbB2xMktKDVTAqIAL1M2PHfBs3NDFVH9RZ3e3zH0/j47ycnXVXKBZjkXMvRsNaWTx5kqwMjhaLWoCE0OpZNMPSi/0c6bNxkT0039aKvhtNyi+/h/g505fTTUlbxUjv0oAzsrYQoqOMaEEeDZeKFHHvPib2R/2fpCvR6d2T/Wm74tHGheeCiZEzySx5VEsOUSc/DDHsZ3CJgcG0fzEZVbXlB/YiAKjBolC3sDMek56L2YC2p+OEP9zV4ip1zHp2Z5UV0AW9cpEYX19PqV4vlchek22y/LyEzARhs8/+LSBNmqPrwyeXyo7ge/lYxGceVR0t4lNnsx1jM7Iu92cW7wwbsRKJXQMT45ck2LagZSmvm7MAsNNXJUbRFek3C5XWCFaZvwUxl0vuwXWcq2VwXrUDtly+oX3NplT0QIz/G8LwN1XRvS8UXBFdHYst57TAYPsE10cIU4/8EbF1rrYM52ae+LKxZQlspE0rbzDlaaSPlDfSBMGKNbCDTx+gyVSqFR1+w6z0+r+a+ykjvnkT4MGuyVrqQx+Fq+MoJ/xJnLCPSSrs+QhccnQ72Pz7uebRUHnrslVjVOZYhVdoOsEyLtE/Eb32mkALwXd8VrnAosH1+FBL/vPaoKcRJ9svY9ATdM2SHaNInhGRslW8G0qGqrZe246S031UD5fQ5gpxZEAjYpQ89BgzwRtFt+KqpcFBfnkgGc18eglaP0OHWD6Tzu+dKpzFBu6RGHHNDR4u3nzSNUeoTPUU9mchmdgCPqo4N8mh/9uO/UPVQ1SfHTpVuwcOCeLWpiZqwGANHc8E8IXWTURR1agNdPEy9PNBg+lYupKTu+5MRsSrS6aZhZ+IjzHMePr36BGPaZZ5E8LcMWewDG+xYhWgNPFVh5c3uHDU1cMQZYCc6dY = X-Forefront-PRVS: 0308EE423E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR04MB707; 23:PokeAUrS4JMJobLoKfrzzlWPn2BZK4G7J/AQjdwo74?= =?us-ascii?Q?UdnpGlX07x0A2u1cXplETIfEJVXydzN7wuE3mLpSicvUZ3FfnZ8oPI0CtgNx?= =?us-ascii?Q?P3fQNkmZEh518wPgtBUhmZJNACh+lBsI1oCAfDH1xvF97OtNnHCEMqvmxA4J?= =?us-ascii?Q?ZMoUgxrAnJTakaN57SPJ7KtJFsbpUM4BMhsYeLlzQz6JiD+tzqiwUCwQ8tr2?= =?us-ascii?Q?9QmHCsihNdkF3j6KagwNsnaQsU1pYj1EX2IkmZrG+uzuVEODpRI0vldWSxOl?= =?us-ascii?Q?M8ARw9Xy/3auTaprXYu2RRVLF11ajP0y6atMCbQ2sadT/QkbD3KXar6S6JId?= =?us-ascii?Q?7WMUFtofkPj7SnXdrCVXi2yPXFZoqbRguIEUPVUHkPIA2DpO/U0/gZi0sALR?= =?us-ascii?Q?698Zpti5RX8Qp55t52b+TGx2Ve6/RW/1O6VPxY16EyDlF+1mfbsPE78OStQX?= =?us-ascii?Q?j0DuBNx0UZhgxwMcLhxrBtEaH1RcqvhrRowA9wz4tmmOrdd4gDzZuqu74Qhl?= =?us-ascii?Q?P+//09t0mJ5434uobCBSuODmlbISNTvwzzkSqHbB3YhC+ZlVOq08wlNwmzXv?= =?us-ascii?Q?5+8J/jebJsquZqXE5FSk9Pr3xKWOmPYB+GH94b6zAeOpQBVnk43auZYy7PVu?= =?us-ascii?Q?AUI8JXEAMKPXhCYCMQe9VagQg4cCQ0s5v/eenawlMyBbNc277Cb6N/1AhYBG?= =?us-ascii?Q?4yG7KXHvVJRcKh2ubgszUjpH0+gC5s+8TtR1Z6CDaYKOAGOa/xtQNc7d/rqp?= =?us-ascii?Q?G3u/2RgJxJGYKewZHU+zcysLLZ+XalPol2wnZ70APBOsF11sipzBuTksS0EW?= =?us-ascii?Q?/8+W8eITY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55QljE+fkTBHnQQl7/pykqb6NSyl888F2eDgEA==; 24:ZXAEsOy+mkqjc3hlpc527JAazGqgvkB3KlwKL+ZvzsB/O3ew2QJ2Fv/49yUhXFZv5hMr8CQx9u1W+nY+JOQ1aajej/vc23f5Hq0v2M/hi5s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB707; 7:IANuy6eB85nUwSP4m+U+yfN8biXyykhKH6Scurj/Gq6omy8FuU24bJfZn6gJWEKqX8dXCRJRlt1LrTVovpB0OYirioWM1YxaVKZZV6OY6+oX4XA085rnMw58ohZUO0C06D+lND4WuQ7E5BOwCrQfzICg+TtPYc7RLLwI0PUNxTUDd2guUjWS4NHB00SPYKMmlSX6voezrWjhywY7SHNKDXAdUu+bQo41xsKlPqTJVicqYQKC4KulgOb6EBWNisHuL4DGFRN1kw3bAWwM6iWgdKMMOSBvuA+2vPzy3caKqY3oV9ZeIX27450qo8I66noLvPNkeNwfMgZ6ahCU6F4N+A==; 20:2qeIhR8flISPznygcXFyUUgWjjWHYw2kPLivt1MG5EwtWNY3XC7sWz014StasC0+CCs9J1el1d5ql4ByaxEAryE8xVh2LYUWq2QB1o3DhrmrbbMSGycxax0QJXWYHP6msHVWNR78o9C/V7QwN/64z5EVv2CCGBksGoXFcgW27tg= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2017 22:47:42.6127 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR04MB707 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP srp_daemon.service is modified such that instead of starting /usr/sbin/srp_daemon.sh that it does not start any process. A new template service is added, namely srp_daemon_port@.service. This service replaces srp_daemon.sh and controls /usr/sbin/srp_daemon for a single port. A udev rule is added that instantiates the srp_daemon_port@.service every time an RDMA port is hot-added. Since the per-port service depends on the srp_daemon service, starting or stopping the srp_daemon service affects all per-port services. Signed-off-by: Bart Van Assche --- debian/srptools.install | 5 ++++ redhat/rdma-core.spec | 5 +++- srp_daemon/90-srp-daemon.rules | 1 + srp_daemon/CMakeLists.txt | 5 ++++ srp_daemon/srp_daemon.service | 12 ++++----- srp_daemon/srp_daemon.service.5 | 30 +++++++++++++++++++++++ srp_daemon/srp_daemon_port@.service | 18 ++++++++++++++ srp_daemon/srp_daemon_port@.service.5 | 46 +++++++++++++++++++++++++++++++++++ 8 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 srp_daemon/90-srp-daemon.rules create mode 100644 srp_daemon/srp_daemon.service.5 create mode 100644 srp_daemon/srp_daemon_port@.service create mode 100644 srp_daemon/srp_daemon_port@.service.5 diff --git a/debian/srptools.install b/debian/srptools.install index ecec5d9a..81dbd4cd 100644 --- a/debian/srptools.install +++ b/debian/srptools.install @@ -1,6 +1,11 @@ etc/srp_daemon.conf +lib/systemd/system/srp_daemon.service +lib/systemd/system/srp_daemon_port@.service +lib/udev/rules.d/90-srp-daemon.rules usr/sbin/ibsrpdm usr/sbin/srp_daemon usr/share/doc/rdma-core/ibsrpdm.md usr/share/doc/srptools/ usr/share/man/man1/ibsrpdm.1 usr/share/man/man1/srp_daemon.1 +usr/share/man/man5/srp_daemon.service.5 +usr/share/man/man5/srp_daemon_port@.service.5 diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec index 993a6c80..fc9edaa1 100644 --- a/redhat/rdma-core.spec +++ b/redhat/rdma-core.spec @@ -439,10 +439,13 @@ rm -rf %{buildroot}/%{_initrddir}/ %files -n srp_daemon %config(noreplace) %{_sysconfdir}/srp_daemon.conf %{_unitdir}/srp_daemon.service +%{_unitdir}/srp_daemon_port@.service %{_sbindir}/ibsrpdm %{_sbindir}/srp_daemon -%{_sbindir}/srp_daemon.sh %{_sbindir}/run_srp_daemon +%{_udevrulesdir}/90-srp-daemon.rules %{_mandir}/man1/ibsrpdm.1* %{_mandir}/man1/srp_daemon.1* +%{_mandir}/man5/srp_daemon.service.5* +%{_mandir}/man5/srp_daemon_port@.service.5* %doc %{_docdir}/%{name}-%{version}/ibsrpdm.md diff --git a/srp_daemon/90-srp-daemon.rules b/srp_daemon/90-srp-daemon.rules new file mode 100644 index 00000000..6d6788f0 --- /dev/null +++ b/srp_daemon/90-srp-daemon.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="infiniband_mad", PROGRAM:="/usr/bin/systemctl show srp_daemon -p UnitFileState", RESULT=="UnitFileState=enabled", TAG+="systemd", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$attr{ibdev}:$attr{port}.service" diff --git a/srp_daemon/CMakeLists.txt b/srp_daemon/CMakeLists.txt index 24e4c30d..39f4bc99 100644 --- a/srp_daemon/CMakeLists.txt +++ b/srp_daemon/CMakeLists.txt @@ -3,6 +3,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NO_STRICT_ALIASING_FLAGS}") rdma_man_pages( ibsrpdm.1 srp_daemon.1.in + srp_daemon.service.5 + srp_daemon_port@.service.5 ) rdma_sbin_executable(srp_daemon @@ -28,6 +30,9 @@ rdma_subst_install(FILES "srp_daemon.sh.in" install(FILES srp_daemon.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") install(FILES srp_daemon.service DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}") +install(FILES srp_daemon_port@.service DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}") + +install(FILES 90-srp-daemon.rules DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}") # FIXME: The ib init.d file should really be included in rdma-core as well. set(RDMA_SERVICE "openibd" CACHE STRING "init.d file service name to order srpd after") diff --git a/srp_daemon/srp_daemon.service b/srp_daemon/srp_daemon.service index 9510f5fb..5bcb1d53 100644 --- a/srp_daemon/srp_daemon.service +++ b/srp_daemon/srp_daemon.service @@ -1,17 +1,15 @@ [Unit] -Description=Start or stop the daemon that attaches to SRP devices +Description=Daemon that discovers and logs in to SRP target systems Documentation=man:srp_daemon file:/etc/rdma/rdma.conf file:/etc/srp_daemon.conf DefaultDependencies=false Conflicts=emergency.target emergency.service -Requires=rdma.service -Wants=opensm.service -After=rdma.service opensm.service -After=network.target Before=remote-fs-pre.target [Service] -Type=simple -ExecStart=/usr/sbin/srp_daemon.sh +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/true +ExecStop=/bin/true [Install] WantedBy=remote-fs-pre.target diff --git a/srp_daemon/srp_daemon.service.5 b/srp_daemon/srp_daemon.service.5 new file mode 100644 index 00000000..a6b25d6a --- /dev/null +++ b/srp_daemon/srp_daemon.service.5 @@ -0,0 +1,30 @@ +'\" t +.TH "SRP_DAEMON\&.SERVICE" "5" "" "srp_daemon" "srp_daemon.service" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +srp_daemon.service \- srp_daemon systemd service that controls all ports +.SH "SYNOPSIS" +.PP +srp_daemon\&.service +.SH "DESCRIPTION" +.PP +The srp_daemon\&.service controls whether or not any srp_daemon processes are +running. Although no srp_daemon processes are controlled directly by the +srp_daemon\&.service, this service controls whether or not any +srp_daemon_port@\&.service are allowed to be active. Each +srp_daemon_port@\&.service controls one srp_daemon process. + +.SH "SEE ALSO" +.PP +\fBsrp_daemon\fR(1), +\fBsrp_daemon_port@.service\fR(5), +\fBsystemctl\fR(1) diff --git a/srp_daemon/srp_daemon_port@.service b/srp_daemon/srp_daemon_port@.service new file mode 100644 index 00000000..666400ab --- /dev/null +++ b/srp_daemon/srp_daemon_port@.service @@ -0,0 +1,18 @@ +[Unit] +Description=SRP daemon that monitors port %i +Documentation=man:srp_daemon file:/etc/rdma/rdma.conf file:/etc/srp_daemon.conf +DefaultDependencies=false +Conflicts=emergency.target emergency.service +Requires=rdma.service +Wants=opensm.service +After=rdma.service opensm.service srp_daemon.service +After=network.target +Before=remote-fs-pre.target +BindsTo=srp_daemon.service + +[Service] +Type=simple +ExecStart=/usr/sbin/srp_daemon -e -c -n -j %I -R 60 + +[Install] +WantedBy=remote-fs-pre.target diff --git a/srp_daemon/srp_daemon_port@.service.5 b/srp_daemon/srp_daemon_port@.service.5 new file mode 100644 index 00000000..a755b2eb --- /dev/null +++ b/srp_daemon/srp_daemon_port@.service.5 @@ -0,0 +1,46 @@ +'\" t +.TH "SRP_DAEMON_PORT@\&.SERVICE" "5" "" "srp_daemon" "srp_daemon_port@.service" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +srp_daemon_port@.service \- srp_daemon_port@ systemd service that controls a +single port +.SH "SYNOPSIS" +.PP +srp_daemon_port@\&.service +.SH "DESCRIPTION" +.PP +The srp_daemon_port@\&.service controls whether or not an srp_daemon process +is monitoring the RDMA port specified as template argument. The format for the +RDMA port name is \fIdev:port\fR where \fIdev\fR is the name of an RDMA device +and \fIport\fR is an port number starting from one. Starting an instance of +this template will start an srp_daemon process. Stopping an instance of this +template will stop the srp_daemon process for the specified port. Here is an +example of how to obtain a list of all RDMA device and port number pairs: +.PP +.nf +.RS +$ for p in /sys/class/infiniband/*/ports/*; do + echo $p | sed 's,/sys/class/infiniband/,,;s,/ports/,:,' + done +mlx4_0:1 +mlx4_0:2 +mlx4_1:1 +mlx4_1:2 +.RE +.fi +.PP + +.SH "SEE ALSO" +.PP +\fBsrp_daemon\fR(1), +\fBsrp_daemon.service\fR(5), +\fBsystemctl\fR(1)