Gang Deng
Gang Deng

Reputation: 13

How to let kernel send out a ethernet frame large than 1514?

Here's a network performance issue. On my board there's a Gbit ethernet phy, the Tx speed is much poorer than Rx speed when I test network bandwidth with iperf. After comparing the package which is captured by Wireshark, can find that the board always send out Ethernet frame in 1514 bytes, while it can receive in larger Ethernet frame, which is up to 64k.

This is why Tx performance poor than Rx performance. iperf send data in 128k per send, in kernel it always segment it into 1514 bytes and send to the network driver.

I traced the sku-len when send data, log as bellow. I guess there's some feature in kernel can send large Ethernet frame, but which is it?

I tried to change mtu to 8000 by ifconfig eth0 mtu 8000 command, but no improvement.

[  128.449334] TCP: Gang tcp_sendmsg 1176 msg->msg_iter.count=31216,size_goal=65160,copy=11640,max=65160
[  128.449377] TCP: Gang tcp_transmit_skb skb->len=46336
[  128.449406] Gang ip_output skb-len=46388
[  128.449416] Gang ip_finish_output2 skb->len=46388
[  128.449422] Gang sch_direct_xmit skb->len=46402
[  128.449499] Gang dev_hard_start_xmit skb->len=1514
[  128.449503] Gang dwmac_xmit skb->len=1514
[  128.449522] Gang dev_hard_start_xmit skb->len=1514  <>
[  128.449528] Gang dwmac_xmit skb->len=1514

Upvotes: 1

Views: 353

Answers (2)

Gang Deng
Gang Deng

Reputation: 13

By use ethtool -k eth0, find that tx-tcp-segmentation is off(fixed). To enable it, need turn on NETIF_F_TSO in mac driver. But unluckily, my driver crashes after enable this feature. It is another problem. Thank you Jeff S

Upvotes: 0

Jeff S.
Jeff S.

Reputation: 461

What you're seeing (TX 1500 and RX 65K) is most likely due to TCP LRO and LSO - Large Receive Offload and Large Send Offload. Rather than having the OS segment or reassemble the packets, this function is passed off to the NIC to reduce the load on the CPU and improve overall performance.

You can use ethtool to verify if either are set, or enable/disable the offload function.

Upvotes: 0

Related Questions