Configuring Driver Parameters

 < Day Day Up > 

This section describes how to configure the driver parameters used by the networking adapter. This section contains the following topics:

  • Setting networking driver parameters using the ndd utility

  • Reboot persistence with driver.conf

Setting Network Driver Parameters Using the ndd Utility

Many of the network drivers allow you to configure device driver parameters dynamically while the system is running using the ndd utility. Once configured using ndd, those parameters are only valid until you reboot the system hence the requirement for boot persistence, which is provided by driver.conf.

The following sections describe how you can use the ndd utility to modify (with the -set option) or display (with the -get option) the parameters for a network driver and individual devices.

To Specify Device Instances for the ndd Utility

There are two ways to specify the ndd command line based on the type of networking driver style. The difference in style can be established by looking at the /dev directory for the driver node.

  • Style 1 drivers have a /dev/name instance symbolic link to a physical network device instance.

  • Style 2 drivers have a /dev/name symbolic link to a physical network device instance.

Once the style is established, the way you use the ndd command has to be adjusted, as the way of getting exclusive access to the device instance with ndd is different based on the style.

1. Determine the style of driver you're using.

  1. If there exists a Style 1 node /dev/name instance, then you can use the Style 1 command form.

     # ndd /dev/bge0 -get adv_autoneg_cap 1 # ndd /dev/bge0 -set adv_autoneg_cap 0 # ndd /dev/bge0 -get adv_autoneg_cap 0 

  2. If there exists a Style 2 node /dev/name, then you cannot use the Style 1 form. You must use the Style 2 form. This requires an initial step, which is to set the configuration context.

 # ndd /dev/hme -set instance 0 

2. Once you are pointing to the correct instance, you can alter as many parameters as required for that instance.

 # ndd /dev/hme -set instance 0 

In all networking drivers, the instance number is allocated at the time of enumeration once the adapter is installed. The instance number is recorded permanently in the /etc/path_to_inst file. Take note of the instance numbers in /etc/path_to_inst so you can configure the instance using ndd.

 # grep ce /etc/path_to_inst "/pci@1f,2000/pci@1/network@0" 2 "ce" "/pci@1f,2000/pci@2/network@0" 1 "ce" "/pci@1f,2000/pci@4/network@0" 0 "ce" 

The instance association is shown in bold italics and can be used in both the configuration styles.

The preceding examples show the ndd utility being used in the non-interactive mode. In that mode, only one parameter can be modified per command line. There is also an interactive mode that allows you to enter an ndd shell where you can read or issue writes to ndd parameters associated with a device.

Using the ndd Utility in Non-interactive Mode

In the non-interactive mode, the command line allows you to read (get) the current setting of the parameter or write (set) a new setting to a parameter.

 # ndd device node -[get/set] parameter [value] 

This mode assumes that you remember all the parameter options of the network interface.

Using the ndd Utility in Interactive Mode

The ndd utility offers an interactive mode that allows you to query the parameters that you can read or write. The interactive mode is entered by simply pointing the ndd at a particular device instance or (in the case of Style 2) a driver instance.

 # ndd device node 

If ndd is pointed to a device node that can only be a Style 1 device, then ndd is already pointing to a device instance.

 # ndd /dev/bge0 

If the device node can be a Style 2 device, then ndd is pointing to a driver and not necessarily a device instance. Therefore, you must always first set the instance variable to ensure that ndd is pointing to the right device instance before configuration begins.

 # ndd /dev/ce name to get/set? instance value ? 0 

