CLASSIC
Modul: eth
Rolle: constitutive
Konfidenz: 95%
SNIP_CLASSIC_ETH_SECTION_7_1_7_Buffer_handling
Wortlaut
7.1.7 Buffer handling
It is possible to use an optional software buffer handling mechanism. Buffer handling by software is needed in case no hardware feature is available that ensures a fair traffic scheduling. Fair traffic scheduling is needed to avoid uncontrolled postponement of messages due to (too) strict priority handling. The optional SW buffer handling is based on the so-called Credit Based Shaper algorithm (CBS). A CBS algorithm distributes Ethernet frames into dedicated SW queues based on their priority. The CBS algorithm uses credits given in Bytes in order to ensure a fair distribution of transmission chances among the different SW queues. The SW buffer (SW Buffer Pools) and physical memory on PHY level (HW queue) used normally are expanded with the CBS on basis of so-called SW queue. A transmission procedure consider at least the following points:
• Call of Eth_ProvideTxBuffer() will reserve a SW buffer pool of the SW buffer, store the given priority, return a pointer to the particular SW buffer pool and the unique buffer index of this SW buffer pool.
• The upper layer will copy the transmission data to the given SW buffer pool
• After data to transmit has been copied to the given SW buffer pool, the upper layer will call Eth_Transmit() with the according buffer index. The Ethernet driver will add the given buffer index to the SW queue according to the provided priority, which was previously given within the call of Eth_ProvideTxBuffer()
• SW queue are handled according to the CBS algorithm. If an element of the SW queue is rated to be transmitted by the CBS, the SW buffer pool which corresponds to the buffer index (given by the element of the SW queue) is copied to the HW queue. The SW buffer pool is released and available for further transmission requests. The CBS, its elements and the different API calls involved are depicted in the following graphic: Figure 7.5: CBS algorithm
[SWS_Eth_00263] ⌈If the configuration parameter EthCtrlConfigSwBufferHandling is set to TRUE, then the optional SW buffer handling shall be enabled.⌋(SRS_Eth_00146) Note: If buffer handling is supported by hardware, it is recommended to deactivate the software buffer handling by setting EthCtrlConfigSwBufferHandling to FALSE.
[SWS_Eth_00299]{OBSOLETE} ⌈If the configuration parameter EthCtrlConfigSw BufferHandling is set to TRUE, then one SW FIFO shall be available per configured EthCtrlConfigEgressFifo.⌋(SRS_Eth_00146)
[SWS_Eth_CONSTR_00002]{DRAFT} ⌈If the configuration parameter EthCtrlConfigSwBufferHandling is set to TRUE, then one SW queue per configured EthCtrlConfigEgressQueue shall be available.⌋(SRS_Eth_00146)
[SWS_Eth_CONSTR_00003]{DRAFT} ⌈If the configuration parameter EthCtrlConfigSwBufferHandling is set to TRUE, then at least two egress queues (via EthCtrlConfigEgressQueue) shall be configured.⌋(SRS_Eth_00146) Note: Each SW queue configuration is derived from exactly one given EthCtrlConfigEgressFifo.
[SWS_Eth_00298]{OBSOLETE} ⌈If the configuration parameter EthCtrlConfigSw BufferHandling is set to TRUE, then each SW FIFO shall handle frames according to the configured priorities given by EthCtrlConfigEgressFifoPriorityAssignment aggregated by the according EthCtrlConfigEgressFifo. If no EthCtrlConfigEgressFifoPriorityAssignment is configured, then any priority shall be handled by this SW FIFO.⌋ (SRS_Eth_00146)
[SWS_Eth_00302]{DRAFT} ⌈If the configuration parameter EthCtrlConfigSwBuffer Handling is set to TRUE, then each SW queue shall handle frames according to the configured priorities given by EthCtrlConfigEgressQueuePriorityAssignment aggregated by the according EthCtrlConfigEgressQueue. If no EthCtrlConfigEgressQueue PriorityAssignment is configured, then any priority shall be handled by this SW queue.⌋ (SRS_Eth_00146) Note: It is recommended to assign exactly one priority per EthCtrlConfigEgressQueue to support the performance of a software shaping algorithm.
[SWS_Eth_00264]{OBSOLETE} ⌈If the config parameter EthCtrlConfigSwBufferHandling is set to TRUE, then each SW FIFO shall have the total amount of elements given by EthCtrlConfigEgressFifoBufTotal ( [ECUC_Eth_00050]). Each element shall be of type Eth_BufIdxType.⌋(SRS_Eth_00146)
[SWS_Eth_00303]{DRAFT} ⌈If the configuration parameter EthCtrlConfigSwBuffer Handling is set to TRUE, then each SW queue shall have the total amount of elements given by EthCtrlConfigEgressQueueBufTotal (see t.b.d.). Each element shall be of type Eth_BufIdxType.⌋(SRS_Eth_00146) Note: SW queues have to store the buffer index which was reserved in a previous call of Eth_ProvideTxBuffer().
[SWS_Eth_00297]{OBSOLETE} ⌈If the config parameter EthCtrlConfigSwBufferHandling is set to TRUE, then a SW buffer shall be provided with a size according to all configured EthCtrlConfigEgressFifo’s. The size of each EthCtrlConfigEgressFifo shall be calculated in bytes by considering the following formula: size of one EthCtrlConfigEgressFifo = EthCtrlConfigEgressFifoBufTotal * EthCtrlConfigEgressFifoBufLenByte.⌋ (SRS_Eth_00146)
[SWS_Eth_00304]{DRAFT} ⌈If the config parameter EthCtrlConfigSwBufferHandling is set to TRUE, then a SW buffer shall be provided with a size according to all configured EthCtrlConfigEgressQueue’s. The size of each EthCtrlConfigEgressQueue shall be calculated in bytes by considering the following formula: size of one EthCtrlConfigEgressQueue = EthCtrlConfigEgressQueueBufTotal * EthCtrlConfigEgressQueueBufLenByte.⌋(SRS_Eth_00146) Note: Along with the SW buffer, the Ethernet driver has to handle the mapping between the given priority (provided by Eth_ProvideTxBuffer) and the according buffer index of the reserved SW puffer pool.
[SWS_Eth_00265]{OBSOLETE} ⌈All SW FIFOs shall follow the criteria listed here:
• Each SW FIFO shall be filled and read out according to FIFO principles.
• The SW FIFOs shall support independent configuration regardless of any settings on the rest of SW FIFOs.
⌋(SRS_Eth_00146)
[SWS_Eth_00305]{DRAFT} ⌈All SW queues shall follow the criteria listed here:
• Each SW queue shall be filled and read out according to FIFO principles.
• The SW queue shall support independent configuration regardless of any settings on the rest of SW queue.
⌋(SRS_Eth_00146) Note: Regarding last bulletin point, it is recommended to use different settings of EthCtrlConfigEgressQueueCreditBasedShaperIdleSlope and EthCtrlConfigEgressQueueCreditBasedShaperSendSlope per SW queue. Those two configuration parameters can be used to freely configure the output rate of the SW queue as demanded.
[SWS_Eth_00266]{OBSOLETE} ⌈SW FIFOs shall be iterated and their credits account be updated in the following way and order:
• Credits are only accumulated for SW FIFOs which have at least one message queued inside them. Empty SW FIFOs do not accumulate credits and their credits counter shall be set to 0.
• Iterate through all SW FIFOs, starting at the highest priority SW FIFO and descending, and add the amount of credits accumulated since the last Eth_MainFunction() call. The amount of credits accumulated is given by EthCtrlConfigShaperIdleSlope.
• If a SW FIFO reaches EthCtrlConfigShaperMaxCredit then the credit accumulation shall stop at that point and the next SW FIFO in the row is handled.
⌋(SRS_Eth_00146)
[SWS_Eth_00306]{DRAFT} ⌈SW queue shall be iterated and their credits account be updated in the following way and order:
• Credits are only accumulated for SW queues which have at least one message queued inside them. Empty SW queues do not accumulate credits and their credits counter shall be set to 0.
• Iterate through all SW queues, starting at the highest priority SW queue and descending, and add the amount of credits accumulated since the last Eth_MainFunction() call. The amount of credits accumulated is given by EthCtrlConfigEgressQueueCreditBasedShaperIdleSlope.
Versionen & Provenienz · Zugeordnete Anforderungen
Diese Angaben zeigt der Versions-Explorer.
Begründung & Zuweisungs-Evidenz
Cited verbatim in the snippet (deterministic citation).
Dokumenten-Herkunft & Rückverfolgbarkeit
| Spezifikations-Dokument | SWS_EthernetDriver.pdf |
|---|---|
| Dokumentseite | Seite 38 |
| Ziel-Modul | eth (classic) |
| Ziel-Anforderung | SWS_Eth_CONSTR_00003 |
| Semantische Rolle | constitutive |
| Automatisierungs-Konfidenz | 0.95 |