enetc: Add dynamic allocation of extended Rx BD rings
authorClaudiu Manoil <claudiu.manoil@nxp.com>
Tue, 10 Mar 2020 12:51:24 +0000 (14:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Mar 2020 22:48:54 +0000 (15:48 -0700)
commit434cebabd3a2470881dd69fe65c0986c470b6fb8
tree363680c0ab8decb5043ea42f1f7ceb268885845c
parent714239ac630a85919839f200d4499b7f811c7003
enetc: Add dynamic allocation of extended Rx BD rings

Hardware timestamping support (PTP) on Rx requires extended
buffer descriptors, double the size of normal Rx descriptors.
On the current controller revision only the timestamping offload
requires extended Rx descriptors.
Since Rx timestamping can be turned on/off at runtime, make Rx ring
allocation configurable at runtime too. As a result, the static
config option FSL_ENETC_HW_TIMESTAMPING can be dropped and the
extended descriptors can be used only when Rx timestamping gets
activated.
The extension has the same size as the base descriptor, making
the descriptor iterators easy to update for the extended case.

Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/Kconfig
drivers/net/ethernet/freescale/enetc/enetc.c
drivers/net/ethernet/freescale/enetc/enetc.h
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
drivers/net/ethernet/freescale/enetc/enetc_hw.h