summaryrefslogtreecommitdiffstats
path: root/Documentation/networking/driver.rst
Commit message (Collapse)AuthorAgeFilesLines
* net: docs: update the sample code in driver.rstJakub Kicinski2023-04-131-34/+27
| | | | | | | | | | | | | | The sample code talks about single-queue devices and uses locks. Update it to something resembling more modern code. Make sure we mention use of READ_ONCE() / WRITE_ONCE(). Change the comment which talked about consumer on the xmit side. AFAIU xmit is the producer and completions are a consumer. Reviewed-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
* net: provide macros for commonly copied lockless queue stop/wake codeJakub Kicinski2023-04-101-0/+6
| | | | | | | | | | | | | | | | | | | A lot of drivers follow the same scheme to stop / start queues without introducing locks between xmit and NAPI tx completions. I'm guessing they all copy'n'paste each other's code. The original code dates back all the way to e1000 and Linux 2.6.19. Smaller drivers shy away from the scheme and introduce a lock which may cause deadlocks in netpoll. Provide macros which encapsulate the necessary logic. The macros do not prevent false wake ups, the extra barrier required to close that race is not worth it. See discussion in: https://lore.kernel.org/all/c39312a2-4537-14b4-270c-9fe1fbb91e89@gmail.com/ Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* docs: net: use C syntax highlight in driver.rstJakub Kicinski2023-04-101-10/+20
| | | | | | | | Use syntax highlight, comment out the "..." since they are not valid C. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* docs: net: move the probe and open/close sections of driver.rst upJakub Kicinski2023-04-101-27/+27
| | | | | | | | Somehow it feels more right to start from the probe then open, then tx... Much like the lifetime of the driver itself. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* docs: net: reformat driver.rst from a list to sectionsJakub Kicinski2023-04-101-35/+56
| | | | | | | | | | | | | driver.rst had a historical form of list of common problems. In the age os Sphinx and rendered documentation it's better to use the more usual title + text format. This will allow us to render kdoc into the output more naturally. No changes to the actual text. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* Documentation: networking: correct possessive "its"Randy Dunlap2022-08-311-1/+1
| | | | | | | | | | | | | Change occurrences of "it's" that are possessive to "its" so that they don't read as "it is". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Eric Dumazet <edumazet@google.com> Cc: Paolo Abeni <pabeni@redhat.com> Cc: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/20220829235414.17110-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* docs: networking: convert driver.txt to ReSTMauro Carvalho Chehab2020-04-281-0/+97
- add SPDX header; - add a document title; - mark code blocks and literals as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>