nvethernet: Add PTP RX queue support

- Define new "nvidia,ptp_rx_queue" DT node entry
- Read "nvidia,ptp_rx_queue" DT node value into
  osi_core->ptp_config.ptp_rx_queue. On no DT
  entry case set this value to "osi_core->mtl_queues[0]"
- Validate "osi_core->ptp_config.ptp_rx_queue" value
  with "osi_core->mtl_queues" array values. If no match
  found give error and set this value to
  "osi_core->mtl_queues[0]"
- Add new private IOCTL command to call OSI RX route API.

Bug 200596985

Change-Id: I2c05d4c6f3f4207d9efd6b6777d29fe2409de1a3
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2312295
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
This commit is contained in:
Mohan Thadikamalla
2020-03-13 17:28:16 +05:30
committed by Revanth Kumar Uppala
parent 5ab61e947e
commit 7f172a52f5
3 changed files with 63 additions and 10 deletions

View File

@@ -3851,6 +3851,26 @@ static int ether_parse_dt(struct ether_priv_data *pdata)
goto exit;
}
}
/* Read PTP Rx queue index */
ret = of_property_read_u32(np, "nvidia,ptp-rx-queue",
&osi_core->ptp_config.ptp_rx_queue);
if (ret != 0) {
dev_warn(dev, "Setting default PTP RX queue\n");
osi_core->ptp_config.ptp_rx_queue = osi_core->mtl_queues[0];
} else {
/* Validate PTP Rx queue index */
for (i = 0; i < osi_core->num_mtl_queues; i++) {
if (osi_core->mtl_queues[i] ==
osi_core->ptp_config.ptp_rx_queue)
break;
}
if (i == osi_core->num_mtl_queues) {
dev_err(dev, "Invalid PTP RX queue in DT:%d\n",
osi_core->ptp_config.ptp_rx_queue);
osi_core->ptp_config.ptp_rx_queue =
osi_core->mtl_queues[0];
}
}
ret = of_property_read_u32_array(np, "nvidia,dma-chans",
osi_dma->dma_chans,