Quantcast
Channel: Mellanox Interconnect Community: Message List
Viewing all articles
Browse latest Browse all 6275

Time stamping packets with libvma

$
0
0

Hello!

I have mellanox NIC (Mellanox Technologies MT27500 Family [ConnectX-3]) and I want to get timestamps for transmitted UDP packets.

According to documentation, to prepare to get it, I should execute following instructions in my C++ code:

 

ifreq hwtstamp;

hwtstamp_config hwconfig;

std::fill_n(reinterpret_cast<char*>(&hwtstamp), sizeof(hwtstamp), 0);

std::fill_n(reinterpret_cast<char*>(&hwconfig), sizeof(hwconfig), 0);

strncpy(hwtstamp.ifr_name, "mlnx0", sizeof(hwtstamp.ifr_name));

hwtstamp.ifr_data = reinterpret_cast<char*>(&hwconfig);

 

hwconfig.tx_type =    HWTSTAMP_TX_ON;

hwconfig.rx_filter = HWTSTAMP_FILTER_NONE;

ioctl(fd, SIOCSHWTSTAMP, &hwtstamp)

 

And then:

 

int timestamp_flag = SOF_TIMESTAMPING_TX_HARDWARE;

setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, &timestamp_flag, sizeof(timestamp_flag));

 

If I execute this code with preloaded libvma.so, here setsockopt() call fails with errno = 95 [Operation not supported]

I tried also

timestamp_flag = SOF_TIMESTAMPING_TX_SOFTWARE

but got the same error.For receive timestamps setsockopt() with flag SOF_TIMESTAMPING_RX_HARDWARE works fine.

 

If I call in bash

 

$ethtool -T mlnx0

 

I get:

 

Time stamping parameters for mlnx0:

Capabilities:

    hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)

    software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)

    hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)

    software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)

    software-system-clock (SOF_TIMESTAMPING_SOFTWARE)

    hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)

PTP Hardware Clock: 2

Hardware Transmit Timestamp Modes:

    off                   (HWTSTAMP_TX_OFF)

    on                    (HWTSTAMP_TX_ON)

Hardware Receive Filter Modes:

    none                  (HWTSTAMP_FILTER_NONE)

    all                   (HWTSTAMP_FILTER_ALL)

 

So, technically, my NIC provide timestamps for transmitted packets, but setsockopt() call fails and I don't understand why.

Can anyone give me a tip what is the problem with getting timestamps of transmitted packets with mellanox NIC and preloaded libvma.so?

 

Kind regards,

Vitaly


Viewing all articles
Browse latest Browse all 6275

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>