RSS is not efficient when forwarding
Subsystems (2)
Hi,
I have a simple router setup which forwards traffic from one ixgbe 82599ES to another ixgbe of the same model.
kernel: 3.16.0-rc2-00262-ga921e2a
p2p1: 192.168.155.1/24 is the gateway of the LAN
p2p2: 192.168.156.1/24 is the gateway of the other LAN
While the ARP is resolving, I can see the packets being spread among all the 8 queues (8 online CPUs) available and that is fine.
However, as soon as the TCP traffic starts, all streams are merged to rx-queue-0 which overwhelms one single CPU, so the total throughput is about 4Gbits/sec.
I can see the driver sending different skb->hash for each stream, so it can't be the NIC.
Also, if I run a local http on the router, the skb->hash pattern doesn't change, but the workload is spread among all CPUs.
debug output while reproducing all the streams on rx-queue-0:
[...]
[11685.885093] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0xC2AF4A27 [11685.891454] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0x8C5B749D [11685.897820] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0xA33BA6D5 [11690.845032] net_ratelimit: 3276406 callbacks suppressed
[...]
Any idea why all TCP streams are going to a single rx queue?
Thanks,
fbl
Re: RSS is not efficient when forwarding (ixgbe)
Quoted 24 lines · Flavio Leitner
Hi,
I have a simple router setup which forwards traffic from one ixgbe 82599ES to another ixgbe of the same model.
kernel: 3.16.0-rc2-00262-ga921e2a
p2p1: 192.168.155.1/24 is the gateway of the LAN
p2p2: 192.168.156.1/24 is the gateway of the other LANWhile the ARP is resolving, I can see the packets being spread among all the 8 queues (8 online CPUs) available and that is fine.
However, as soon as the TCP traffic starts, all streams are merged to rx-queue-0 which overwhelms one single CPU, so the total throughput is about 4Gbits/sec.
I can see the driver sending different
skb->hashfor each stream, so it can't be the NIC.Also, if I run a local http on the router, the
skb->hashpattern doesn't change, but the workload is spread among all CPUs.
Quoted 7 lines
debug output while reproducing all the streams on rx-queue-0:
[...][11685.885093] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0xC2AF4A27 [11685.891454] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0x8C5B749D [11685.897820] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0xA33BA6D5 [11690.845032] net_ratelimit: 3276406 callbacks suppressed[...]
The command 'ehtool -S p2p1 | grep rx_queue' shows only rx queue #0 receiving packets. Also, /proc/interrupts shows only p2p1-TxRx-0 generating interrupts.
Nothing changes when I start irqbalance in the middle of the test. However, if I create new streams, they are correctly distributed among the NIC queues/irqs/CPUs.
I have tried the same setup and test with another card (bnx2, 1GbE) and all queues got traffic by default though they were all assigned to CPU#0 (no irqbalance), so this is expected and makes me think this is specific to the ixgbe driver.
Any ideas?
Thanks,
fbl
Re: RSS is not efficient when forwarding (ixgbe)
Quoted 33 lines · Flavio Leitner
Quoted 24 lines · Flavio Leitner
Hi,
I have a simple router setup which forwards traffic from one ixgbe 82599ES to another ixgbe of the same model.
kernel: 3.16.0-rc2-00262-ga921e2a
p2p1: 192.168.155.1/24 is the gateway of the LAN
p2p2: 192.168.156.1/24 is the gateway of the other LANWhile the ARP is resolving, I can see the packets being spread among all the 8 queues (8 online CPUs) available and that is fine.
However, as soon as the TCP traffic starts, all streams are merged to rx-queue-0 which overwhelms one single CPU, so the total throughput is about 4Gbits/sec.
I can see the driver sending different
skb->hashfor each stream, so it can't be the NIC.Also, if I run a local http on the router, the
skb->hashpattern doesn't change, but the workload is spread among all CPUs.Quoted 7 lines
debug output while reproducing all the streams on rx-queue-0:
[...][11685.885093] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0xC2AF4A27 [11685.891454] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0x8C5B749D [11685.897820] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0xA33BA6D5 [11690.845032] net_ratelimit: 3276406 callbacks suppressed[...]
Quoted 8 lines
The command 'ehtool -S p2p1 | grep
rx_queue' shows only rx queue #0 receiving packets. Also,/proc/interruptsshows only p2p1-TxRx-0 generating interrupts.Nothing changes when I start irqbalance in the middle of the test. However, if I create new streams, they are correctly distributed among the NIC queues/irqs/CPUs.
Could this be interaction with flow director? Is the application running on just one CPU?
Quoted 13 lines
I have tried the same setup and test with another card (bnx2, 1GbE) and all queues got traffic by default though they were all assigned to CPU#0 (no irqbalance), so this is expected and makes me think this is specific to the ixgbe driver.
Any ideas?
Thanks,
fbl
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: RSS is not efficient when forwarding (ixgbe)
Quoted 38 lines · Tom Herbert
Quoted 37 lines · Flavio Leitner
Quoted 24 lines · Flavio Leitner
Hi,
I have a simple router setup which forwards traffic from one ixgbe 82599ES to another ixgbe of the same model.
kernel: 3.16.0-rc2-00262-ga921e2a
p2p1: 192.168.155.1/24 is the gateway of the LAN
p2p2: 192.168.156.1/24 is the gateway of the other LANWhile the ARP is resolving, I can see the packets being spread among all the 8 queues (8 online CPUs) available and that is fine.
However, as soon as the TCP traffic starts, all streams are merged to rx-queue-0 which overwhelms one single CPU, so the total throughput is about 4Gbits/sec.
I can see the driver sending different
skb->hashfor each stream, so it can't be the NIC.Also, if I run a local http on the router, the
skb->hashpattern doesn't change, but the workload is spread among all CPUs.Quoted 7 lines
debug output while reproducing all the streams on rx-queue-0:
[...][11685.885093] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0xC2AF4A27 [11685.891454] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0x8C5B749D [11685.897820] ixgbe_rx_skb:1713 skb(ffff880222a77200) hash: 0xA33BA6D5 [11690.845032] net_ratelimit: 3276406 callbacks suppressed[...]
The command 'ehtool -S p2p1 | grep
rx_queue' shows only rx queue #0 receiving packets. Also,/proc/interruptsshows only p2p1-TxRx-0 generating interrupts.
Quoted 6 lines
Quoted 4 lines
Nothing changes when I start irqbalance in the middle of the test. However, if I create new streams, they are correctly distributed among the NIC queues/irqs/CPUs.
Could this be interaction with flow director? Is the application running on just one CPU?
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Quoted 18 lines
Quoted 5 lines
I have tried the same setup and test with another card (bnx2, 1GbE) and all queues got traffic by default though they were all assigned to CPU#0 (no irqbalance), so this is expected and makes me think this is specific to the ixgbe driver.
Quoted 8 lines
Any ideas?
Thanks,
fbl
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: RSS is not efficient when forwarding (ixgbe)
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
Thanks,
-Don Skidmore <[email protected]>
Quoted 24 lines
Quoted 14 lines
Quoted 6 lines
I have tried the same setup and test with another card (bnx2, 1GbE) and all queues got traffic by default though they were all assigned to CPU#0 (no irqbalance), so this is expected and makes me think this is specific to the ixgbe driver.
Quoted 8 lines
Any ideas?
Thanks,
fbl
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.htmlQuoted 3 lines
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomoinfo
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
Re: RSS is not efficient when forwarding (ixgbe)
Quoted 9 lines · Donald C
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
That was it.
Thanks a lot
fbl
Re: RSS is not efficient when forwarding (ixgbe)
Flavio Leitner ([email protected]) wrote on 7 July 2014 21:28:
Quoted 12 lines · Donald C
Quoted 9 lines
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
That was it.
We have a similar setup and similar problem. How do we disable ATR? I tried to set ntuple off but this almost zeroed traffic. I also tried to change rx-flow-hash but ethtool says it's not possible. The docs say that one can disable ATR by setting AtrSampleRate to 0 but this parameter doesn't exist in 3.14.10.
So, how do we disable ATR and keep RSS?
Re: RSS is not efficient when forwarding (ixgbe)
Quoted 14 lines · Carlos Carvalho
Flavio Leitner ([email protected]) wrote on 7 July 2014 21:28:
Quoted 12 lines · Donald C
Quoted 9 lines
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
That was it.
Quoted 7 lines
We have a similar setup and similar problem. How do we disable ATR? I tried to set ntuple off but this almost zeroed traffic. I also tried to change rx-flow-hash but ethtool says it's not possible. The docs say that one can disable ATR by setting AtrSampleRate to 0 but this parameter doesn't exist in 3.14.10.
So, how do we disable ATR and keep RSS?
Keep in mind that this is actually 2 problems. One is enabling the NIC to receive the streams in all queues for this scenario (setting ntuple off and restarting the traffic works for me). The second problem is having all the queue interrupts spread among the CPUs. That's what does irqbalance, tuna, etc...
fbl
Re: RSS is not efficient when forwarding (ixgbe)
Flavio Leitner ([email protected]) wrote on 8 July 2014 14:21:
Quoted 21 lines · Carlos Carvalho
Quoted 20 lines
Flavio Leitner ([email protected]) wrote on 7 July 2014 21:28:
Quoted 12 lines · Donald C
Quoted 9 lines
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
That was it.
We have a similar setup and similar problem. How do we disable ATR? I tried to set ntuple off but this almost zeroed traffic. I also tried to change rx-flow-hash but ethtool says it's not possible. The docs say that one can disable ATR by setting AtrSampleRate to 0 but this parameter doesn't exist in 3.14.10.
Quoted 7 lines
Quoted 1 line
So, how do we disable ATR and keep RSS?
Keep in mind that this is actually 2 problems. One is enabling the NIC to receive the streams in all queues for this scenario (setting ntuple off and restarting the traffic works for me). The second problem is having all the queue interrupts spread among the CPUs. That's what does irqbalance, tuna, etc...
Spreading the interrupts among the cpus is not the issue for us. The problem is that the number of interrupts is *very* different among the irq's, so no matter how I distribute them among cores there will always be a few that get saturated while 70% of the machine capacity remains idle. Your case seems to be the extreme of ours, where all the flux goes to a single irq.
The problem is in how the NIC distributes traffic among the irq's in the router. Traffic comes almost only from a single machine and spreads through several thousand destinations in the internet. That's why I tried to set the receiving hash mode to the destination IP, but the NIC or driver refuses. So how do I even out the frequency of irq's?
Re: RSS is not efficient when forwarding (ixgbe)
Quoted 37 lines · Carlos Carvalho
Flavio Leitner ([email protected]) wrote on 8 July 2014 14:21:
Quoted 21 lines · Carlos Carvalho
Quoted 20 lines
Flavio Leitner ([email protected]) wrote on 7 July 2014 21:28:
Quoted 12 lines · Donald C
Quoted 9 lines
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
That was it.
We have a similar setup and similar problem. How do we disable ATR? I tried to set ntuple off but this almost zeroed traffic. I also tried to change rx-flow-hash but ethtool says it's not possible. The docs say that one can disable ATR by setting AtrSampleRate to 0 but this parameter doesn't exist in 3.14.10.
Quoted 7 lines
Quoted 1 line
So, how do we disable ATR and keep RSS?
Keep in mind that this is actually 2 problems. One is enabling the NIC to receive the streams in all queues for this scenario (setting ntuple off and restarting the traffic works for me). The second problem is having all the queue interrupts spread among the CPUs. That's what does irqbalance, tuna, etc...
Spreading the interrupts among the cpus is not the issue for us. The problem is that the number of interrupts is *very* different among the irq's, so no matter how I distribute them among cores there will always be a few that get saturated while 70% of the machine capacity remains idle. Your case seems to be the extreme of ours, where all the flux goes to a single irq.
Quoted 5 lines
The problem is in how the NIC distributes traffic among the irq's in the router. Traffic comes almost only from a single machine and spreads through several thousand destinations in the internet. That's why I tried to set the receiving hash mode to the destination IP, but the NIC or driver refuses. So how do I even out the frequency of irq's?
So you see the traffic going to a few queues only and the rest is idle, is that correct? If so, then RSS seems to be working, but since all the traffic comes from one server and likely one port, maybe the hash is not good enough to distribute among all queues. I'd try using software hashing instead of hw hashing to see if it helps:
# ethtool -K <iface> rxhash off
or using Perfect Filters, but then it depends on the traffic's specifics.
BTW, there was a typo in my previous post, I had to turn on ntuple to disable ATR.
fbl
Re: RSS is not efficient when forwarding (ixgbe)
Flavio Leitner ([email protected]) wrote on 9 July 2014 02:22:
Quoted 44 lines · Carlos Carvalho
Quoted 37 lines
Flavio Leitner ([email protected]) wrote on 8 July 2014 14:21:
Quoted 21 lines · Carlos Carvalho
Quoted 20 lines
Flavio Leitner ([email protected]) wrote on 7 July 2014 21:28:
Quoted 12 lines · Donald C
Quoted 9 lines
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
That was it.
We have a similar setup and similar problem. How do we disable ATR? I tried to set ntuple off but this almost zeroed traffic. I also tried to change rx-flow-hash but ethtool says it's not possible. The docs say that one can disable ATR by setting AtrSampleRate to 0 but this parameter doesn't exist in 3.14.10.
Quoted 7 lines
Quoted 1 line
So, how do we disable ATR and keep RSS?
Keep in mind that this is actually 2 problems. One is enabling the NIC to receive the streams in all queues for this scenario (setting ntuple off and restarting the traffic works for me). The second problem is having all the queue interrupts spread among the CPUs. That's what does irqbalance, tuna, etc...
Spreading the interrupts among the cpus is not the issue for us. The problem is that the number of interrupts is *very* different among the irq's, so no matter how I distribute them among cores there will always be a few that get saturated while 70% of the machine capacity remains idle. Your case seems to be the extreme of ours, where all the flux goes to a single irq.
Quoted 5 lines
The problem is in how the NIC distributes traffic among the irq's in the router. Traffic comes almost only from a single machine and spreads through several thousand destinations in the internet. That's why I tried to set the receiving hash mode to the destination IP, but the NIC or driver refuses. So how do I even out the frequency of irq's?
Quoted 7 lines
So you see the traffic going to a few queues only and the rest is idle, is that correct? If so, then RSS seems to be working, but since all the traffic comes from one server and likely one port, maybe the hash is not good enough to distribute among all queues. I'd try using software hashing instead of hw hashing to see if it helps:
# ethtool -K <iface> rxhash off
I'm all for using software instead of hardware. However, in this case this is a fundamental function of the NIC, to distribute the load among cores; if we do it via software, a single core (or subset of them) will have to do all the work. So in this particular case I think the correct way is to try to do it in the NIC.
Quoted 2 lines
BTW, there was a typo in my previous post, I had to turn on ntuple to disable ATR.
Ah. Here it was off by default, which contradicts what Donald said above... I turned it on, and nothing changed(?!). The nic was reset but the distribution among queues is the same.
I checked now and in fact the distribution is almost constant among 16 IRQ's. That's the problem, because it leaves the other 24 cores idle. Not completely, but the difference is 4 orders of
magnitude: 5.41e+08 interruptions in the active 16 IRQ's versus 6.36e+04 in the others. So 60% of the machine is just contributing to global warming and, importantly, limiting our performance :-(
Is there a configuration that expands the used IRQ's?
Re: RSS is not efficient when forwarding (ixgbe)
Quoted 53 lines · Carlos Carvalho
Flavio Leitner ([email protected]) wrote on 9 July 2014 02:22:
Quoted 44 lines · Carlos Carvalho
Quoted 37 lines
Flavio Leitner ([email protected]) wrote on 8 July 2014 14:21:
Quoted 21 lines · Carlos Carvalho
Quoted 20 lines
Flavio Leitner ([email protected]) wrote on 7 July 2014 21:28:
Quoted 12 lines · Donald C
Quoted 9 lines
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
That was it.
We have a similar setup and similar problem. How do we disable ATR? I tried to set ntuple off but this almost zeroed traffic. I also tried to change rx-flow-hash but ethtool says it's not possible. The docs say that one can disable ATR by setting AtrSampleRate to 0 but this parameter doesn't exist in 3.14.10.
Quoted 7 lines
Quoted 1 line
So, how do we disable ATR and keep RSS?
Keep in mind that this is actually 2 problems. One is enabling the NIC to receive the streams in all queues for this scenario (setting ntuple off and restarting the traffic works for me). The second problem is having all the queue interrupts spread among the CPUs. That's what does irqbalance, tuna, etc...
Spreading the interrupts among the cpus is not the issue for us. The problem is that the number of interrupts is *very* different among the irq's, so no matter how I distribute them among cores there will always be a few that get saturated while 70% of the machine capacity remains idle. Your case seems to be the extreme of ours, where all the flux goes to a single irq.
Quoted 5 lines
The problem is in how the NIC distributes traffic among the irq's in the router. Traffic comes almost only from a single machine and spreads through several thousand destinations in the internet. That's why I tried to set the receiving hash mode to the destination IP, but the NIC or driver refuses. So how do I even out the frequency of irq's?
Quoted 7 lines
So you see the traffic going to a few queues only and the rest is idle, is that correct? If so, then RSS seems to be working, but since all the traffic comes from one server and likely one port, maybe the hash is not good enough to distribute among all queues. I'd try using software hashing instead of hw hashing to see if it helps:
# ethtool -K <iface> rxhash off
Quoted 5 lines
I'm all for using software instead of hardware. However, in this case this is a fundamental function of the NIC, to distribute the load among cores; if we do it via software, a single core (or subset of them) will have to do all the work. So in this particular case I think the correct way is to try to do it in the NIC.
Actually no, you can use RPS with software hashing to distribute the workload. Take a look at Documentation/networking/scaling.txt for more details.
Quoted 6 lines
Quoted 2 lines
BTW, there was a typo in my previous post, I had to turn on ntuple to disable ATR.
Ah. Here it was off by default, which contradicts what Donald said above... I turned it on, and nothing changed(?!). The nic was reset but the distribution among queues is the same.
ntuple is about Perfect Filters and it's OFF by default which leaves ATR mode ON. In my case, ATR mode was responsible for directing all the packets to a single queue. Once I enable nutple, the driver disables ATR and that works for me.
Quoted 6 lines
I checked now and in fact the distribution is almost constant among 16 IRQ's. That's the problem, because it leaves the other 24 cores idle. Not completely, but the difference is 4 orders of
magnitude: 5.41e+08 interruptions in the active 16 IRQ's versus 6.36e+04 in the others. So 60% of the machine is just contributing to global warming and, importantly, limiting our performance :-(
How many NIC queues do you have? It sounds like you have only 16, so you're limited by the number of queues which maps to 16 CPUs. That's one case where RPS can be beneficial.
fbl
Re: RSS is not efficient when forwarding (ixgbe)
Flavio Leitner ([email protected]) wrote on 9 July 2014 22:14:
Quoted 60 lines · Carlos Carvalho
Quoted 53 lines
Flavio Leitner ([email protected]) wrote on 9 July 2014 02:22:
Quoted 44 lines · Carlos Carvalho
Quoted 37 lines
Flavio Leitner ([email protected]) wrote on 8 July 2014 14:21:
Quoted 21 lines · Carlos Carvalho
Quoted 20 lines
Flavio Leitner ([email protected]) wrote on 7 July 2014 21:28:
Quoted 12 lines · Donald C
Quoted 9 lines
Quoted 7 lines
It's a router forwarding traffic from one interface to another, so I guess it's only the kernel. BTW, no firewall.
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
That was it.
We have a similar setup and similar problem. How do we disable ATR? I tried to set ntuple off but this almost zeroed traffic. I also tried to change rx-flow-hash but ethtool says it's not possible. The docs say that one can disable ATR by setting AtrSampleRate to 0 but this parameter doesn't exist in 3.14.10.
Quoted 7 lines
Quoted 1 line
So, how do we disable ATR and keep RSS?
Keep in mind that this is actually 2 problems. One is enabling the NIC to receive the streams in all queues for this scenario (setting ntuple off and restarting the traffic works for me). The second problem is having all the queue interrupts spread among the CPUs. That's what does irqbalance, tuna, etc...
Spreading the interrupts among the cpus is not the issue for us. The problem is that the number of interrupts is *very* different among the irq's, so no matter how I distribute them among cores there will always be a few that get saturated while 70% of the machine capacity remains idle. Your case seems to be the extreme of ours, where all the flux goes to a single irq.
Quoted 5 lines
The problem is in how the NIC distributes traffic among the irq's in the router. Traffic comes almost only from a single machine and spreads through several thousand destinations in the internet. That's why I tried to set the receiving hash mode to the destination IP, but the NIC or driver refuses. So how do I even out the frequency of irq's?
Quoted 7 lines
So you see the traffic going to a few queues only and the rest is idle, is that correct? If so, then RSS seems to be working, but since all the traffic comes from one server and likely one port, maybe the hash is not good enough to distribute among all queues. I'd try using software hashing instead of hw hashing to see if it helps:
# ethtool -K <iface> rxhash offQuoted 5 lines
I'm all for using software instead of hardware. However, in this case this is a fundamental function of the NIC, to distribute the load among cores; if we do it via software, a single core (or subset of them) will have to do all the work. So in this particular case I think the correct way is to try to do it in the NIC.
Quoted 3 lines
Actually no, you can use RPS with software hashing to distribute the workload. Take a look at
Documentation/networking/scaling.txtfor more details.
Thanks for the pointer. I'll try that if there's no way to do it on the NIC.
Quoted 11 lines
Quoted 6 lines
Quoted 2 lines
BTW, there was a typo in my previous post, I had to turn on ntuple to disable ATR.
Ah. Here it was off by default, which contradicts what Donald said above... I turned it on, and nothing changed(?!). The nic was reset but the distribution among queues is the same.
ntuple is about Perfect Filters and it's OFF by default which leaves ATR mode ON. In my case, ATR mode was responsible for directing all the packets to a single queue. Once I enable nutple, the driver disables ATR and that works for me.
There does seem to be some confusion about this. However this thread is getting long and since it makes no difference for us I'd rather focus on our problem.
Quoted 9 lines
Quoted 6 lines
I checked now and in fact the distribution is almost constant among 16 IRQ's. That's the problem, because it leaves the other 24 cores idle. Not completely, but the difference is 4 orders of
magnitude: 5.41e+08 interruptions in the active 16 IRQ's versus 6.36e+04 in the others. So 60% of the machine is just contributing to global warming and, importantly, limiting our performance :-(How many NIC queues do you have? It sounds like you have only 16, so you're limited by the number of queues which maps to 16 CPUs.
40 for each NIC. The driver seems to configure the number of queues equal to the number of cores; in another machine with the same NIC but 32 cores there are 32 queues.
Does hyperthreading make a difference? There are actually only 20 cores. It seems that hyperthreading doesn't help for NIC interrrupt processing, so the card/kernel could just be ignoring the virtual cores. However, in this case it should not allocate queues for the virtual cores. Also, the number of interruptions in the virtual cores should be zero, but it isn't.
Further, why doesn't the NIC use all of the 20 real cores? Is it limited to power of 2 cores?
RE: RSS is not efficient when forwarding (ixgbe)
Quoted 109 lines
-----Original Message-----
From: Carlos Carvalho [mailto:[email protected]]
Sent: Thursday, July 10, 2014 5:12 PM
To: Flavio Leitner
Cc: Skidmore, Donald C; Tom Herbert; Linux Netdev List
Subject: Re: RSS is not efficient when forwarding (ixgbe)Flavio Leitner ([email protected]) wrote on 9 July 2014 22:14:
Quoted 7 lines · Carlos Carvalho
Quoted 6 lines
Flavio Leitner ([email protected]) wrote on 9 July 2014 02:22:
Quoted 5 lines · Carlos Carvalho
Quoted 4 lines
Flavio Leitner ([email protected]) wrote on 8 July 2014 14:21:
Quoted 3 lines · Carlos Carvalho
Quoted 2 lines
Flavio Leitner ([email protected]) wrote on 7 July 2014 21:28:
Quoted 1 line
On Mon, Jul 07, 2014 at 04:33:24PM +0000, Skidmore, Donald C
Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
It's a router forwarding traffic from one interface to another,
so I guess it's >> >> >> >> > only the kernel. BTW, no firewall.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Flow Director needs to be enabled and I am using defaults.
Flow Director in ATR mode is on by default for ixgbe. So like
Tom mentioned the driver will create hash buckets for egress packets. You could try disabling ATR and just use RSS. Which would probably be the right thing to do any way since Flow Director isn't very useful for routing scenarios.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
That was it.
We have a similar setup and similar problem. How do we disable
ATR? I >> >> >> tried to set ntuple off but this almost zeroed traffic. I also tried >> >> >> to change rx-flow-hash but ethtool says it's not possible. The
docs >> >> >> say that one can disable ATR by setting AtrSampleRate to 0 but this >> >> >> parameter doesn't exist in 3.14.10.Quoted 11 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
So, how do we disable ATR and keep RSS?
Keep in mind that this is actually 2 problems. One is enabling the >>
NIC to receive the streams in all queues for this scenario (setting >> >>
ntuple off and restarting the traffic works for me). The second problem >>
Quoted 5 lines
Quoted 5 lines
is having all the queue interrupts spread among the CPUs. That's what
Quoted 4 lines
Quoted 1 line
does irqbalance, tuna, etc...
Spreading the interrupts among the cpus is not the issue for us. The problem is that the number of interrupts is *very* different among
the >> >> irq's, so no matter how I distribute them among cores there will
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
always be a few that get saturated while 70% of the machine capacity remains idle. Your case seems to be the extreme of ours, where all >>
the flux goes to a single irq.
Quoted 2 lines
Quoted 2 lines
The problem is in how the NIC distributes traffic among the irq's in >>
the router. Traffic comes almost only from a single machine and >> >>
spreads through several thousand destinations in the internet. That's >> >> why I tried to set the receiving hash mode to the destination IP, but >> >>the NIC or driver refuses. So how do I even out the frequency of irq's?
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
So you see the traffic going to a few queues only and the rest is >>
idle, is that correct? If so, then RSS seems to be working, but >> >since all
the traffic comes from one server and likely one port, >> >maybe the hash is not good enough to distribute among all queues.
Quoted 5 lines
Quoted 1 line
Quoted 1 line
I'd try using software hashing instead of hw hashing to see if it >>
helps:
Quoted 3 lines
Quoted 1 line
# ethtool -K <iface> rxhash offI'm all for using software instead of hardware. However, in this case >>
this is a fundamental function of the NIC, to distribute the load >> among cores; if we do it via software, a single core (or subset of >> them) will have to do all the work. So in this particular case I think >> the correct way is to try to do it in the NIC.
Quoted 3 lines
Actually no, you can use RPS with software hashing to distribute the workload. Take a look at
Documentation/networking/scaling.txtfor >moredetails.
Thanks for the pointer. I'll try that if there's no way to do it on the NIC.
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
BTW, there was a typo in my previous post, I had to turn on ntuple to disable ATR.
Ah. Here it was off by default, which contradicts what Donald said >>
above... I turned it on, and nothing changed(?!). The nic was reset >> but the distribution among queues is the same.
Quoted 2 lines
ntuple is about Perfect Filters and it's OFF by default which leaves >ATR
mode ON. In my case, ATR mode was responsible for directing all >the packets to a single queue. Once I enable nutple, the driver >disables ATR and that works for me.
There does seem to be some confusion about this. However this thread is getting long and since it makes no difference for us I'd rather focus on our problem.
Quoted 1 line
Quoted 1 line
I checked now and in fact the distribution is almost constant among >> 16
IRQ's. That's the problem, because it leaves the other 24 >> cores idle. Not completely, but the difference is 4 orders of >> magnitude: 5.41e+08 interruptions in the active 16 IRQ's versus >> 6.36e+04 in the others. So 60% of the machine is just contributing to >> global warming and, importantly, limiting our performance :-( > >How many NIC queues do you have? It sounds like you have only 16, >so you're limited by the number of queues which maps to 16 CPUs.
40 for each NIC. The driver seems to configure the number of queues equal to the number of cores; in another machine with the same NIC but 32 cores there are 32 queues.
Quoted 8 lines
Does hyperthreading make a difference? There are actually only 20 cores. It seems that hyperthreading doesn't help for NIC interrrupt processing, so the card/kernel could just be ignoring the virtual cores. However, in this case it should not allocate queues for the virtual cores. Also, the number of interruptions in the virtual cores should be zero, but it isn't.
Further, why doesn't the NIC use all of the 20 real cores? Is it limited to power of 2 cores?
Hey Guys,
This is getting a bit difficult to read so I will just reply down here. :)
The ixgbe driver by default runs with ATR and RSS enabled. ATR is a form of flow director the other mode being perfect filter which is enabled, as mentioned above, by ntuple. ATR stands for application targeted receive, which mean we (the driver) create a hash bucket on ever SYN packet transmitted and returning packets of that flow will be scheduled to the same queue. Now since that packet could be created on any core we need to have one queue per core (including hyper threads). Any received packet that does not match an ATR hash bucket is then scheduled via RSS.
I believe you mentioned you were doing forwarding traffic, as you can imagine ATR is not that useful for traffic not tied to user space. As others suggested you could just turn off ATR and then all packets would be assigned a queue via RSS. Our RSS hash produces an output that is 4bits long, so the most we can spread out the load is over 16 queues. This is why you only see 16 interrupts in use if you only use RSS.
If you wanted to use all the queue and thus all the cores you could create your own filtering rules with perfect filter. This may be tricky as you would have to have a pretty good understanding of your flow patterns to balance the load evenly.
Thanks,
-Don Skidmore <[email protected]>