get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 138752,
    "url": "http://patches.dpdk.org/api/patches/138752/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240322222543.23548-2-damodharam.ammepalli@broadcom.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": "<20240322222543.23548-2-damodharam.ammepalli@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240322222543.23548-2-damodharam.ammepalli@broadcom.com",
    "date": "2024-03-22T22:25:42",
    "name": "[RFC,1/2] lib/ethdev: Add link_speed lanes support into rte lib",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "3d49d6b0bf9b1bb7d994c255cfaac9c1b347bb45",
    "submitter": {
        "id": 2741,
        "url": "http://patches.dpdk.org/api/people/2741/?format=api",
        "name": "Damodharam Ammepalli",
        "email": "damodharam.ammepalli@broadcom.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240322222543.23548-2-damodharam.ammepalli@broadcom.com/mbox/",
    "series": [
        {
            "id": 31606,
            "url": "http://patches.dpdk.org/api/series/31606/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31606",
            "date": "2024-03-22T22:25:41",
            "name": "Add support for link speed lanes",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/31606/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/138752/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/138752/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 7BA7A43D26;\n\tFri, 22 Mar 2024 23:26:53 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 68A1B42EFE;\n\tFri, 22 Mar 2024 23:26:49 +0100 (CET)",
            "from mail-vk1-f170.google.com (mail-vk1-f170.google.com\n [209.85.221.170])\n by mails.dpdk.org (Postfix) with ESMTP id 0DB5D42EF5\n for <dev@dpdk.org>; Fri, 22 Mar 2024 23:26:48 +0100 (CET)",
            "by mail-vk1-f170.google.com with SMTP id\n 71dfb90a1353d-4d43d602cd6so925506e0c.0\n for <dev@dpdk.org>; Fri, 22 Mar 2024 15:26:47 -0700 (PDT)",
            "from dhcp-10-193-55-224.dhcp.broadcom.net ([192.19.224.250])\n by smtp.gmail.com with ESMTPSA id\n mx17-20020a0562142e1100b0069679a663e6sm57003qvb.21.2024.03.22.15.26.44\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 22 Mar 2024 15:26:45 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=broadcom.com; s=google; t=1711146407; x=1711751207; darn=dpdk.org;\n h=mime-version:references:in-reply-to:message-id:date:subject:cc:to\n :from:from:to:cc:subject:date:message-id:reply-to;\n bh=qU6VSBcQxsvb8VTBqiW2OEKqYfFv4b/qxg2pVtnEqvs=;\n b=fVvh6Tvc3aZeccfGVmKy6yfo0FAqjp1pnem7PqZdGBnioW3No9Cv1ypcztX6Jpiq07\n VP7FNH68m8kqr22ODTK7YbtNKiogK+3kNmMzItsplLFst84naud5aWv7gp+FaxhQNN6M\n BpjlJtkwnvkJVTDeaWj9cgpV2JZMOmmehBFgs=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1711146407; x=1711751207;\n h=mime-version:references:in-reply-to:message-id:date:subject:cc:to\n :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=qU6VSBcQxsvb8VTBqiW2OEKqYfFv4b/qxg2pVtnEqvs=;\n b=CedSpR4bzhAodKUOBjIAjEwOoS/erK3M9GbeaJZnk8056Wc2NVT0vAmuXaJ6E2y8kk\n bdV3GWpQLO1b6rNf3MT9/Vo64OmKyU9nFxrcNd1B2FEyM6UKcduEGja6imNvey+ptxQq\n gnxgLL3UhPYFrybL41aPWDFWUAAqzc9Y5xS85uaZI2R2JAJSuG6GP8ly7dIDdpgANapC\n rUKvjpS2p+BEBQ86GjXLO+jGCc8yRhwuUS8YRd5oU1hn2j1Nqe3ypGmSStjC/nRS6vxi\n ElD1PRuNDdUdtArU8dWPQliDkxlNWbl0YlSNVTAW56J9atl1M3baqc7pnkc75Z8iMDzQ\n 3jMQ==",
        "X-Gm-Message-State": "AOJu0YwmfOcxMIvuvw1T0zCHbBZvlasegsAUtesWrIxeA6bWB1fDmlbA\n jUNB34w4x+qnXiksIes61KtRJVe6ESu9PI1j+M8BeVq+sQUZ0rMZrNEFAgX+ODmED69XVZEJE7D\n 9SviigqR/97dLkrnhKgfSgOKTfMC2K89xIFZrc9UBqpI45p/kQdBDfzWtywmQeyvycFVF8H0e2m\n U6pxTBey9/UlUvaFHcl5UJCVQmD8p6Uz4pIG6y6w==",
        "X-Google-Smtp-Source": "\n AGHT+IHCDlYIX8+ZAPoLOrKPmJPSnRB9778ySe2i6BJCE/uxbj500mEBUOlqmcxA9Ruo1ihfuiJUBg==",
        "X-Received": "by 2002:a05:6122:3809:b0:4d4:1551:6ef6 with SMTP id\n em9-20020a056122380900b004d415516ef6mr1149920vkb.2.1711146406749;\n Fri, 22 Mar 2024 15:26:46 -0700 (PDT)",
        "From": "Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,\n Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "Subject": "[RFC 1/2] lib/ethdev: Add link_speed lanes support into rte lib",
        "Date": "Fri, 22 Mar 2024 15:25:42 -0700",
        "Message-Id": "<20240322222543.23548-2-damodharam.ammepalli@broadcom.com>",
        "X-Mailer": "git-send-email 2.39.3",
        "In-Reply-To": "<20240322222543.23548-1-damodharam.ammepalli@broadcom.com>",
        "References": "<20240322222543.23548-1-damodharam.ammepalli@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Type": "multipart/signed; protocol=\"application/pkcs7-signature\";\n micalg=sha-256; boundary=\"000000000000c28d5c0614475131\"",
        "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": "Update the eth_dev_ops structure with new function vectors\nto get and set number of speed lanes. This will help user to\nconfigure  the same fixed speed with different number of lanes\nbased on the physical carrier type.\n\nSigned-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>\nReviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n lib/ethdev/ethdev_driver.h | 49 +++++++++++++++++++++++++++++++++++\n lib/ethdev/rte_ethdev.c    | 26 +++++++++++++++++++\n lib/ethdev/rte_ethdev.h    | 52 ++++++++++++++++++++++++++++++++++++++\n lib/ethdev/version.map     |  2 ++\n 4 files changed, 129 insertions(+)",
    "diff": "diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h\nindex 0dbf2dd6a2..b1f473e4de 100644\n--- a/lib/ethdev/ethdev_driver.h\n+++ b/lib/ethdev/ethdev_driver.h\n@@ -1179,6 +1179,51 @@ typedef int (*eth_rx_descriptor_dump_t)(const struct rte_eth_dev *dev,\n \t\t\t\t\tuint16_t queue_id, uint16_t offset,\n \t\t\t\t\tuint16_t num, FILE *file);\n \n+/**\n+ * @internal\n+ * Get number of current active lanes and max supported lanes\n+ *\n+ * @param dev\n+ *   ethdev handle of port.\n+ * @param speed_lanes_capa\n+ *   Number of active lanes that the link is trained up.\n+ *   Max number of lanes supported by HW\n+ * @return\n+ *   Negative errno value on error, 0 on success.\n+ *\n+ * @retval 0\n+ *   Success, get speed_lanes data success.\n+ * @retval -ENOTSUP\n+ *   Operation is not supported.\n+ * @retval -EIO\n+ *   Device is removed.\n+ */\n+typedef int (*eth_speed_lanes_get_t)(struct rte_eth_dev *dev,\n+\t\t\t\t     struct rte_eth_speed_lanes_capa *speed_lanes_capa);\n+\n+/**\n+ * @internal\n+ * Set speed lanes\n+ *\n+ * @param dev\n+ *   ethdev handle of port.\n+ * @param speed_lanes_capa\n+ *   Non-negative number of lanes\n+ *\n+ * @return\n+ *   Negative errno value on error, 0 on success.\n+ *\n+ * @retval 0\n+ *   Success, set lanes success.\n+ * @retval -ENOTSUP\n+ *   Operation is not supported.\n+ * @retval -EINVAL\n+ *   Unsupported mode requested.\n+ * @retval -EIO\n+ *   Device is removed.\n+ */\n+typedef int (*eth_speed_lanes_set_t)(struct rte_eth_dev *dev, uint32_t speed_lanes_capa);\n+\n /**\n  * @internal\n  * Dump Tx descriptor info to a file.\n@@ -1474,6 +1519,10 @@ struct eth_dev_ops {\n \teth_count_aggr_ports_t count_aggr_ports;\n \t/** Map a Tx queue with an aggregated port of the DPDK port */\n \teth_map_aggr_tx_affinity_t map_aggr_tx_affinity;\n+\t/** Get number of speed lanes supported and active lanes */\n+\teth_speed_lanes_get_t speed_lanes_get;\n+\t/** Set number of speed lanes */\n+\teth_speed_lanes_set_t speed_lanes_set;\n };\n \n /**\ndiff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex f1c658f49e..45e2f7645b 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -7008,4 +7008,30 @@ int rte_eth_dev_map_aggr_tx_affinity(uint16_t port_id, uint16_t tx_queue_id,\n \treturn ret;\n }\n \n+int\n+rte_eth_speed_lanes_get(uint16_t port_id, struct rte_eth_speed_lanes_capa *capa)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (*dev->dev_ops->speed_lanes_get == NULL)\n+\t\treturn -ENOTSUP;\n+\treturn eth_err(port_id, (*dev->dev_ops->speed_lanes_get)(dev, capa));\n+}\n+\n+int\n+rte_eth_speed_lanes_set(uint16_t port_id, uint32_t speed_lanes_capa)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (*dev->dev_ops->speed_lanes_set == NULL)\n+\t\treturn -ENOTSUP;\n+\treturn eth_err(port_id, (*dev->dev_ops->speed_lanes_set)(dev, speed_lanes_capa));\n+}\n+\n RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO);\ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex 147257d6a2..caae1f27c6 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -1997,6 +1997,12 @@ struct rte_eth_fec_capa {\n \tuint32_t capa;  /**< FEC capabilities bitmask */\n };\n \n+/* A structure used to get and set lanes capabilities per link speed */\n+struct rte_eth_speed_lanes_capa {\n+\tuint32_t active_lanes;\n+\tuint32_t max_lanes_cap;\n+};\n+\n #define RTE_ETH_ALL RTE_MAX_ETHPORTS\n \n /* Macros to check for valid port */\n@@ -6917,6 +6923,52 @@ rte_eth_tx_queue_count(uint16_t port_id, uint16_t queue_id)\n \treturn rc;\n }\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Get maximum speed lanes supported by the NIC.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param speed_lanes_capa\n+ *   speed_lanes_capa is out only with max speed lanes capabilities.\n+ *   If set to NULL, then its assumed zero or not supported.\n+ *\n+ * @return\n+ *   - A non-negative value of active lanes that currently link is up with.\n+ *   - A non-negative value that this HW scales up to for all speeds.\n+ *   - (-ENOTSUP) if underlying hardware OR driver doesn't support.\n+ *     that operation.\n+ *   - (-EIO) if device is removed.\n+ *   - (-ENODEV)  if *port_id* invalid.\n+ *   - (-EINVAL)  if *speed_lanes_capa* invalid\n+ */\n+__rte_experimental\n+int rte_eth_speed_lanes_get(uint16_t port_id, struct rte_eth_speed_lanes_capa *capa);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Set speed lanes supported by the NIC.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param speed_lanes\n+ *   speed_lanes a non-zero value of number lanes for this speeds.\n+ *\n+ * @return\n+ *  - (>=0) valid input and supported by driver or hardware.\n+ *   - (-ENOTSUP) if underlying hardware OR driver doesn't support.\n+ *     that operation.\n+ *   - (-EIO) if device is removed.\n+ *   - (-ENODEV)  if *port_id* invalid.\n+ *   - (-EINVAL)  if *speed_lanes* invalid\n+ */\n+__rte_experimental\n+int rte_eth_speed_lanes_set(uint16_t port_id, uint32_t speed_lanes_capa);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/ethdev/version.map b/lib/ethdev/version.map\nindex 79f6f5293b..9c27980f3a 100644\n--- a/lib/ethdev/version.map\n+++ b/lib/ethdev/version.map\n@@ -325,6 +325,8 @@ EXPERIMENTAL {\n \trte_flow_template_table_resizable;\n \trte_flow_template_table_resize;\n \trte_flow_template_table_resize_complete;\n+\trte_eth_speed_lanes_get;\n+\trte_eth_speed_lanes_set;\n };\n \n INTERNAL {\n",
    "prefixes": [
        "RFC",
        "1/2"
    ]
}