Bug 648524 - DEVICETYPE isn't calculated correctly for IPoIB child interfaces
Summary: DEVICETYPE isn't calculated correctly for IPoIB child interfaces
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts
Version: 5.4
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 648523 (view as bug list)
Depends On:
Blocks: 648966 668576
TreeView+ depends on / blocked
 
Reported: 2010-11-01 14:53 UTC by Moni Shoua
Modified: 2011-07-21 12:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, the /sysconfig/network-scripts/network-functions script calculated wrong value of the DEVICETYPE variable for IPoIB (IP over Infiniband) child interfaces. Subsequently, the variable could not be used to handle the specific need of the interface, such as calling the "ifup-${DEVICETYPE}" script. This bug has been fixed and the DEVICETYPE variable value is now calculated correctly for IPoIB interfaces.
Clone Of:
: 648966 (view as bug list)
Environment:
Last Closed: 2011-07-21 08:37:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1081 0 normal SHIPPED_LIVE initscripts bug fix and enhancement update 2011-07-21 08:33:52 UTC

Description Moni Shoua 2010-11-01 14:53:08 UTC
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

Comment 1 Moni Shoua 2010-11-01 14:55:25 UTC
credits for the suggested fix belong to Nir Muchtar <nirm>

The report is also valid for RHEL6-beta

Comment 2 Bill Nottingham 2010-11-01 15:03:06 UTC
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.

Comment 3 Moni Shoua 2010-11-02 07:53:36 UTC
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?

Comment 4 Moni Shoua 2010-11-02 09:37:21 UTC
"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?

Comment 5 Bill Nottingham 2010-11-02 16:01:11 UTC
VLAN's the obvious example, but there's nothing that prevents users renaming their normal devices 'foo.bar' if they want.

Comment 6 Bill Nottingham 2010-11-02 16:01:56 UTC
Mapping added in upstream commit 3a31255879036c3657d2503a40f320a94a9ee375, FWIW.

Comment 7 Moni Shoua 2010-11-02 16:11:39 UTC
(In reply to comment #6)
> Mapping added in upstream commit 3a31255879036c3657d2503a40f320a94a9ee375,
> FWIW.

Can you send please a link to the gitweb? Alternatively, could you please send the diff of this commit?

Comment 10 Bill Nottingham 2011-03-18 20:56:37 UTC
*** Bug 648523 has been marked as a duplicate of this bug. ***

Comment 14 Tomas Capek 2011-07-13 12:30:39 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, the /sysconfig/network-scripts/network-functions script calculated wrong value of the DEVICETYPE variable for IPoIB (IP over Infiniband) child interfaces. Subsequently, the variable could not be used to handle the specific need of the interface, such as calling the "ifup-${DEVICETYPE}" script. This bug has been fixed and the DEVICETYPE variable value is now calculated correctly for IPoIB interfaces.

Comment 15 errata-xmlrpc 2011-07-21 08:37:14 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-1081.html

Comment 16 errata-xmlrpc 2011-07-21 12:40:05 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-1081.html


Note You need to log in before you can comment on or make changes to this bug.