A very useful feature of ndd is the ? query, which you can use to get a list of possible parameters that a particular driver supports.

 # ndd /dev/ce name to get/set ? ? ?                                     (read only) instance                              (read and write) adv_autoneg_cap                       (read and write) adv_1000fdx_cap                       (read and write) adv_1000hdx_cap                       (read and write) adv_100T4_cap                         (read and write) adv_100fdx_cap                        (read and write) adv_100hdx_cap                        (read and write) adv_10fdx_cap                         (read and write) adv_10hdx_cap                         (read and write) adv_asmpause_cap                      (read and write) adv_pause_cap                         (read and write) master_cfg_enable                     (read and write) master_cfg_value                      (read and write) use_int_xcvr                          (read and write) enable_ipg0                           (read and write) ipg0                                  (read and write) ipg1                                  (read and write) ipg2                                  (read and write) rx_intr_pkts                          (read and write) rx_intr_time                          (read and write) red_dv4to6k                           (read and write) red_dv6to8k                           (read and write) red_dv8to10k                          (read and write) red_dv10to12k                         (read and write) tx_dma_weight                         (read and write) rx_dma_weight                         (read and write) infinite_burst                        (read and write) disable_64bit                         (read and write) name to get/set ? # 

Once you have set the desired parameters, they will persist until reboot. To have them persist through a reboot, you must set those parameters in the driver.conf file.

Reboot Persistence Using driver.conf

Reboot persistence is often required to avoid repeatedly invoking ndd to adjust device parameters after reboot. There are two common ways to specify driver parameters in the driver.conf:

  • Global driver.conf parameters

  • Per instance driver.conf parameters

In both cases, the driver.conf file resides in the same directory as the device driver. For example, ge resides in /kernel/drv. Therefore, the ge.conf file also resides in /kernel/drv. Note that even when a system is booted in 64-bit mode, the driver.conf file is still located in the same directory as the 32-bit driver.

Global driver.conf Parameters

Global driver.conf parameters apply to all instances of the driver and to all devices. Parameters specified alone will apply globally. For example, you can disable auto-negotiation for all ce devices in the system using a global property in the ce.conf file.

 ce.conf adv_autoneg_cap = 0; 

There are other older examples of global driver.conf parameters, which are a design choice of the driver developer. Those configuration parameters embody information about the device name and instance in the property.

 trp.conf trp0_ring_speed = 4; 

A more common method is to take advantage of the driver.conf framework to identify an instance that is unique for you.

Per-Instance driver.conf Parameters

This method requires you to identify a unique device instance. This method uses three device driver properties associated with each device in the system: the name, parent, and unit-address. Once these parameters are established, every property-value pair is a parameter that is familiar to the driver. The following example illustrates disabling auto-negotiation on an hme instance.

 hme.conf name = "hme" parent = "pci@if,2000" unit-address = "0" adv_autoneg_cap = 0; 

The name is simply the driver name. In the previous example, hme is the name. The parent and unit address are found using the /etc/path_to_inst file.

It is assumed that when you write a driver.conf file and apply instance properties, you know the instance to which you are applying the parameters. The instance becomes the key to finding the parent and unit address from the /etc/path_to_inst file.

 # grep ce /etc/path_to_inst "/pci@1f,2000/network@2" 2 "hme" "/pci@1f,2000/network@1" 1 "hme" "/pci@1f,2000/network@0" 0 "hme" 

In the example above, the instance number being configured is 1. The instance numbers in the example are shown in bold italics to guide the discussion.

Taking the second line as being the line associated with hme1, you can begin to extract the information required to write the driver.conf file.

The unit-address and parent are part of the leaf node information, which is the first string in quotes.

The leaf node can be thought of as a file in a directory structure, so you can address it relative to root or relative to a parent. If it is relative to a parent, then the leaf node breaks down to the string to the right of the last '/' and the string remaining to the left of the '/' is the parent.

Therefore, in the above example the parent = "/pci@1f,2000", the unit address is the number or byte sequence to the right of the '@' in the remaining leaf node, and the unit address = "1".

The resulting driver.conf file to disable auto-negotiation for instance 1 is as follows:

 hme.conf name = "hme" parent = "/pci@1f,2000" \ unit-address = "1" adv_autoneg_cap = 0; 

     < Day Day Up > 


    Networking Concepts and Technology. A Designer's Resource
    Networking Concepts and Technology: A Designers Resource
    ISBN: 0131482076
    EAN: 2147483647
    Year: 2003
    Pages: 116

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net