net: docs: update the sample code in driver.rst
authorJakub Kicinski <kuba@kernel.org>
Wed, 12 Apr 2023 01:50:36 +0000 (18:50 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 13 Apr 2023 11:30:21 +0000 (13:30 +0200)
commit50762d9af307b1c466fe0e1441c7923975927d98
treeefaa9e600ea0c3313d01b7904a7996ec5ae993f5
parent21cdc87fa9d8e0f0104db5499a16e2be1f53516a
net: docs: update the sample code in driver.rst

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>
Documentation/networking/driver.rst