| 115 | |
| 116 | == IMX8M FEC Ethernet Interrupt Coalesence |
| 117 | The FEC Ethernet network interface controller on the IMX8MM and IMX8MP features interrupt coalesence which is enabled by default and increases packet latency for small numbers of packets. |
| 118 | |
| 119 | The purpose of the interrupt coalescing is to reduce the number of interrupts generated by the MAC so as to reduce the CPU loading. |
| 120 | |
| 121 | The default is to delay an RX and TX interrupt by 1ms or until 200 frames have occurred: |
| 122 | {{{#!bash |
| 123 | # ethtool --show-coalesce eth0 |
| 124 | Coalesce parameters for eth0: |
| 125 | Adaptive RX: off TX: off |
| 126 | stats-block-usecs: 0 |
| 127 | sample-interval: 0 |
| 128 | pkt-rate-low: 0 |
| 129 | pkt-rate-high: 0 |
| 130 | |
| 131 | rx-usecs: 1000 |
| 132 | rx-frames: 200 |
| 133 | rx-usecs-irq: 0 |
| 134 | rx-frames-irq: 0 |
| 135 | |
| 136 | tx-usecs: 1000 |
| 137 | tx-frames: 200 |
| 138 | tx-usecs-irq: 0 |
| 139 | tx-frames-irq: 0 |
| 140 | |
| 141 | rx-usecs-low: 0 |
| 142 | rx-frames-low: 0 |
| 143 | tx-usecs-low: 0 |
| 144 | tx-frames-low: 0 |
| 145 | |
| 146 | rx-usecs-high: 0 |
| 147 | rx-frames-high: 0 |
| 148 | tx-usecs-high: 0 |
| 149 | tx-frames-high: 0 |
| 150 | }}} |
| 151 | |
| 152 | This would cause a packet latency of >1ms for light network activity. |
| 153 | |
| 154 | This can be modified using the userspace 'ethtool': |
| 155 | {{{#!bash |
| 156 | # default is 1000us 200 frames, change to 1/1 |
| 157 | ethtool --coalesce eth0 tx-usecs 1 |
| 158 | ethtool --coalesce eth0 tx-frames 1 |
| 159 | ethtool --coalesce eth0 rx-usecs 1 |
| 160 | ethtool --coalesce eth0 rx-frames 1 |
| 161 | }}} |
| 162 | - ping times now will be < 0.5ms |
| 163 | |
| 164 | And if you wanted to change it back to defaults for example: |
| 165 | {{{#!bash |
| 166 | # change back to default |
| 167 | ethtool --coalesce eth0 tx-usecs 1000 |
| 168 | ethtool --coalesce eth0 tx-frames 200 |
| 169 | ethtool --coalesce eth0 rx-usecs 1000 |
| 170 | ethtool --coalesce eth0 rx-frames 200 |
| 171 | }}} |
| 172 | - ping times now will be >1ms |
| 173 | |