1da58800fSPaul Luse# ComponentName Programmer's Guide {#componentname_pg} 2da58800fSPaul Luse 31e1fd9acSwawryk## In this document {#componentname_pg_toc} 4da58800fSPaul Luse 5da58800fSPaul Luse@ref componentname_pg_audience 6da58800fSPaul Luse@ref componentname_pg_intro 7da58800fSPaul Luse@ref componentname_pg_theory 8da58800fSPaul Luse@ref componentname_pg_design 9da58800fSPaul Luse@ref componentname_pg_examples 10da58800fSPaul Luse@ref componentname_pg_config 11da58800fSPaul Luse@ref componentname_pg_component 12da58800fSPaul Luse@ref componentname_pg_sequences 13da58800fSPaul Luse 14da58800fSPaul Luse## Target Audience {#componentname_pg_audience} 15da58800fSPaul Luse 16da58800fSPaul LuseThis programmer's guide is intended for developers authoring applications that utilize the SPDK <COMPONENT NAME>. It is 17da58800fSPaul Luseintended to supplement the source code to provide an overall understanding of how to integrate <COMPONENT NAME> into 18da58800fSPaul Lusean application as well as provide some high level insight into how <COMPONENT NAME> works behind the scenes. It is not 19da58800fSPaul Luseintended to serve as a design document or an API reference but in some cases source code snippets and high level 20da58800fSPaul Lusesequences will be discussed. For the latest source code reference refer to the [repo](https://github.com/spdk). 21da58800fSPaul Luse 22da58800fSPaul Luse## Introduction {#componentname_pg_intro} 23da58800fSPaul Luse 24da58800fSPaul LuseProvide some high level description of what this component is, what it does and maybe why it exists. This shouldn't be 25da58800fSPaul Lusea lengthy tutorial or commentary on storage in general or the goodness of SPDK but provide enough information to 26da58800fSPaul Luseset the stage for someone about to write an application to integrate with this component. They won't be totally 271f813ec3SChen Wangstarting from scratch if they're at this point, they are by definition a storage application developer if they are 28da58800fSPaul Lusereading this guide. 29da58800fSPaul Luse 30da58800fSPaul Luse## Theory of Operation {#componentname_pg_theory} 31da58800fSPaul Luse 32da58800fSPaul LuseCreate subsections here to drill down into the "how" this component works. This isn't a design section however so 33da58800fSPaul Luseavoid getting into too many details, just hit the high level concepts that would leave the developer with a 34da58800fSPaul Luse50K foot overview of the major elements/assumptions/concepts that should have some baseline knowledge about before 35da58800fSPaul Lusethey start writing code. 36da58800fSPaul Luse 37da58800fSPaul LuseSome questions to consider when authoring this section: 38da58800fSPaul Luse 39da58800fSPaul Luse* What are the basic primitives that this component exposes? 40da58800fSPaul Luse* How are these primitives related to one another? 41da58800fSPaul Luse* What are the threading rules when using these primitives? 42da58800fSPaul Luse* What are the theoretical performance implications for different scaling vectors? 43da58800fSPaul Luse* Are there any other documents or specifications that the user should be familiar with? 44da58800fSPaul Luse* What are the intended use cases? 45da58800fSPaul Luse 46da58800fSPaul Luse## Design Considerations {#componentname_pg_design} 47da58800fSPaul Luse 48da58800fSPaul LuseHere is where you want to highlight things they need to think about in *their* design. If you have written test code 49da58800fSPaul Lusefor this module think about the things that you needed to go learn about to properly interact with this module. Think 50*a82b365bSJosh Sorefabout how they need to consider initialization options, threading, limitations, any sort of quirky or non-obvious 51da58800fSPaul Luseinteractions or module behaviors that might save them some time and effort by thinking about before they start their 52da58800fSPaul Lusedesign. 53da58800fSPaul Luse 54da58800fSPaul Luse## Examples {#componentname_pg_examples} 55da58800fSPaul Luse 56da58800fSPaul LuseList all of the relevant examples we have in the repo that use this module and describe a little about what they do. 57da58800fSPaul Luse 58da58800fSPaul Luse## Configuration {#componentname_pg_config} 59da58800fSPaul Luse 60da58800fSPaul LuseThis section should describe the mechanisms for configuring the component at a high level (i.e. you can configure it 61da58800fSPaul Luseusing a config file, or you can configure it using RPC calls over a unix domain socket). It should also talk about 62da58800fSPaul Lusewhen you can configure it - i.e. at run time or only up front. For specifics about how the RPCs work or the config 63da58800fSPaul Lusefile format, link to the appropriate user guide instead of putting that information here. 64da58800fSPaul Luse 65da58800fSPaul Luse## Component Detail {#componentname_pg_component} 66da58800fSPaul Luse 67da58800fSPaul LuseThis is where we can provide some design level detail if it makes sense for this module. We don't want to have 68da58800fSPaul Lusedesign docs as part of SPDK, the overhead and maintenance is too much for open source. We do, however, want 69da58800fSPaul Luseto provide some level of insight into the codebase to promote getting more people involved and understanding 70da58800fSPaul Luseof what the design is all about. The PG is meant to help a developer write their own application but we 71da58800fSPaul Lusecan use this section, per module, to test out a way to build out some internal design info as well. I see 721f813ec3SChen Wangthis as including an overview of key structures, concepts, etc., of the module itself. So, interesting info 73da58800fSPaul Lusenot required to write an application using the module but maybe just enough to provide the next level of 741f813ec3SChen Wangdetail into what's behind the scenes to get someone more interested in becoming a community contributor. 75da58800fSPaul Luse 76da58800fSPaul Luse## Sequences {#componentname_pg_sequences} 77da58800fSPaul Luse 78da58800fSPaul LuseIf sequence diagrams makes sense for this module, use mscgen to create simple UML-style (they don't need to be 100% 79da58800fSPaul LuseUML compliant) diagrams for the API that an application needs to interact with. Details internal to the component 80da58800fSPaul Luseshould not be included. 81