Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1073: Add support MSI/MSI-X interrupts during NIC queues configuration #1097

Merged
merged 5 commits into from
Nov 21, 2018

Conversation

aleksostapenko
Copy link
Contributor

No description provided.

Copy link
Contributor

@krizhanovsky krizhanovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge. Please just make the small improvement and add comments.

@@ -43,7 +43,8 @@ tdb_mod=tempesta_db
tfw_mod=tempesta_fw
declare -r LONG_OPTS="help,load,unload,start,stop,restart,reload"

declare devs=$(ip addr show up | awk '/^[0-9]+/ { sub(/:/, "", $2); print $2}')
declare devs=$(ip addr show up | grep -P '^[0-9]+' | grep -Pv '\bLOOPBACK\b' \
| awk '{ sub(/:/, "", $2); print $2}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment #1073 (comment) and/or later one, explaining why do we exclude loopback from RPS setup, would be useful here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

dev_irqs_path="/sys/class/net/$dev/device/msi_irqs"
irqs=($(grep $dev /proc/interrupts | sed -e 's/\s*\|:.*//g'))
if [ -z "$irqs" -a -d $dev_irqs_path ]; then
irqs=($(ls $dev_irqs_path))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The things are going complex, so please write a short (as above) comment why do we need the 2 sources to learn interrupts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment added.

echo "...set rx channels to $RXQ_MAX, please wait..."
# Set maximum number of available channels for better
# packets hashing.
ethtool -L $dev rx $RXQ_MAX >/dev/null 2>&1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do this with hands

root@9011:~# ethtool -L enp7s0 rx 128
rx unmodified, ignoring
no channel parameters changed, aborting
current values: tx 128 rx 8 other 0 combined 0

So we have the issue #1073 - we can not set the required number of channels and we shall not just silently ignore the error. Instead, please print a warning message so we'll be able to catch issues like #1073 quicker in future.

Copy link
Contributor

@krizhanovsky krizhanovsky Nov 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, why does the command fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - agree, error message should be added.
Command fails because the count of queues had already been set to 128 before the command invocation - so, repeated attempt for the same value is rejected.

Copy link
Contributor Author

@aleksostapenko aleksostapenko Nov 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message added.

Copy link
Contributor

@vankoven vankoven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, but a minor fix is required.

@@ -208,6 +208,15 @@ stop()
echo "...unload Tempesta modules"
unload_modules

systemctl status irqbalance.service >/dev/null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other irqbalance related functions are defined in tfw_lib.sh, please move this code there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


calc()
{
echo "$1" | bc -iq | tail -1
}

# Assigned IRQs can be reassigned by irqbalance. To avoid this, assigned vectors
# should be added to irqbalance config with '--banirq' option.
irqbalance_ban_irqs()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The third-party configuration file is modified here, so we need to add the good comment to document that the BAN_IRQ variable is automatically generated by the Tempesta. Also there is no need to modify the systemd service file and call systemd daemon-reload. We should only modify /etc/default/irqbalance in the following way:

# Generated by Tempesta to restrict rebalancing for NIC irqs.... 
TFW_BAN_IRQS="--banirq ..." 

IRQBALANCE_ARGS="$TFW_BAN_IRQS"

And don't forget the quotes around BAN_IRQS value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem possible to pass TFW_BAN_IRQ via IRQBALANCE_ARGS since systemd does not expand nested variables in files mentioned in EnvironmentFile directive: it interprets them in key -> value manner.
Comment has been added.

@aleksostapenko aleksostapenko merged commit 774869c into master Nov 21, 2018
@aleksostapenko aleksostapenko deleted the ao-1073 branch November 21, 2018 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants