Bug 648966

Summary: DEVICETYPE isn't calculated correctly for IPoIB child interfaces
Product: Red Hat Enterprise Linux 6 Reporter: Bill Nottingham <notting>
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: azelinka, monis, notting, plautrba, rvokal
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: initscripts-9.03.18-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 648524 Environment:
Last Closed: 2011-05-19 13:51:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 648524    
Bug Blocks:    

Description Bill Nottingham 2010-11-02 16:03:17 UTC
+++ This bug was initially created as a clone of Bug #648524 +++

Description of problem:
IPoIB child interface is a network interface over InfiniBand that works with the non default partition (i.e. not 0xffff). The name format of a child interface is ibX.abcd where X is the index of the HCA/port and abcd is the partition.
For the default partition the name of the interface is simply ibX (the .ffff is not present)
 
Now, the variable DEVICETYPE is calculated in 2 steps
1. if the TYPE variable is defined in ifcfg-ibX.abcd then DEVICETYPE is gets a value via a translation list
2. if step 1. yields not result then the value is calculated from the interface name by omitting the digits (e.g. ib0 --> ib)

Later on the variable DEVICETYPE is used to handle the specific interface according to it's special needs. For instance calling ifup-${DEVICETYPE}

For IPoIB child interface the calculation of DEVICETYPE gives wrong value (should be ib) since there is no translation for TYPE=InfiniBand (step 1.) and the formula of omitting the digits is wrong (it doesn't ommit the . )

The results can be various, for example:  not calling ifup-ib and ifdown-ib as required.

Version-Release number of selected component (if applicable):

8.45.30

How reproducible:
Create a configuration for ib0.8001 and see that it is not carried out

Steps to Reproduce:
1. Install openib-1.4.1-3.el5.noarch.rpm (to get ifup-ib)
2. edit a configuration for ib0.8001
3. load IPoIB by modprobe ib_ipoib
4. create ib0.8001 by echo 0x8001 > /sys/class/net/ib0/create_child
5. run ifup ib0.8001
  
Actual results:

script /etc/sysconfig/network-scripts/ifup-eth is called

Expected results:
script /etc/sysconfig/network-scripts/ifup-eth


Additional info:
A suggested fix is

Index: OS-5.4/etc/sysconfig/network-scripts/network-functions
===================================================================
--- OS-5.4.orig/etc/sysconfig/network-scripts/network-functions 2010-10-31 14:46:44.000000000 +0200
+++ OS-5.4/etc/sysconfig/network-scripts/network-functions      2010-11-01 16:35:19.000000000 +0200
@@ -111,8 +111,10 @@
        GRE | IPIP)
                DEVICETYPE="tunnel"
                ;;
+       InfiniBand)
+               DEVICETYPE="ib"
     esac
-    [ -z "$DEVICETYPE" ] && DEVICETYPE=`echo ${DEVICE} | sed "s/[0-9]*$//"`
+    [ -z "$DEVICETYPE" ] && DEVICETYPE=`echo ${DEVICE} | sed -r 's/([^0-9]+).*/\1/'`
     [ -z "$REALDEVICE" -a -n "$PARENTDEVICE" ] && REALDEVICE=$PARENTDEVICE
     [ -z "$REALDEVICE" ] && REALDEVICE=${DEVICE%%:*}
     if [ "${DEVICE}" != "${REALDEVICE}" ]; then

--- Additional comment from monis on 2010-11-01 10:55:25 EDT ---

credits for the suggested fix belong to Nir Muchtar <nirm>

The report is also valid for RHEL6-beta

--- Additional comment from notting on 2010-11-01 11:03:06 EDT ---

I'm a little leery of changing the device name substitution in released RHEL - we do have other device types with '.' in them. However, adding an Infiniband mapping should be fine.

--- Additional comment from monis on 2010-11-02 03:53:36 EDT ---

Thanks. 2 things
1. Ethernet VLAN devices contain '.' in their names, don't they?
2. When do you expect the fix to be applied? Will it be in RHEL6?

--- Additional comment from monis on 2010-11-02 05:37:21 EDT ---

"we do have other device types with '.' in them"

I might have misunderstood this sentence in my previous answer.
Do you mean that you DO have other examples (besides IPoIB) for devices with '.' it their names? If so, how do you solve the DEVICETYPE issue?

--- Additional comment from notting on 2010-11-02 12:01:11 EDT ---

VLAN's the obvious example, but there's nothing that prevents users renaming their normal devices 'foo.bar' if they want.

--- Additional comment from notting on 2010-11-02 12:01:56 EDT ---

Mapping added in upstream commit 3a31255879036c3657d2503a40f320a94a9ee375, FWIW.

Comment 4 errata-xmlrpc 2011-05-19 13:51:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0647.html