The 03/18/2022 12:07, Michael Walle wrote:
> Currently when injecting or extracting a frame from CPU, the frame
> is given to the HW each word at a time. There is another way to
> inject/extract frames from CPU using FDMA(Frame Direct Memory Access).
> In this way the entire frame is given to the HW. This improves both
> RX and TX bitrate.
I wanted to test this. ping and such works fine and I'm also
seeing fdma interrupts.
Thanks for testing this also on your board.
But as soon as I try iperf3 I get a skb_panic
(due to frame size?). Hope that splash below helps.
I have not seen this issue. But it looks like it is a problem that there
is no more space to add the FCS.
Can you tell me how you run iperf3 so I can also try it?
Also I have a small diff that might fix the issue:
---
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
@@ -534,6 +534,8 @@ int lan966x_fdma_xmit(struct sk_buff *skb, __be32
*ifh, struct net_device *dev)
struct lan966x_tx_dcb *next_dcb, *dcb;
struct lan966x_tx *tx = &lan966x->tx;
struct lan966x_db *next_db;
+ int needed_headroom;
+ int needed_tailroom;
dma_addr_t dma_addr;
int next_to_use;
int err;
@@ -554,10 +556,11 @@ int lan966x_fdma_xmit(struct sk_buff *skb,
__be32 *ifh, struct net_device *dev)
/* skb processing */
skb_tx_timestamp(skb);
- if (skb_headroom(skb) < IFH_LEN * sizeof(u32)) {
- err = pskb_expand_head(skb,
- IFH_LEN * sizeof(u32) -
skb_headroom(skb),
- 0, GFP_ATOMIC);
+ needed_headroom = max_t(int, IFH_LEN * sizeof(u32) -
skb_headroom(skb), 0);
+ needed_tailroom = max_t(int, ETH_FCS_LEN - skb_tailroom(skb), 0);
+ if (needed_headroom || needed_tailroom) {
+ err = pskb_expand_head(skb, needed_headroom, needed_tailroom,
+ GFP_ATOMIC);
if (unlikely(err)) {
dev->stats.tx_dropped++;
err = NETDEV_TX_OK;