get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 76537,
    "url": "https://patches.dpdk.org/api/patches/76537/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200904082921.17400-3-hemant.agrawal@nxp.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20200904082921.17400-3-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200904082921.17400-3-hemant.agrawal@nxp.com",
    "date": "2020-09-04T08:29:17",
    "name": "[v7,3/7] bus/dpaa: add shared MAC support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "de7662748b45dce8dd6d0ac97c398864c6e06643",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200904082921.17400-3-hemant.agrawal@nxp.com/mbox/",
    "series": [
        {
            "id": 11949,
            "url": "https://patches.dpdk.org/api/series/11949/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11949",
            "date": "2020-09-04T08:29:15",
            "name": "[v7,1/7] net/dpaa: add VSP support in FMLIB",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/11949/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/76537/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/76537/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C3E95A04B1;\n\tFri,  4 Sep 2020 10:35:53 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 922401C0D0;\n\tFri,  4 Sep 2020 10:35:39 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n by dpdk.org (Postfix) with ESMTP id E9F711C0AF\n for <dev@dpdk.org>; Fri,  4 Sep 2020 10:35:35 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C8E132003AA;\n Fri,  4 Sep 2020 10:35:35 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n [165.114.16.14])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id F15F7201652;\n Fri,  4 Sep 2020 10:35:33 +0200 (CEST)",
            "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n [10.232.133.63])\n by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id E4133402D9;\n Fri,  4 Sep 2020 10:35:31 +0200 (CEST)"
        ],
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Fri,  4 Sep 2020 13:59:17 +0530",
        "Message-Id": "<20200904082921.17400-3-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200904082921.17400-1-hemant.agrawal@nxp.com>",
        "References": "<20200901123650.29908-1-hemant.agrawal@nxp.com>\n <20200904082921.17400-1-hemant.agrawal@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v7 3/7] bus/dpaa: add shared MAC support",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "From: Radu Bulie <radu-andrei.bulie@nxp.com>\n\nA shared MAC interface is an interface which can be used\nby both kernel and userspace based on classification configuration\nIt is defined in dts with the compatible string \"fsl,dpa-ethernet-shared\"\nwhich bpool will be seeded by the dpdk partition and configured\nas a netdev by the dpaa Linux eth driver.\nUser space buffers from the bpool will be kmapped by the kernel.\n\nSigned-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>\nSigned-off-by: Jun Yang <jun.yang@nxp.com>\nSigned-off-by: Nipun Gupta <nipun.gupta@nxp.com>\nAcked-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/bus/dpaa/base/fman/fman.c | 27 ++++++++++++++++++++++-----\n drivers/bus/dpaa/include/fman.h   |  2 ++\n drivers/net/dpaa/dpaa_ethdev.c    | 31 +++++++++++++++++--------------\n drivers/net/dpaa/dpaa_flow.c      | 18 ++++++++++++++----\n 4 files changed, 55 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c\nindex 33be9e5d7..3ae29bf06 100644\n--- a/drivers/bus/dpaa/base/fman/fman.c\n+++ b/drivers/bus/dpaa/base/fman/fman.c\n@@ -167,13 +167,21 @@ fman_if_init(const struct device_node *dpa_node)\n \tconst char *mname, *fname;\n \tconst char *dname = dpa_node->full_name;\n \tsize_t lenp;\n-\tint _errno;\n+\tint _errno, is_shared = 0;\n \tconst char *char_prop;\n \tuint32_t na;\n \n \tif (of_device_is_available(dpa_node) == false)\n \t\treturn 0;\n \n+\tif (!of_device_is_compatible(dpa_node, \"fsl,dpa-ethernet-init\") &&\n+\t\t!of_device_is_compatible(dpa_node, \"fsl,dpa-ethernet-shared\")) {\n+\t\treturn 0;\n+\t}\n+\n+\tif (of_device_is_compatible(dpa_node, \"fsl,dpa-ethernet-shared\"))\n+\t\tis_shared = 1;\n+\n \trprop = \"fsl,qman-frame-queues-rx\";\n \tmprop = \"fsl,fman-mac\";\n \n@@ -387,7 +395,7 @@ fman_if_init(const struct device_node *dpa_node)\n \t\tgoto err;\n \t}\n \n-\tassert(lenp == (4 * sizeof(phandle)));\n+\tassert(lenp >= (4 * sizeof(phandle)));\n \n \tna = of_n_addr_cells(mac_node);\n \t/* Get rid of endianness (issues). Convert to host byte order */\n@@ -408,7 +416,7 @@ fman_if_init(const struct device_node *dpa_node)\n \t\tgoto err;\n \t}\n \n-\tassert(lenp == (4 * sizeof(phandle)));\n+\tassert(lenp >= (4 * sizeof(phandle)));\n \t/*TODO: Fix for other cases also */\n \tna = of_n_addr_cells(mac_node);\n \t/* Get rid of endianness (issues). Convert to host byte order */\n@@ -508,6 +516,9 @@ fman_if_init(const struct device_node *dpa_node)\n \t\tpools_phandle++;\n \t}\n \n+\tif (is_shared)\n+\t\t__if->__if.is_shared_mac = 1;\n+\n \t/* Parsing of the network interface is complete, add it to the list */\n \tDPAA_BUS_LOG(DEBUG, \"Found %s, Tx Channel = %x, FMAN = %x,\"\n \t\t    \"Port ID = %x\",\n@@ -524,7 +535,7 @@ fman_if_init(const struct device_node *dpa_node)\n int\n fman_init(void)\n {\n-\tconst struct device_node *dpa_node;\n+\tconst struct device_node *dpa_node, *parent_node;\n \tint _errno;\n \n \t/* If multiple dependencies try to initialise the Fman driver, don't\n@@ -539,7 +550,13 @@ fman_init(void)\n \t\treturn fman_ccsr_map_fd;\n \t}\n \n-\tfor_each_compatible_node(dpa_node, NULL, \"fsl,dpa-ethernet-init\") {\n+\tparent_node = of_find_compatible_node(NULL, NULL, \"fsl,dpaa\");\n+\tif (!parent_node) {\n+\t\tDPAA_BUS_LOG(ERR, \"Unable to find fsl,dpaa node\");\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tfor_each_child_node(parent_node, dpa_node) {\n \t\t_errno = fman_if_init(dpa_node);\n \t\tif (_errno) {\n \t\t\tFMAN_ERR(_errno, \"if_init(%s)\\n\", dpa_node->full_name);\ndiff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h\nindex 7a0a7d405..cb7f18ca2 100644\n--- a/drivers/bus/dpaa/include/fman.h\n+++ b/drivers/bus/dpaa/include/fman.h\n@@ -320,6 +320,8 @@ struct fman_if {\n \tstruct rte_ether_addr mac_addr;\n \t/* The Qman channel to schedule Tx FQs to */\n \tu16 tx_channel_id;\n+\n+\tuint8_t is_shared_mac;\n \t/* The hard-coded FQIDs for this interface. Note: this doesn't cover\n \t * the PCD nor the \"Rx default\" FQIDs, which are configured via FMC\n \t * and its XML-based configuration.\ndiff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c\nindex c5b9ac1a5..c2d480397 100644\n--- a/drivers/net/dpaa/dpaa_ethdev.c\n+++ b/drivers/net/dpaa/dpaa_ethdev.c\n@@ -351,7 +351,8 @@ static void dpaa_eth_dev_stop(struct rte_eth_dev *dev)\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_disable_rx(fif);\n+\tif (!fif->is_shared_mac)\n+\t\tfman_if_disable_rx(fif);\n \tdev->tx_pkt_burst = dpaa_eth_tx_drop_all;\n }\n \n@@ -1807,19 +1808,21 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \t\tfman_intf->mac_addr.addr_bytes[4],\n \t\tfman_intf->mac_addr.addr_bytes[5]);\n \n-\n-\t/* Disable RX mode */\n-\tfman_if_discard_rx_errors(fman_intf);\n-\tfman_if_disable_rx(fman_intf);\n-\t/* Disable promiscuous mode */\n-\tfman_if_promiscuous_disable(fman_intf);\n-\t/* Disable multicast */\n-\tfman_if_reset_mcast_filter_table(fman_intf);\n-\t/* Reset interface statistics */\n-\tfman_if_stats_reset(fman_intf);\n-\t/* Disable SG by default */\n-\tfman_if_set_sg(fman_intf, 0);\n-\tfman_if_set_maxfrm(fman_intf, RTE_ETHER_MAX_LEN + VLAN_TAG_SIZE);\n+\tif (!fman_intf->is_shared_mac) {\n+\t\t/* Disable RX mode */\n+\t\tfman_if_discard_rx_errors(fman_intf);\n+\t\tfman_if_disable_rx(fman_intf);\n+\t\t/* Disable promiscuous mode */\n+\t\tfman_if_promiscuous_disable(fman_intf);\n+\t\t/* Disable multicast */\n+\t\tfman_if_reset_mcast_filter_table(fman_intf);\n+\t\t/* Reset interface statistics */\n+\t\tfman_if_stats_reset(fman_intf);\n+\t\t/* Disable SG by default */\n+\t\tfman_if_set_sg(fman_intf, 0);\n+\t\tfman_if_set_maxfrm(fman_intf,\n+\t\t\t\t   RTE_ETHER_MAX_LEN + VLAN_TAG_SIZE);\n+\t}\n \n \treturn 0;\n \ndiff --git a/drivers/net/dpaa/dpaa_flow.c b/drivers/net/dpaa/dpaa_flow.c\nindex a12141efe..d24cd856c 100644\n--- a/drivers/net/dpaa/dpaa_flow.c\n+++ b/drivers/net/dpaa/dpaa_flow.c\n@@ -736,6 +736,14 @@ int dpaa_fm_deconfig(struct dpaa_if *dpaa_intf,\n \t}\n \tdpaa_intf->netenv_handle = NULL;\n \n+\tif (fif && fif->is_shared_mac) {\n+\t\tret = fm_port_enable(dpaa_intf->port_handle);\n+\t\tif (ret != E_OK) {\n+\t\t\tDPAA_PMD_ERR(\"shared mac re-enable failed\");\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n \t/* FM PORT Close */\n \tfm_port_close(dpaa_intf->port_handle);\n \tdpaa_intf->port_handle = NULL;\n@@ -785,10 +793,12 @@ int dpaa_fm_config(struct rte_eth_dev *dev, uint64_t req_dist_set)\n \t\t}\n \t}\n \t/* Set default netenv and scheme */\n-\tret = set_default_scheme(dpaa_intf);\n-\tif (ret) {\n-\t\tDPAA_PMD_ERR(\"Set PCD NetEnv and Scheme: Failed\");\n-\t\tgoto unset_pcd_netenv_scheme1;\n+\tif (!fif->is_shared_mac) {\n+\t\tret = set_default_scheme(dpaa_intf);\n+\t\tif (ret) {\n+\t\t\tDPAA_PMD_ERR(\"Set PCD NetEnv and Scheme: Failed\");\n+\t\t\tgoto unset_pcd_netenv_scheme1;\n+\t\t}\n \t}\n \n \t/* Set Port PCD */\n",
    "prefixes": [
        "v7",
        "3/7"
    ]
}