Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/105488/?format=api
http://patches.dpdk.org/api/patches/105488/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/03f7b904f557d13e3af77437ac06981eed070c45.1640783513.git.songyl@ramaxel.com/", "project": { "id": 1, "url": "http://patches.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": "<03f7b904f557d13e3af77437ac06981eed070c45.1640783513.git.songyl@ramaxel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/03f7b904f557d13e3af77437ac06981eed070c45.1640783513.git.songyl@ramaxel.com", "date": "2021-12-29T13:37:44", "name": "[v5,16/26] net/spnic: add device configure/version/info", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5408d89425d23624189f59ece758e8621bf23131", "submitter": { "id": 2455, "url": "http://patches.dpdk.org/api/people/2455/?format=api", "name": "Yanling Song", "email": "songyl@ramaxel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/03f7b904f557d13e3af77437ac06981eed070c45.1640783513.git.songyl@ramaxel.com/mbox/", "series": [ { "id": 21038, "url": "http://patches.dpdk.org/api/series/21038/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21038", "date": "2021-12-29T13:37:28", "name": "Net/SPNIC: support SPNIC into DPDK 22.03", "version": 5, "mbox": "http://patches.dpdk.org/series/21038/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/105488/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/105488/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 C9CE4A034D;\n\tWed, 29 Dec 2021 14:40:29 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 692C741238;\n\tWed, 29 Dec 2021 14:39:08 +0100 (CET)", "from VLXDG1SPAM1.ramaxel.com (email.ramaxel.com [221.4.138.186])\n by mails.dpdk.org (Postfix) with ESMTP id 72F6241163\n for <dev@dpdk.org>; Wed, 29 Dec 2021 14:39:04 +0100 (CET)", "from V12DG1MBS01.ramaxel.local (v12dg1mbs01.ramaxel.local\n [172.26.18.31])\n by VLXDG1SPAM1.ramaxel.com with ESMTPS id 1BTDc2bp070152\n (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);\n Wed, 29 Dec 2021 21:38:02 +0800 (GMT-8)\n (envelope-from songyl@ramaxel.com)", "from localhost.localdomain (10.64.9.47) by V12DG1MBS01.ramaxel.local\n (172.26.18.31) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 29\n Dec 2021 21:38:02 +0800" ], "From": "Yanling Song <songyl@ramaxel.com>", "To": "<dev@dpdk.org>", "CC": "<songyl@ramaxel.com>, <yanling.song@linux.dev>, <yanggan@ramaxel.com>,\n <xuyun@ramaxel.com>, <ferruh.yigit@intel.com>,\n <stephen@networkplumber.org>, <lihuisong@huawei.com>", "Subject": "[PATCH v5 16/26] net/spnic: add device configure/version/info", "Date": "Wed, 29 Dec 2021 21:37:44 +0800", "Message-ID": "\n <03f7b904f557d13e3af77437ac06981eed070c45.1640783513.git.songyl@ramaxel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<cover.1640783513.git.songyl@ramaxel.com>", "References": "<cover.1640783513.git.songyl@ramaxel.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.64.9.47]", "X-ClientProxiedBy": "V12DG1MBS03.ramaxel.local (172.26.18.33) To\n V12DG1MBS01.ramaxel.local (172.26.18.31)", "X-DNSRBL": "", "X-MAIL": "VLXDG1SPAM1.ramaxel.com 1BTDc2bp070152", "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" }, "content": "This commit adds the callbacks to configure queue number and mtu\nas well as query configuration information and firmware version.\n\nSigned-off-by: Yanling Song <songyl@ramaxel.com>\n---\n drivers/net/spnic/spnic_ethdev.c | 129 ++++++++++++++++++++++++++++++-\n 1 file changed, 127 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/spnic/spnic_ethdev.c b/drivers/net/spnic/spnic_ethdev.c\nindex bceccbe0d4..892803501e 100644\n--- a/drivers/net/spnic/spnic_ethdev.c\n+++ b/drivers/net/spnic/spnic_ethdev.c\n@@ -71,12 +71,131 @@ enum spnic_rx_mod {\n #define SPNIC_TXD_ALIGN\t\t\t1\n #define SPNIC_RXD_ALIGN\t\t\t1\n \n+static const struct rte_eth_desc_lim spnic_rx_desc_lim = {\n+\t.nb_max = SPNIC_MAX_QUEUE_DEPTH,\n+\t.nb_min = SPNIC_MIN_QUEUE_DEPTH,\n+\t.nb_align = SPNIC_RXD_ALIGN,\n+};\n+\n+static const struct rte_eth_desc_lim spnic_tx_desc_lim = {\n+\t.nb_max = SPNIC_MAX_QUEUE_DEPTH,\n+\t.nb_min = SPNIC_MIN_QUEUE_DEPTH,\n+\t.nb_align = SPNIC_TXD_ALIGN,\n+};\n+\n /**\n- * Deinit mac_vlan table in hardware.\n+ * Ethernet device configuration.\n *\n- * @param[in] eth_dev\n+ * Prepare the driver for a given number of TX and RX queues, mtu size\n+ * and configure RSS.\n+ *\n+ * @param[in] dev\n+ * Pointer to ethernet device structure.\n+ *\n+ * @retval zero : Success\n+ * @retval non-zero : Failure.\n+ */\n+static int spnic_dev_configure(struct rte_eth_dev *dev)\n+{\n+\tstruct spnic_nic_dev *nic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\n+\tnic_dev->num_sqs = dev->data->nb_tx_queues;\n+\tnic_dev->num_rqs = dev->data->nb_rx_queues;\n+\n+\tnic_dev->mtu_size =\n+\t\tSPNIC_PKTLEN_TO_MTU(dev->data->dev_conf.rxmode.mtu);\n+\n+\tif (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)\n+\t\tdev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * Get information about the device.\n+ *\n+ * @param[in] dev\n * Pointer to ethernet device structure.\n+ * @param[out] info\n+ * Info structure for ethernet device.\n+ *\n+ * @retval zero : Success\n+ * @retval non-zero : Failure.\n */\n+static int spnic_dev_infos_get(struct rte_eth_dev *dev,\n+\t\t\t struct rte_eth_dev_info *info)\n+{\n+\tstruct spnic_nic_dev *nic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\n+\tinfo->max_rx_queues = nic_dev->max_rqs;\n+\tinfo->max_tx_queues = nic_dev->max_sqs;\n+\tinfo->min_rx_bufsize = SPNIC_MIN_RX_BUF_SIZE;\n+\tinfo->max_rx_pktlen = SPNIC_MAX_JUMBO_FRAME_SIZE;\n+\tinfo->max_mac_addrs = SPNIC_MAX_UC_MAC_ADDRS;\n+\tinfo->min_mtu = SPNIC_MIN_MTU_SIZE;\n+\tinfo->max_mtu = SPNIC_MAX_MTU_SIZE;\n+\tinfo->max_lro_pkt_size = SPNIC_MAX_LRO_SIZE;\n+\n+\tinfo->rx_queue_offload_capa = 0;\n+\tinfo->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP |\n+\t\t\t\tDEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t\t\t\tDEV_RX_OFFLOAD_UDP_CKSUM |\n+\t\t\t\tDEV_RX_OFFLOAD_TCP_CKSUM |\n+\t\t\t\tDEV_RX_OFFLOAD_SCTP_CKSUM |\n+\t\t\t\tDEV_RX_OFFLOAD_VLAN_FILTER |\n+\t\t\t\tDEV_RX_OFFLOAD_SCATTER |\n+\t\t\t\tDEV_RX_OFFLOAD_TCP_LRO |\n+\t\t\t\tDEV_RX_OFFLOAD_RSS_HASH;\n+\n+\tinfo->tx_queue_offload_capa = 0;\n+\tinfo->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |\n+\t\t\t\tDEV_TX_OFFLOAD_IPV4_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_UDP_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_TCP_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_SCTP_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |\n+\t\t\t\tDEV_TX_OFFLOAD_TCP_TSO |\n+\t\t\t\tDEV_TX_OFFLOAD_MULTI_SEGS;\n+\n+\tinfo->hash_key_size = SPNIC_RSS_KEY_SIZE;\n+\tinfo->reta_size = SPNIC_RSS_INDIR_SIZE;\n+\tinfo->flow_type_rss_offloads = SPNIC_RSS_OFFLOAD_ALL;\n+\n+\tinfo->rx_desc_lim = spnic_rx_desc_lim;\n+\tinfo->tx_desc_lim = spnic_tx_desc_lim;\n+\n+\t/* Driver-preferred rx/tx parameters */\n+\tinfo->default_rxportconf.burst_size = SPNIC_DEFAULT_BURST_SIZE;\n+\tinfo->default_txportconf.burst_size = SPNIC_DEFAULT_BURST_SIZE;\n+\tinfo->default_rxportconf.nb_queues = SPNIC_DEFAULT_NB_QUEUES;\n+\tinfo->default_txportconf.nb_queues = SPNIC_DEFAULT_NB_QUEUES;\n+\tinfo->default_rxportconf.ring_size = SPNIC_DEFAULT_RING_SIZE;\n+\tinfo->default_txportconf.ring_size = SPNIC_DEFAULT_RING_SIZE;\n+\n+\treturn 0;\n+}\n+\n+static int spnic_fw_version_get(struct rte_eth_dev *dev, char *fw_version,\n+\t\t\t\tsize_t fw_size)\n+{\n+\tstruct spnic_nic_dev *nic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\tchar mgmt_ver[MGMT_VERSION_MAX_LEN] = { 0 };\n+\tint err;\n+\n+\terr = spnic_get_mgmt_version(nic_dev->hwdev, mgmt_ver,\n+\t\t\t\t SPNIC_MGMT_VERSION_MAX_LEN);\n+\tif (err) {\n+\t\tPMD_DRV_LOG(ERR, \"Get fw version failed\");\n+\t\treturn -EIO;\n+\t}\n+\n+\tif (fw_size < strlen(mgmt_ver) + 1)\n+\t\treturn (strlen(mgmt_ver) + 1);\n+\n+\tsnprintf(fw_version, fw_size, \"%s\", mgmt_ver);\n+\n+\treturn 0;\n+}\n \n /**\n * Set ethernet device link state up.\n@@ -1332,6 +1451,9 @@ static int spnic_set_mc_addr_list(struct rte_eth_dev *dev,\n }\n \n static const struct eth_dev_ops spnic_pmd_ops = {\n+\t.dev_configure = spnic_dev_configure,\n+\t.dev_infos_get = spnic_dev_infos_get,\n+\t.fw_version_get = spnic_fw_version_get,\n \t.dev_set_link_up = spnic_dev_set_link_up,\n \t.dev_set_link_down = spnic_dev_set_link_down,\n \t.link_update = spnic_link_update,\n@@ -1350,6 +1472,9 @@ static const struct eth_dev_ops spnic_pmd_ops = {\n };\n \n static const struct eth_dev_ops spnic_pmd_vf_ops = {\n+\t.dev_configure = spnic_dev_configure,\n+\t.dev_infos_get = spnic_dev_infos_get,\n+\t.fw_version_get = spnic_fw_version_get,\n \t.rx_queue_setup = spnic_rx_queue_setup,\n \t.tx_queue_setup = spnic_tx_queue_setup,\n \t.dev_start = spnic_dev_start,\n", "prefixes": [ "v5", "16/26" ] }{ "id": 105488, "url": "