RtndSetCbsParams

RtndSetCbsParams sets the Credit-Based Shaper parameters on a given Transmit Queue.

Syntax

Copy
BOOL RtndSetCbsParams(
    [in]    ULONG_PTR RtndInterfaceId, 
    [in]    ULONG TxQueueIndex, 
    [in]    const RTND_CBS_PARAMS *pCbsParams, 
    [in]    ULONG CbsParamsStructSize
);

Parameters

[in] RtndInterfaceId

The number or pointer used to identify the interface. This value is returned by RtndManageInterface.

[in] TxQueueIndex

The index of the target Transmit Queue.

[in] pCbsParams

The address of the RTND_CBS_PARAMS structure describing the Code-Based Shaper parameters.

[in] CbsParamsStructSize

The size of the structure pointed at by the pCbsParams paremeter.

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. To get extended error information, call GetLastError.

Common error codes:

Error code Meaning

ERROR_IO_DEVICE

An unexpected error occurred while trying to access the device.

RTND_ERROR_BAD_REQUEST

The supplied pCbsParams structure contains fields that this driver cannot interpret.

Note: Custom drivers may return other error codes not listed above.

Remarks

The NL2 always calls this function from the main thread of the NL2 process.

The NL2 always uses sizeof() to get the real size of its CbsParams structure at compilation time, and it always memsets this structure to 0 before populating it and calling this function.

The NL2 will call this function only on Transmit Queues where Credit-Based Shaper is enabled (see RTND_SETTING_ID_TX_QUEUE_SCHEDULING).

The NL2 can call this function at any time after the interface starts, and the driver must apply the new settings immediately before the function returns.

Depending on the hardware, the granularity of the bandwidth setting can exceed 1 Kbps. In that case, the driver must silently round the passed value up. For example, if the granularity is 16 Kbps and the requested value in RTND_CBS_PARAMS.RawBandwidthKbps is 12500, the driver must set a bandwidth of 12512 Kbps.

If the requested bandwidth in RTND_CBS_PARAMS.RawBandwidthKbps is greater than the current link speed, the driver must perform as if the requested bandwidth was equal to the link speed. The driver must make that adjustment automatically whenever the link speed changes. For example, if the requested bandwidth in RTND_CBS_PARAMS.RawBandwidthKbps is 150000; the driver must restrict the actual bandwidth to 100000 Kbps on a 100 Mbps link, but revert it to 150000 Kbps if the link speed changes to 1 Gbps.

The value of the bandwidth that the NL2 passes in RTND_CBS_PARAMS.RawBandwidthKbps is the raw occupied bandwidth on the wire. It includes the 14-byte Ethernet header, the 4-byte VLAN Tag (if any), the payload, the 4-byte FCS, AND the 20-byte gap after the frame (this is the minimum space that a sender must insert between the FCS of a frame and the Ethernet header of the next frame).

Characteristics

Real-time requirements

Deterministic behavior

Not required

Shutdown-safe behavior

Required

Local memory allocation/deallocation restrictions

Process

External MSpace

Internal MSpace

System

Not allowed

Not allowed

RTSS process

Not allowed

Not allowed

Windows contiguous memory allocation/deallocation restrictions

Contiguous memory

Not allowed

Requirements

Minimum supported version Header

wRTOS 1.0 SDK

Rtnd.h

See Also: