net: enetc: bring "bool extended" to top-level in enetc_open()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 17 Jan 2023 23:02:28 +0000 (01:02 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Jan 2023 04:52:25 +0000 (20:52 -0800)
commitd075db51e013a7a6bea189c7f6824f458b621626
tree5ab8fd5f335b25d262e562bac32150ff69c41244
parentbbd6043f74e139a58052b34df3a4b87da7df00bb
net: enetc: bring "bool extended" to top-level in enetc_open()

Extended RX buffer descriptors are necessary if they carry RX
timestamps, which will be true when PTP timestamping is enabled.

Right now, the rx_ring->ext_en is set from the function that allocates
ring resources (enetc_alloc_rx_resources() -> enetc_alloc_rxbdr()), and
also used later, in enetc_setup_rxbdr(). It is also used in the
enetc_rxbd() and enetc_rxbd_next() fast path helpers.

We want to decouple resource allocation from BD ring setup, but both
procedures depend on BD size (extended or not). Move the "extended"
boolean to enetc_open() and pass it both to the RX allocation procedure
as well as to the RX ring setup procedure. The latter will set
rx_ring->ext_en from now on.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc.c