xl4-shiro / excelfore-gptp

gPTP, IEEE 802.1AS-REV implementation
GNU General Public License v2.0
62 stars 38 forks source link

Question about how to run the stack with SW timestamp #4

Closed bryce22 closed 3 years ago

bryce22 commented 3 years ago

I'm new for excelfore's open source gPTP stack and we want to evaluate the performance for further cooperate possibility.

I mounted a virtual Linux system on my computer and the NIC can't support HW timestamp, as the ethtool -T command result in the picture below.

NIC without HW timestamp function

NIC ens39 in Linux has been mapped the a real NIC of my computer. And I can capture the gPTP messages when I applied ptp4l of linuxptp stack. So I created a virtual network port as the guidance. The virtual network port I created is ens39:0. virtual NIC

Then I run the stack with command: gptp2d -d ens39:0,ens39. And there is an error "ERR:gptp:gptpnet_init:ptp device is needed for at least one network device" .

Error

The guidance says "Adding a virtual port like 'cbeth0' creates a virtual ptp clock". So my questions are: 1) If the way I created the virtual network port is correct? 2) If I create a virtual network port, should I create a virtual ptp clock mannually?

By the way, if the stack can be configured to work as a gPTP slave?

Looking forward to your feedback. Thanks.

xl4-shiro commented 3 years ago

Just need to run gptp2d with virtual device as the first device. E.G. gptp2d -d cbeth0,eth0 # this runs for the real device eth0

bryce22 commented 3 years ago

Yes, I input the command as the example : gptp2d -d ens39:0,ens39, where ens39:0 is the virtual device and ens39 is the real device. But it can't work. Error

I doubt the virtual network port(ens39:0) I create can't satisfy the requirement, for it may not have the virtual ptp clock. Do you have any recommendation to create a virtual network port that can satisfy the requirement?

xl4-shiro commented 3 years ago

the virtual device here is gptp2d created one. When the device name starts with "cbeth", gptp2d creates a virtual network device and a virtual ptp device internally. In your case, use 'cbeth0' instead of 'ens39:0', and run as "gptp2d -d cbeth0,ens39" should work.

bryce22 commented 3 years ago

Ooh, I misunderstand the guidance. Now I can run the stack correctly. Thanks a lot.