get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/86388/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 86388,
    "url": "http://patchwork.dpdk.org/api/patches/86388/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210112081302.87715-3-haiyue.wang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210112081302.87715-3-haiyue.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210112081302.87715-3-haiyue.wang@intel.com",
    "date": "2021-01-12T08:13:01",
    "name": "[v6,2/3] net/ice: add the DCF VLAN handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "71981dfa1d16bb2a943b394c98cb116f3c526dbc",
    "submitter": {
        "id": 1044,
        "url": "http://patchwork.dpdk.org/api/people/1044/?format=api",
        "name": "Wang, Haiyue",
        "email": "haiyue.wang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patchwork.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210112081302.87715-3-haiyue.wang@intel.com/mbox/",
    "series": [
        {
            "id": 14664,
            "url": "http://patchwork.dpdk.org/api/series/14664/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=14664",
            "date": "2021-01-12T08:12:59",
            "name": "Add AVF & DCF VLAN feaure",
            "version": 6,
            "mbox": "http://patchwork.dpdk.org/series/14664/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/86388/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/86388/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E6D57A04B5;\n\tTue, 12 Jan 2021 09:28:56 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C07C2140D4C;\n\tTue, 12 Jan 2021 09:28:46 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 9FC1B140D5B\n for <dev@dpdk.org>; Tue, 12 Jan 2021 09:28:44 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Jan 2021 00:28:44 -0800",
            "from npg-dpdk-haiyue-3.sh.intel.com ([10.67.118.237])\n by fmsmga001.fm.intel.com with ESMTP; 12 Jan 2021 00:28:42 -0800"
        ],
        "IronPort-SDR": [
            "\n EGZeXkkFHq+Oy++9fmjYday29Xfl0ry0YrbNBdXnXfgmTJhCwyzreuljL/ebpXDpyJbUs9Nr1f\n KHnCngduQHwg==",
            "\n atgNkgGIs3hUeWrjZUCm0wM8AszTJZ5vBDOjuFixegGzKWgLUqpUcnGB+BFdrxAN+tCQeGwhVo\n p+1HeSDZSLLA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9861\"; a=\"262788601\"",
            "E=Sophos;i=\"5.79,340,1602572400\"; d=\"scan'208\";a=\"262788601\"",
            "E=Sophos;i=\"5.79,340,1602572400\"; d=\"scan'208\";a=\"464443625\""
        ],
        "X-ExtLoop1": "1",
        "From": "Haiyue Wang <haiyue.wang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com,\n qi.z.zhang@intel.com, qi.fu@intel.com, Haiyue Wang <haiyue.wang@intel.com>",
        "Date": "Tue, 12 Jan 2021 16:13:01 +0800",
        "Message-Id": "<20210112081302.87715-3-haiyue.wang@intel.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20210112081302.87715-1-haiyue.wang@intel.com>",
        "References": "<20201214071155.98764-1-haiyue.wang@intel.com>\n <20210112081302.87715-1-haiyue.wang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 2/3] net/ice: add the DCF VLAN handling",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add the DCF port representor infrastructure for the VFs of DCF attached\nPF. Then the standard ethdev API like VLAN can be used to configure the\nVFs.\n\nSigned-off-by: Qiming Yang <qiming.yang@intel.com>\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\n drivers/net/ice/ice_dcf.c                |   1 +\n drivers/net/ice/ice_dcf_ethdev.c         |  91 +++++-\n drivers/net/ice/ice_dcf_ethdev.h         |  24 ++\n drivers/net/ice/ice_dcf_vf_representor.c | 334 +++++++++++++++++++++++\n drivers/net/ice/meson.build              |   1 +\n 5 files changed, 444 insertions(+), 7 deletions(-)\n create mode 100644 drivers/net/ice/ice_dcf_vf_representor.c",
    "diff": "diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c\nindex 44dbd3bb8..4a9af3292 100644\n--- a/drivers/net/ice/ice_dcf.c\n+++ b/drivers/net/ice/ice_dcf.c\n@@ -234,6 +234,7 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)\n \n \tcaps = VIRTCHNL_VF_OFFLOAD_WB_ON_ITR | VIRTCHNL_VF_OFFLOAD_RX_POLLING |\n \t       VIRTCHNL_VF_CAP_ADV_LINK_SPEED | VIRTCHNL_VF_CAP_DCF |\n+\t       VIRTCHNL_VF_OFFLOAD_VLAN_V2 |\n \t       VF_BASE_MODE_OFFLOADS | VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC;\n \n \terr = ice_dcf_send_cmd_req_no_irq(hw, VIRTCHNL_OP_GET_VF_RESOURCES,\ndiff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c\nindex b0b2ecb0d..a9e78064d 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.c\n+++ b/drivers/net/ice/ice_dcf_ethdev.c\n@@ -970,20 +970,97 @@ ice_dcf_cap_selected(struct rte_devargs *devargs)\n \treturn ret;\n }\n \n-static int eth_ice_dcf_pci_probe(__rte_unused struct rte_pci_driver *pci_drv,\n-\t\t\t     struct rte_pci_device *pci_dev)\n+static int\n+eth_ice_dcf_pci_probe(__rte_unused struct rte_pci_driver *pci_drv,\n+\t\t      struct rte_pci_device *pci_dev)\n {\n+\tstruct rte_eth_devargs eth_da = { .nb_representor_ports = 0 };\n+\tstruct ice_dcf_vf_repr_param repr_param;\n+\tchar repr_name[RTE_ETH_NAME_MAX_LEN];\n+\tstruct ice_dcf_adapter *dcf_adapter;\n+\tstruct rte_eth_dev *dcf_ethdev;\n+\tuint16_t dcf_vsi_id;\n+\tint i, ret;\n+\n \tif (!ice_dcf_cap_selected(pci_dev->device.devargs))\n \t\treturn 1;\n \n-\treturn rte_eth_dev_pci_generic_probe(pci_dev,\n-\t\t\t\t\t     sizeof(struct ice_dcf_adapter),\n-\t\t\t\t\t     ice_dcf_dev_init);\n+\tret = rte_eth_devargs_parse(pci_dev->device.devargs->args, &eth_da);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = rte_eth_dev_pci_generic_probe(pci_dev,\n+\t\t\t\t\t    sizeof(struct ice_dcf_adapter),\n+\t\t\t\t\t    ice_dcf_dev_init);\n+\tif (ret || !eth_da.nb_representor_ports)\n+\t\treturn ret;\n+\n+\tdcf_ethdev = rte_eth_dev_allocated(pci_dev->device.name);\n+\tif (dcf_ethdev == NULL)\n+\t\treturn -ENODEV;\n+\n+\tdcf_adapter = dcf_ethdev->data->dev_private;\n+\n+\tif (eth_da.nb_representor_ports > dcf_adapter->real_hw.num_vfs ||\n+\t    eth_da.nb_representor_ports >= RTE_MAX_ETHPORTS) {\n+\t\tPMD_DRV_LOG(ERR, \"the number of port representors is too large: %u\",\n+\t\t\t    eth_da.nb_representor_ports);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdcf_vsi_id = dcf_adapter->real_hw.vsi_id | VIRTCHNL_DCF_VF_VSI_VALID;\n+\n+\trepr_param.adapter = dcf_adapter;\n+\trepr_param.switch_domain_id = 0;\n+\n+\tfor (i = 0; i < eth_da.nb_representor_ports; i++) {\n+\t\tuint16_t vf_id = eth_da.representor_ports[i];\n+\n+\t\tif (vf_id >= dcf_adapter->real_hw.num_vfs) {\n+\t\t\tPMD_DRV_LOG(ERR, \"VF ID %u is out of range (0 ~ %u)\",\n+\t\t\t\t    vf_id, dcf_adapter->real_hw.num_vfs - 1);\n+\t\t\tret = -EINVAL;\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tif (dcf_adapter->real_hw.vf_vsi_map[vf_id] == dcf_vsi_id) {\n+\t\t\tPMD_DRV_LOG(ERR, \"VF ID %u is DCF's ID.\\n\", vf_id);\n+\t\t\tret = -EINVAL;\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\trepr_param.vf_id = vf_id;\n+\t\tsnprintf(repr_name, sizeof(repr_name), \"net_%s_representor_%u\",\n+\t\t\t pci_dev->device.name, vf_id);\n+\t\tret = rte_eth_dev_create(&pci_dev->device, repr_name,\n+\t\t\t\t\t sizeof(struct ice_dcf_vf_repr),\n+\t\t\t\t\t NULL, NULL, ice_dcf_vf_repr_init,\n+\t\t\t\t\t &repr_param);\n+\t\tif (ret) {\n+\t\t\tPMD_DRV_LOG(ERR, \"failed to create DCF VF representor %s\",\n+\t\t\t\t    repr_name);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn ret;\n }\n \n-static int eth_ice_dcf_pci_remove(struct rte_pci_device *pci_dev)\n+static int\n+eth_ice_dcf_pci_remove(struct rte_pci_device *pci_dev)\n {\n-\treturn rte_eth_dev_pci_generic_remove(pci_dev, ice_dcf_dev_uninit);\n+\tstruct rte_eth_dev *eth_dev;\n+\n+\teth_dev = rte_eth_dev_allocated(pci_dev->device.name);\n+\tif (!eth_dev)\n+\t\treturn 0;\n+\n+\tif (eth_dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)\n+\t\treturn rte_eth_dev_pci_generic_remove(pci_dev,\n+\t\t\t\t\t\t      ice_dcf_vf_repr_uninit);\n+\telse\n+\t\treturn rte_eth_dev_pci_generic_remove(pci_dev,\n+\t\t\t\t\t\t      ice_dcf_dev_uninit);\n }\n \n static const struct rte_pci_id pci_id_ice_dcf_map[] = {\ndiff --git a/drivers/net/ice/ice_dcf_ethdev.h b/drivers/net/ice/ice_dcf_ethdev.h\nindex b54528bea..7695815e1 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.h\n+++ b/drivers/net/ice/ice_dcf_ethdev.h\n@@ -22,9 +22,33 @@ struct ice_dcf_adapter {\n \tstruct ice_dcf_hw real_hw;\n };\n \n+struct ice_dcf_vf_repr_param {\n+\tstruct ice_dcf_adapter *adapter;\n+\tuint16_t switch_domain_id;\n+\tuint16_t vf_id;\n+};\n+\n+struct ice_dcf_vlan {\n+\tuint16_t tpid;\n+\tuint16_t vid;\n+};\n+\n+struct ice_dcf_vf_repr {\n+\tstruct ice_dcf_adapter *dcf_adapter;\n+\tstruct rte_ether_addr mac_addr;\n+\tuint16_t switch_domain_id;\n+\tuint16_t vf_id;\n+\n+\tbool port_vlan_ena;\n+\tstruct ice_dcf_vlan port_vlan_info;\n+};\n+\n void ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,\n \t\t\t\t uint8_t *msg, uint16_t msglen);\n int ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev);\n void ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev);\n \n+int ice_dcf_vf_repr_init(struct rte_eth_dev *ethdev, void *init_param);\n+int ice_dcf_vf_repr_uninit(struct rte_eth_dev *ethdev);\n+\n #endif /* _ICE_DCF_ETHDEV_H_ */\ndiff --git a/drivers/net/ice/ice_dcf_vf_representor.c b/drivers/net/ice/ice_dcf_vf_representor.c\nnew file mode 100644\nindex 000000000..09ca4df5a\n--- /dev/null\n+++ b/drivers/net/ice/ice_dcf_vf_representor.c\n@@ -0,0 +1,334 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+\n+#include <errno.h>\n+#include <sys/types.h>\n+\n+#include <rte_ethdev.h>\n+\n+#include \"ice_dcf_ethdev.h\"\n+#include \"ice_rxtx.h\"\n+\n+static uint16_t\n+ice_dcf_vf_repr_rx_burst(__rte_unused void *rxq,\n+\t\t\t __rte_unused struct rte_mbuf **rx_pkts,\n+\t\t\t __rte_unused uint16_t nb_pkts)\n+{\n+\treturn 0;\n+}\n+\n+static uint16_t\n+ice_dcf_vf_repr_tx_burst(__rte_unused void *txq,\n+\t\t\t __rte_unused struct rte_mbuf **tx_pkts,\n+\t\t\t __rte_unused uint16_t nb_pkts)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_dev_configure(__rte_unused struct rte_eth_dev *dev)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_dev_start(struct rte_eth_dev *dev)\n+{\n+\tdev->data->dev_link.link_status = ETH_LINK_UP;\n+\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_dev_stop(struct rte_eth_dev *dev)\n+{\n+\tdev->data->dev_link.link_status = ETH_LINK_DOWN;\n+\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_dev_close(struct rte_eth_dev *dev)\n+{\n+\treturn ice_dcf_vf_repr_uninit(dev);\n+}\n+\n+static int\n+ice_dcf_vf_repr_rx_queue_setup(__rte_unused struct rte_eth_dev *dev,\n+\t\t\t       __rte_unused uint16_t queue_id,\n+\t\t\t       __rte_unused uint16_t nb_desc,\n+\t\t\t       __rte_unused unsigned int socket_id,\n+\t\t\t       __rte_unused const struct rte_eth_rxconf *conf,\n+\t\t\t       __rte_unused struct rte_mempool *pool)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_tx_queue_setup(__rte_unused struct rte_eth_dev *dev,\n+\t\t\t       __rte_unused uint16_t queue_id,\n+\t\t\t       __rte_unused uint16_t nb_desc,\n+\t\t\t       __rte_unused unsigned int socket_id,\n+\t\t\t       __rte_unused const struct rte_eth_txconf *conf)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_promiscuous_enable(__rte_unused struct rte_eth_dev *ethdev)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_promiscuous_disable(__rte_unused struct rte_eth_dev *ethdev)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_allmulticast_enable(__rte_unused struct rte_eth_dev *dev)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_allmulticast_disable(__rte_unused struct rte_eth_dev *dev)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_link_update(__rte_unused struct rte_eth_dev *ethdev,\n+\t\t\t    __rte_unused int wait_to_complete)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vf_repr_dev_info_get(struct rte_eth_dev *dev,\n+\t\t\t     struct rte_eth_dev_info *dev_info)\n+{\n+\tstruct ice_dcf_vf_repr *repr = dev->data->dev_private;\n+\tstruct ice_dcf_hw *dcf_hw =\n+\t\t\t\t&repr->dcf_adapter->real_hw;\n+\n+\tdev_info->device = dev->device;\n+\tdev_info->max_mac_addrs = 1;\n+\tdev_info->max_rx_queues = dcf_hw->vsi_res->num_queue_pairs;\n+\tdev_info->max_tx_queues = dcf_hw->vsi_res->num_queue_pairs;\n+\tdev_info->min_rx_bufsize = ICE_BUF_SIZE_MIN;\n+\tdev_info->max_rx_pktlen = ICE_FRAME_SIZE_MAX;\n+\tdev_info->hash_key_size = dcf_hw->vf_res->rss_key_size;\n+\tdev_info->reta_size = dcf_hw->vf_res->rss_lut_size;\n+\tdev_info->flow_type_rss_offloads = ICE_RSS_OFFLOAD_ALL;\n+\n+\tdev_info->rx_offload_capa =\n+\t\tDEV_RX_OFFLOAD_VLAN_STRIP |\n+\t\tDEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t\tDEV_RX_OFFLOAD_UDP_CKSUM |\n+\t\tDEV_RX_OFFLOAD_TCP_CKSUM |\n+\t\tDEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |\n+\t\tDEV_RX_OFFLOAD_SCATTER |\n+\t\tDEV_RX_OFFLOAD_JUMBO_FRAME |\n+\t\tDEV_RX_OFFLOAD_VLAN_FILTER |\n+\t\tDEV_RX_OFFLOAD_VLAN_EXTEND |\n+\t\tDEV_RX_OFFLOAD_RSS_HASH;\n+\tdev_info->tx_offload_capa =\n+\t\tDEV_TX_OFFLOAD_VLAN_INSERT |\n+\t\tDEV_TX_OFFLOAD_IPV4_CKSUM |\n+\t\tDEV_TX_OFFLOAD_UDP_CKSUM |\n+\t\tDEV_TX_OFFLOAD_TCP_CKSUM |\n+\t\tDEV_TX_OFFLOAD_SCTP_CKSUM |\n+\t\tDEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |\n+\t\tDEV_TX_OFFLOAD_TCP_TSO |\n+\t\tDEV_TX_OFFLOAD_VXLAN_TNL_TSO |\n+\t\tDEV_TX_OFFLOAD_GRE_TNL_TSO |\n+\t\tDEV_TX_OFFLOAD_IPIP_TNL_TSO |\n+\t\tDEV_TX_OFFLOAD_GENEVE_TNL_TSO |\n+\t\tDEV_TX_OFFLOAD_MULTI_SEGS;\n+\n+\tdev_info->default_rxconf = (struct rte_eth_rxconf) {\n+\t\t.rx_thresh = {\n+\t\t\t.pthresh = ICE_DEFAULT_RX_PTHRESH,\n+\t\t\t.hthresh = ICE_DEFAULT_RX_HTHRESH,\n+\t\t\t.wthresh = ICE_DEFAULT_RX_WTHRESH,\n+\t\t},\n+\t\t.rx_free_thresh = ICE_DEFAULT_RX_FREE_THRESH,\n+\t\t.rx_drop_en = 0,\n+\t\t.offloads = 0,\n+\t};\n+\n+\tdev_info->default_txconf = (struct rte_eth_txconf) {\n+\t\t.tx_thresh = {\n+\t\t\t.pthresh = ICE_DEFAULT_TX_PTHRESH,\n+\t\t\t.hthresh = ICE_DEFAULT_TX_HTHRESH,\n+\t\t\t.wthresh = ICE_DEFAULT_TX_WTHRESH,\n+\t\t},\n+\t\t.tx_free_thresh = ICE_DEFAULT_TX_FREE_THRESH,\n+\t\t.tx_rs_thresh = ICE_DEFAULT_TX_RSBIT_THRESH,\n+\t\t.offloads = 0,\n+\t};\n+\n+\tdev_info->rx_desc_lim = (struct rte_eth_desc_lim) {\n+\t\t.nb_max = ICE_MAX_RING_DESC,\n+\t\t.nb_min = ICE_MIN_RING_DESC,\n+\t\t.nb_align = ICE_ALIGN_RING_DESC,\n+\t};\n+\n+\tdev_info->tx_desc_lim = (struct rte_eth_desc_lim) {\n+\t\t.nb_max = ICE_MAX_RING_DESC,\n+\t\t.nb_min = ICE_MIN_RING_DESC,\n+\t\t.nb_align = ICE_ALIGN_RING_DESC,\n+\t};\n+\n+\tdev_info->switch_info.name = dcf_hw->eth_dev->device->name;\n+\tdev_info->switch_info.domain_id = repr->switch_domain_id;\n+\tdev_info->switch_info.port_id = repr->vf_id;\n+\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_vlan_offload_config(struct ice_dcf_vf_repr *repr,\n+\t\t\t    struct virtchnl_dcf_vlan_offload *vlan_offload)\n+{\n+\tstruct dcf_virtchnl_cmd args;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.v_op = VIRTCHNL_OP_DCF_VLAN_OFFLOAD;\n+\targs.req_msg = (uint8_t *)vlan_offload;\n+\targs.req_msglen = sizeof(*vlan_offload);\n+\n+\treturn ice_dcf_execute_virtchnl_cmd(&repr->dcf_adapter->real_hw, &args);\n+}\n+\n+static __rte_always_inline bool\n+ice_dcf_vlan_offload_ena(struct ice_dcf_vf_repr *repr)\n+{\n+\treturn !!(repr->dcf_adapter->real_hw.vf_res->vf_cap_flags &\n+\t\t  VIRTCHNL_VF_OFFLOAD_VLAN_V2);\n+}\n+\n+static int\n+ice_dcf_vf_repr_vlan_pvid_set(struct rte_eth_dev *dev,\n+\t\t\t      uint16_t pvid, int on)\n+{\n+\tstruct ice_dcf_vf_repr *repr = dev->data->dev_private;\n+\tstruct virtchnl_dcf_vlan_offload vlan_offload;\n+\tint err;\n+\n+\tif (!ice_dcf_vlan_offload_ena(repr))\n+\t\treturn -ENOTSUP;\n+\n+\tif (on && (pvid == 0 || pvid > RTE_ETHER_MAX_VLAN_ID))\n+\t\treturn -EINVAL;\n+\n+\tmemset(&vlan_offload, 0, sizeof(vlan_offload));\n+\n+\tvlan_offload.vf_id = repr->vf_id;\n+\tvlan_offload.tpid = repr->port_vlan_info.tpid;\n+\tvlan_offload.vlan_flags = (VIRTCHNL_DCF_VLAN_TYPE_OUTER <<\n+\t\t\t\t   VIRTCHNL_DCF_VLAN_TYPE_S) |\n+\t\t\t\t  (VIRTCHNL_DCF_VLAN_INSERT_PORT_BASED <<\n+\t\t\t\t   VIRTCHNL_DCF_VLAN_INSERT_MODE_S);\n+\tvlan_offload.vlan_id = on ? pvid : 0;\n+\n+\terr = ice_dcf_vlan_offload_config(repr, &vlan_offload);\n+\tif (!err) {\n+\t\tif (on) {\n+\t\t\trepr->port_vlan_ena = true;\n+\t\t\trepr->port_vlan_info.vid = pvid;\n+\t\t} else {\n+\t\t\trepr->port_vlan_ena = false;\n+\t\t}\n+\t}\n+\n+\treturn err;\n+}\n+\n+static int\n+ice_dcf_vf_repr_vlan_tpid_set(struct rte_eth_dev *dev,\n+\t\t\t      enum rte_vlan_type vlan_type, uint16_t tpid)\n+{\n+\tstruct ice_dcf_vf_repr *repr = dev->data->dev_private;\n+\tint err = 0;\n+\n+\tif (!ice_dcf_vlan_offload_ena(repr))\n+\t\treturn -ENOTSUP;\n+\n+\tif (vlan_type != ETH_VLAN_TYPE_OUTER) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Can accelerate only outer VLAN in QinQ\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (tpid != RTE_ETHER_TYPE_QINQ &&\n+\t    tpid != RTE_ETHER_TYPE_VLAN &&\n+\t    tpid != RTE_ETHER_TYPE_QINQ1) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Invalid TPID: 0x%04x\\n\", tpid);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\trepr->port_vlan_info.tpid = tpid;\n+\n+\tif (repr->port_vlan_ena)\n+\t\terr = ice_dcf_vf_repr_vlan_pvid_set(dev,\n+\t\t\t\t\t\t    repr->port_vlan_info.vid,\n+\t\t\t\t\t\t    true);\n+\treturn err;\n+}\n+\n+static const struct eth_dev_ops ice_dcf_vf_repr_dev_ops = {\n+\t.dev_configure        = ice_dcf_vf_repr_dev_configure,\n+\t.dev_start            = ice_dcf_vf_repr_dev_start,\n+\t.dev_stop             = ice_dcf_vf_repr_dev_stop,\n+\t.dev_close            = ice_dcf_vf_repr_dev_close,\n+\t.dev_infos_get        = ice_dcf_vf_repr_dev_info_get,\n+\t.rx_queue_setup       = ice_dcf_vf_repr_rx_queue_setup,\n+\t.tx_queue_setup       = ice_dcf_vf_repr_tx_queue_setup,\n+\t.promiscuous_enable   = ice_dcf_vf_repr_promiscuous_enable,\n+\t.promiscuous_disable  = ice_dcf_vf_repr_promiscuous_disable,\n+\t.allmulticast_enable  = ice_dcf_vf_repr_allmulticast_enable,\n+\t.allmulticast_disable = ice_dcf_vf_repr_allmulticast_disable,\n+\t.link_update          = ice_dcf_vf_repr_link_update,\n+\t.vlan_pvid_set        = ice_dcf_vf_repr_vlan_pvid_set,\n+\t.vlan_tpid_set        = ice_dcf_vf_repr_vlan_tpid_set,\n+};\n+\n+int\n+ice_dcf_vf_repr_init(struct rte_eth_dev *ethdev, void *init_param)\n+{\n+\tstruct ice_dcf_vf_repr *repr = ethdev->data->dev_private;\n+\tstruct ice_dcf_vf_repr_param *param = init_param;\n+\n+\trepr->dcf_adapter = param->adapter;\n+\trepr->switch_domain_id = param->switch_domain_id;\n+\trepr->vf_id = param->vf_id;\n+\trepr->port_vlan_ena = false;\n+\trepr->port_vlan_info.tpid = RTE_ETHER_TYPE_VLAN;\n+\n+\tethdev->dev_ops = &ice_dcf_vf_repr_dev_ops;\n+\n+\tethdev->rx_pkt_burst = ice_dcf_vf_repr_rx_burst;\n+\tethdev->tx_pkt_burst = ice_dcf_vf_repr_tx_burst;\n+\n+\tethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;\n+\tethdev->data->representor_id = repr->vf_id;\n+\n+\tethdev->data->mac_addrs = &repr->mac_addr;\n+\n+\trte_eth_random_addr(repr->mac_addr.addr_bytes);\n+\n+\treturn 0;\n+}\n+\n+int\n+ice_dcf_vf_repr_uninit(struct rte_eth_dev *ethdev)\n+{\n+\tethdev->data->mac_addrs = NULL;\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/net/ice/meson.build b/drivers/net/ice/meson.build\nindex 7b291269d..d58936089 100644\n--- a/drivers/net/ice/meson.build\n+++ b/drivers/net/ice/meson.build\n@@ -61,6 +61,7 @@ if arch_subdir == 'x86'\n endif\n \n sources += files('ice_dcf.c',\n+\t\t 'ice_dcf_vf_representor.c',\n \t\t 'ice_dcf_ethdev.c',\n \t\t 'ice_dcf_parent.c')\n \n",
    "prefixes": [
        "v6",
        "2/3"
    ]
}