ENETC not sending with CBS enabled

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ENETC not sending with CBS enabled

ソリューションへジャンプ
1,916件の閲覧回数
_mkl
Contributor II

Hello,

I am extending a custom driver for enetc on ls1028ardb to also support the TSN features of the board.

Now as soon as I enable the credit based shaper, no packets are transmitted. I have configured two TX BDR with prios 0 and 7 and set the PTC7CBSR0 and PTC7CBSR1 registers. But no matter which credit or bandwidth values I use, no data gets transmitted from either ring as soon as the CBSE bit is set. It is simply filling up until full.

I looked into the LSDK driver implementation and also only find these registers configured for CBS as described in the manual. Is there any hidden configuration I missed? Or are there more constrains to have a valid CBS configuration?

タグ(1)
0 件の賞賛
返信
1 解決策
1,429件の閲覧回数
_mkl
Contributor II

For the curious reader:

I was finally able to get TSN on ENETC working. The difference was in the IEEE1588 Timer Module configuration.

  • My configuration: TMR_CTRL[TCLK_PERIOD] = 16, TMR_ADD=0x28000000
  • The Linux config: TMR_CTRL[TCLK_PERIOD] = 5, TMR_ADD=0x80000000

After decreasing the CLK_PERIOD to 5 or 4 and recalculating TMR_ADD accordingly it is now functional.

元の投稿で解決策を見る

0 件の賞賛
返信
9 返答(返信)
1,430件の閲覧回数
_mkl
Contributor II

For the curious reader:

I was finally able to get TSN on ENETC working. The difference was in the IEEE1588 Timer Module configuration.

  • My configuration: TMR_CTRL[TCLK_PERIOD] = 16, TMR_ADD=0x28000000
  • The Linux config: TMR_CTRL[TCLK_PERIOD] = 5, TMR_ADD=0x80000000

After decreasing the CLK_PERIOD to 5 or 4 and recalculating TMR_ADD accordingly it is now functional.

0 件の賞賛
返信
1,752件の閲覧回数
_mkl
Contributor II

I have the same problem with other TSN features as well, e.g. Qbv scheduler. Once enabled, only a single frame is transmitted. 
I assume there is a dependant timing/frequency configuration I am missing? IEEE1588 clock is already initialized and running and the speed value is set to 1Gbps.

0 件の賞賛
返信
1,614件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

For the same environment and steps, LSDK driver is working well, right?

do you use ptp4l to do the time synchronization?

you can dump the related registers and compare them with that in LSDK driver.

0 件の賞賛
返信
1,608件の閲覧回数
_mkl
Contributor II
Yes, the LSDK driver works as expected, I have two ls1028a boards connected to each other. There ptp4l is able to synchronize both boards with gPTP.
In my system I do not have ptp synchronization yet, only the ptp clock counting the system runtime. Do I have to set up a proper PTP calibration before enabling TSN?
I already compared the registers, here are some differences I found but assume unrelated, please comment if there is something mandatory:
- LSDK uses two VSI with 4 queues each behind the PSI, I only use the 8 PSI queues directly.
- LSDK uses SI based VLAN extraction/insertion, I currently handle VLANs in software.
0 件の賞賛
返信
1,572件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

PTP synchronization is needed, so you should enable it.

you can test your code in LSDK's environment, just replace ENET driver using your driver.
it can exclude some interference factors.

0 件の賞賛
返信
1,853件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

for ENETC port,
if want to enable CBS, should make sure the other TC (that are numerically higher than this TC) have been enabled.
if want to disable CBS, should make sure the other TC (that are numerically lower than this TC) have been disabled.

you can refer to the function enetc_set_cbs in drivers/net/ethernet/freescale/enetc/enetc_tsn.c,

Thanks

0 件の賞賛
返信
1,798件の閲覧回数
_mkl
Contributor II

I know, for this reason I have only enabled the highest TC 7.
As I mentioned in my original post I took the code in enetc_set_cbs as reference and configured the same registers.

0 件の賞賛
返信
1,768件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

For CBS test, should send the frames using the corresponding queue, for example "pktgen -q ...".

 

you can refer to " 4.1.4.1.5.2 Using CBS Qdisc to setup Qav" of real-time-edge RM.

 

can also use "ethtool -S enox" command to show the rx/tx counter, it can help to find why the packets are blocked.

 

Thanks

0 件の賞賛
返信
1,763件の閲覧回数
_mkl
Contributor II
Ok, with the rx/tx counter I can see that the first frame is transmitted, but no further ones. Maybe the credits are not replenished or another missing configuration causes starvation?
I now tried with all 8 traffic classes with a 1:1 mapping from BDR priority to traffic class to VLAN PCP, but it still does not send any further packets from any of the queues.
0 件の賞賛
返信