Skip to content

Commit cded2e0

Browse files
Danielmachonkuba-moo
authored andcommitted
net: sparx5: activate FDMA tx in start()
The function sparx5_fdma_tx_activate() is responsible for configuring the TX FDMA instance and activating the channel. TX activation has previously been done in the xmit() function, when the first frame is transmitted. Now that we have separate functions for starting and stopping the FDMA, it seems reasonable to move the TX activation to the start function. This change has no implications on the functionality. Reviewed-by: Steen Hegelund <[email protected]> Signed-off-by: Daniel Machon <[email protected]> Link: https://patch.msgid.link/20250113-sparx5-lan969x-switch-driver-5-v2-3-c468f02fd623@microchip.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b91dcb2 commit cded2e0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ int sparx5_fdma_xmit(struct sparx5 *sparx5, u32 *ifh, struct sk_buff *skb)
217217
{
218218
struct sparx5_tx *tx = &sparx5->tx;
219219
struct fdma *fdma = &tx->fdma;
220-
static bool first_time = true;
221220
void *virt_addr;
222221

223222
fdma_dcb_advance(fdma);
@@ -238,12 +237,8 @@ int sparx5_fdma_xmit(struct sparx5 *sparx5, u32 *ifh, struct sk_buff *skb)
238237
FDMA_DCB_STATUS_BLOCKO(0) |
239238
FDMA_DCB_STATUS_BLOCKL(skb->len + IFH_LEN * 4 + 4));
240239

241-
if (first_time) {
242-
sparx5_fdma_tx_activate(sparx5, tx);
243-
first_time = false;
244-
} else {
245-
sparx5_fdma_reload(sparx5, fdma);
246-
}
240+
sparx5_fdma_reload(sparx5, fdma);
241+
247242
return NETDEV_TX_OK;
248243
}
249244

@@ -456,6 +451,7 @@ static u32 sparx5_fdma_port_ctrl(struct sparx5 *sparx5)
456451
int sparx5_fdma_start(struct sparx5 *sparx5)
457452
{
458453
struct sparx5_rx *rx = &sparx5->rx;
454+
struct sparx5_tx *tx = &sparx5->tx;
459455

460456
netif_napi_add_weight(rx->ndev,
461457
&rx->napi,
@@ -465,6 +461,7 @@ int sparx5_fdma_start(struct sparx5 *sparx5)
465461
napi_enable(&rx->napi);
466462

467463
sparx5_fdma_rx_activate(sparx5, rx);
464+
sparx5_fdma_tx_activate(sparx5, tx);
468465

469466
return 0;
470467
}

0 commit comments

Comments
 (0)