-
Notifications
You must be signed in to change notification settings - Fork 52
Adding support for IPoIB interfaces #297
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/bash | ||
|
|
||
| cd /etc/sysconfig/network-scripts | ||
| . ./network-functions | ||
| CONFIG=${1} | ||
| source_config | ||
|
|
||
| if is_true "${PKEY}" && [ "${TYPE}" = "Infiniband" ] ; then | ||
| # IPoIB support | ||
| if [ -d /sys/devices/virtual/net/${DEVICE} ]; then | ||
| ip link del "${DEVICE}" | ||
| fi | ||
| fi | ||
| exit 0 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -149,6 +149,29 @@ if is_true "${VLAN}" && is_false "$ISALIAS" && [ -n "$DEVICE" ]; then | |||||
| --prefix "/proc/sys/net/ipv6/conf/${DEVICE}" | ||||||
| fi | ||||||
|
|
||||||
| # IPoIB support | ||||||
| if is_true "${PKEY}" && [ "${TYPE}" = "Infiniband" ] ; then | ||||||
| MATCH='^.+\.[0-9]{1,4}$' | ||||||
| if [[ "${DEVICE}" =~ $MATCH ]]; then | ||||||
| PHYSDEV=${DEVICE%.*} | ||||||
| fi | ||||||
| if ! modprobe ib_ipoib >/dev/null 2>&1 ; then | ||||||
| net_log $"No IPoIB support available in kernel for device ${DEVICE}" | ||||||
| exit 1 | ||||||
| fi | ||||||
| if [ -d /sys/devices/virtual/net/${DEVICE} ]; then | ||||||
| check_device_down ${DEVICE} && { ip -o link set dev ${DEVICE} up; } | ||||||
| else | ||||||
| ip link add dev ${DEVICE} link ${PHYSDEV} type ipoib pkey ${PKEY_ID} || { | ||||||
| (/usr/bin/logger -p daemon.info -t ifup \$"ERROR: could not add | ||||||
|
||||||
| (/usr/bin/logger -p daemon.info -t ifup \$"ERROR: could not add | |
| (/usr/bin/logger -p daemon.info -t ifup $"ERROR: could not add |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This unconditional exit prevents the rest of the ifup script from executing. IPoIB interfaces still need IP configuration, DHCP setup, and other standard network interface initialization that occurs after this block.
| exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PHYSDEV extraction logic has a flaw: if the DEVICE doesn't match the regex pattern, PHYSDEV remains unset, but it's still used later in line 165. This will cause the ip link add command to fail with an empty link parameter.