/* devargs */
#define IAVF_PROTO_XTR_ARG "proto_xtr"
+#define IAVF_QUANTA_SIZE_ARG "quanta_size"
+
+uint64_t iavf_timestamp_dynflag;
+int iavf_timestamp_dynfield_offset = -1;
static const char * const iavf_valid_args[] = {
IAVF_PROTO_XTR_ARG,
+ IAVF_QUANTA_SIZE_ARG,
NULL
};
struct rte_eth_dev_data *dev_data = dev->data;
uint16_t buf_size, max_pkt_len;
uint32_t frame_size = dev->data->mtu + IAVF_ETH_OVERHEAD;
+ enum iavf_status err;
buf_size = rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM;
return -EINVAL;
}
+ if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
+ /* Register mbuf field and flag for Rx timestamp */
+ err = rte_mbuf_dyn_rx_timestamp_register(
+ &iavf_timestamp_dynfield_offset,
+ &iavf_timestamp_dynflag);
+ if (err) {
+ PMD_DRV_LOG(ERR,
+ "Cannot register mbuf field/flag for timestamp");
+ return -EINVAL;
+ }
+ }
+
rxq->max_pkt_len = max_pkt_len;
if ((dev_data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SCATTER) ||
rxq->max_pkt_len > buf_size) {
return -1;
}
+ if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_PTP) {
+ if (iavf_get_ptp_cap(adapter)) {
+ PMD_INIT_LOG(ERR, "Failed to get ptp capability");
+ return -1;
+ }
+ }
+
if (iavf_init_queues(dev) != 0) {
PMD_DRV_LOG(ERR, "failed to do Queue init");
return -1;
}
+ if (iavf_set_vf_quanta_size(adapter, index, num_queue_pairs) != 0)
+ PMD_DRV_LOG(WARNING, "configure quanta size failed");
+
/* If needed, send configure queues msg multiple times to make the
* adminq buffer length smaller than the 4K limitation.
*/
if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_CRC)
dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_KEEP_CRC;
+ if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_PTP)
+ dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
+
if (iavf_ipsec_crypto_supported(adapter)) {
dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_SECURITY;
dev_info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_SECURITY;
return 0;
}
+static int
+parse_u16(__rte_unused const char *key, const char *value, void *args)
+{
+ u16 *num = (u16 *)args;
+ u16 tmp;
+
+ errno = 0;
+ tmp = strtoull(value, NULL, 10);
+ if (errno || !tmp) {
+ PMD_DRV_LOG(WARNING, "%s: \"%s\" is not a valid u16",
+ key, value);
+ return -1;
+ }
+
+ *num = tmp;
+
+ return 0;
+}
+
static int iavf_parse_devargs(struct rte_eth_dev *dev)
{
struct iavf_adapter *ad =
if (ret)
goto bail;
+ ret = rte_kvargs_process(kvlist, IAVF_QUANTA_SIZE_ARG,
+ &parse_u16, &ad->devargs.quanta_size);
+ if (ret)
+ goto bail;
+
+ if (ad->devargs.quanta_size == 0)
+ ad->devargs.quanta_size = 1024;
+
+ if (ad->devargs.quanta_size < 256 || ad->devargs.quanta_size > 4096 ||
+ ad->devargs.quanta_size & 0x40) {
+ PMD_INIT_LOG(ERR, "invalid quanta size\n");
+ return -EINVAL;
+ }
+
bail:
rte_kvargs_free(kvlist);
return ret;
}
}
+ if (vf->vsi_res->num_queue_pairs > IAVF_MAX_NUM_QUEUES_DFLT)
+ vf->lv_enabled = true;
+
if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
if (iavf_get_supported_rxdid(adapter) != 0) {
PMD_INIT_LOG(ERR, "failed to do get supported rxdid");