staging: dpaa2-switch: handle Rx path on control interface
authorIoana Ciornei <ioana.ciornei@nxp.com>
Wed, 10 Mar 2021 12:14:44 +0000 (14:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Mar 2021 21:30:36 +0000 (13:30 -0800)
commit0b1b71370458860579831e77485883fcf2e8fbbe
tree7bb863a9da06b32c2353938ac3f64ce0c559f14e
parent04abc97d3ef789b018a7328e5069bcc6f44ff54a
staging: dpaa2-switch: handle Rx path on control interface

The dpaa2-ethsw supports only one Rx queue that is shared by all switch
ports. This means that information about which port was the ingress port
for a specific frame needs to be passed in metadata. In our case, the
Flow Context (FLC) field from the frame descriptor holds this
information. Besides the interface ID of the ingress port we also
receive the virtual QDID of the port. Below is a visual description of
the 64 bits of FLC.

63           47           31           15           0
+---------------------------------------------------+
|            |            |            |            |
|  RESERVED  |    IF_ID   |  RESERVED  |  IF QDID   |
|            |            |            |            |
+---------------------------------------------------+

Because all switch ports share the same Rx and Tx conf queues, NAPI
management takes into consideration when there is at least one switch
interface open to enable the NAPI instance.

The Rx path is common, for the most part, for both Rx and Tx conf with
the mention that each of them has its own consume function of a frame
descriptor. Dequeueing from a FQ, consuming dequeued store and also the
NAPI poll function is common between both queues.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/staging/fsl-dpaa2/ethsw/ethsw.c
drivers/staging/fsl-dpaa2/ethsw/ethsw.h