nvethernet: schedule TX timestamp workqueue

Issue: With TSN + PTP test cases, PTP packets
shaped based on TSN GCL which may lead to not
having time stamp when asked.

Fix: in case of failure to get timestamp,
schedule workqueue again to try to get timestamp.

Bug 200777069

Change-Id: Ic557f6ba7df5147ce85b21278f053e07a984f410
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2599845
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Rakesh Goyal
2021-09-24 09:54:07 +05:30
committed by Revanth Kumar Uppala
parent 44b74a383b
commit 260d005cc1
2 changed files with 10 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ static void ether_get_tx_ts(struct work_struct *work)
struct list_head *head_node, *temp_head_node;
struct skb_shared_hwtstamps shhwtstamp;
struct osi_ioctl ioctl_data = {};
static unsigned int miss_count;
unsigned long long nsec = 0x0;
struct ether_tx_ts_skb_list *pnode;
int ret = -1;
@@ -56,6 +57,7 @@ static void ether_get_tx_ts(struct work_struct *work)
ioctl_data.tx_ts.pkt_id = pnode->pktid;
ret = osi_handle_ioctl(pdata->osi_core, &ioctl_data);
if (ret == 0) {
miss_count = 0U;
/* get time stamp form ethernet server */
dev_dbg(pdata->dev, "%s() pktid = %x, skb = %p\n",
__func__, pnode->pktid, pnode->skb);
@@ -86,6 +88,9 @@ update_skb:
} else {
dev_dbg(pdata->dev, "Unable to retrieve TS from OSI\n");
miss_count++;
if (miss_count < TS_MISS_THRESHOLD)
schedule_work(&pdata->tx_ts_work);
}
}
}

View File

@@ -112,6 +112,11 @@
*/
#define ETHER_DEFAULT_PTP_QUEUE 3U
/**
* @brief TX timestamp miss threshold
*/
#define TS_MISS_THRESHOLD 200U
/**
* @brief Ethernet clk rates
*/