zlinux network configuration

There are several zSeries Network device drivers

  1.  QETH
  2.  LCS
  3.  CTC
  4.  IUCV
In the folowing article we’re dealing with qeth device driver.

 

The qeth device driver requires three I/O subchannels for each HiperSockets CHPID or OSA-Express CHPID in QDIO mode.

One subchannel is for control reads, one for control writes, and the third is for data.

The qeth device driver uses the QDIO protocol to communicate with the HiperSockets and OSA-Express adapter.

The three device bus-IDs that correspond to the subchannel triplet are grouped as one qeth group device.

The following rules apply for the device bus-IDs:

  1. read must be even. (e.g : fc04, 0f00,fc00)
  2. write must be the device bus-ID of the read subchannel plus one.
  3. data can be any free device bus-ID on the same CHPID.

You can configure different triplets of device bus-IDs on the same CHPID differently.

For example, if you have CHPID 0xfc, then you can configure

0.0.fc00,0.0.fc01,0.0.fc02

and

0.0.fc04,0.0.fc05,0.0.fc06

with different attribute values, for example for priority queueing.

 

 

“Cold” configuration files

  • HWCFG – Hardware devices – /etc/sysconfig/hardware
  • IFCFG – Logical interfaces – /etc/sysconfig/network

1:1 relationship

Naming convention:

[ hw | if ] cfg-<device type>-bus-<bus type>-<bus location>

Examples

#> cat /etc/sysconfig/hardware/hwcfg-qeth-bus-ccw-0.0.a000
CCW_CHAN_IDS='0.0.a000 0.0.a001 0.0.a002'
CCW_CHAN_MODE='OSAPORT'
CCW_CHAN_NUM='3'
MODULE='qeth'
MODULE_OPTIONS=''
SCRIPTDOWN='hwdown-ccw'
SCRIPTUP='hwup-ccw'
SCRIPTUP_ccw='hwup-ccw'
SCRIPTUP_ccwgroup='hwup-qeth'
STARTMODE='auto'
QETH_OPTIONS='fake_ll=1'

A sample hwcfg-file for QETH can be found at

/etc/sysconfig/hardware/skel/hwcfg-qeth
#> cat /etc/sysconfig/network/ifcfg-qeth-bus-ccw-0.0.a000
BOOTPROTO='static'
BROADCAST='10.1.255.255'
IPADDR='10.1.1.1'
NETMASK='255.255.0.0'
NETWORK='10.1.0.0'
STARTMODE='onboot'
PERSISTANT_NAME='eth1'

Each device is represented by couple of files

  1.  “HW” – hardware configuration
  2.  “IF” Logical configuration

Devices Are brought up/down with:

hwup/hwdown scripts

Interfaces Are brought up/down with:

ifup/ifdown scripts

as I mention before, we’re dealing QETH device driver here.

we can test our QETH device drivers by entering

cat /proc/qeth

OR

#> LSQETH

QETH Device Driver Supports:

  • OSA Express Fast Ethernet
  • Gigabit Ethernet
  • 10 Gbit Ethernet
  • Highspeed Tokenring
  • ATM (running Ethernet LAN Emulation)
  • z/VM GuestLAN Type QDIO
  •  Type Hiper
  • zSeries HiperSockets

Every device has Three I/O subchannels per stack:

  1.  Read device (control data <– OSA)
  2.  Write device (control data –> OSA)
  3.  Data device (network traffic)

the following is represented in the /etc/sysconfig/hardware/HW file:

CCW_CHAN_IDS are Read, Write, Data channels

There is completely another way to setup network interface, and it’s much easier

Load the QETH device driver module:

#> modprobe qeth

Create a new QETH device by grouping its CCW devices:

#> echo 0.0.b003,0.0.b004,0.0.b005 > /sys/bus/ccwgroup/drivers/qeth/group

Set optional attributes:

#> echo 64 > /sys/bus/ccwgroup/drivers/qeth/0.0.b004/buffer_count
#> echo 1 > /sys/devices/qeth/0.0.b004/fake_ll

Set the new device online

#> echo 1 > /sys/devices/qeth/0.0.b003/online

Lets see How it looks like on the Mainframe side:

Q VSWITCH
VSWITCH SYSTEM VSW1 STATUS IS READY.
DTCVSW1 is vswitch controller for 0503.P00
DTCVSW2 is vswitch controller for backup device 0506.P00

OK, a VSWITCH defined, and it appears to be using real OSA devices

  • • 503, 504 and 505
  • • with 506, 507 and 508 as the backup triplet

So for your Linux to connect to it, it would need a NICDEF in the user direct file.

NICDEF 1200 TYPE QDIO LAN SYSTEM VSW1

Note that 1200 it’s the virtual device number of VSW1 (0503,0504,0505)

Now we see:

# > cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ARP=no
BOOTPROTO=static
IPADDR=10.68.222.22
NETMASK=255.255.255.224
NETTYPE=qeth
ONBOOT=yes
SUBCHANNELS=0.0.1200,0.0.1201,0.0.1202

The SUBCHANNELS variable also show devices 503, 504 and 505 – however, these are virtual devices, not real devices.

If you were trying to use real OSA devices, you might use DEDICATED statement and have this in your Linux virtual machine’s directory entry:

DEDICATE 0503 0503
DEDICATE 0503 0503
DEDICATE 0503 0503

However, if you set the real and virtual OSA addresses to be the same,

then you might have this in the directory entry:

NICDEF 0503 TYPE QDIO LAN SYSTEM VSW1

Now we would also have to give the virtual machine access to the VSWITCH (because there is no unrestricted VSWTICHes)

SET VSWITCH VSW1 GRANT LINUX1

and now check who has access to VSW1

Q VSWITCH VSW1 ACC
Tagged with: , , , ,
Posted in zlinux