get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 127834,
    "url": "https://patches.dpdk.org/api/patches/127834/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230601114220.17796-4-denis.pryazhennikov@arknetworks.am/",
    "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": "<20230601114220.17796-4-denis.pryazhennikov@arknetworks.am>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230601114220.17796-4-denis.pryazhennikov@arknetworks.am",
    "date": "2023-06-01T11:42:19",
    "name": "[3/4] common/sfc_efx/base: add support for configure MAC to keep FCS",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e02c94d395e94446d3cf887a5c7a7f1389b8b15b",
    "submitter": {
        "id": 3057,
        "url": "https://patches.dpdk.org/api/people/3057/?format=api",
        "name": "Denis Pryazhennikov",
        "email": "denis.pryazhennikov@arknetworks.am"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230601114220.17796-4-denis.pryazhennikov@arknetworks.am/mbox/",
    "series": [
        {
            "id": 28300,
            "url": "https://patches.dpdk.org/api/series/28300/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=28300",
            "date": "2023-06-01T11:42:16",
            "name": "net/sfc: support KEEP_CRC offload",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/28300/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/127834/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/127834/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 6039342C02;\n\tThu,  1 Jun 2023 13:42:44 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A8BF242D38;\n\tThu,  1 Jun 2023 13:42:28 +0200 (CEST)",
            "from agw.arknetworks.am (agw.arknetworks.am [79.141.165.80])\n by mails.dpdk.org (Postfix) with ESMTP id E31A2410D0\n for <dev@dpdk.org>; Thu,  1 Jun 2023 13:42:24 +0200 (CEST)",
            "from localhost.localdomain (unknown [37.252.90.53])\n (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA512)\n (No client certificate requested)\n by agw.arknetworks.am (Postfix) with ESMTPSA id 37EE5E1273;\n Thu,  1 Jun 2023 15:42:24 +0400 (+04)"
        ],
        "From": "Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>",
        "To": "dev@dpdk.org",
        "Cc": "Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,\n Ferruh Yigit <ferruh.yigit@amd.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Roman Zhukov <roman.zhukov@arknetworks.am>,\n Andy Moreton <amoreton@xilinx.com>",
        "Subject": "[PATCH 3/4] common/sfc_efx/base: add support for configure MAC to\n keep FCS",
        "Date": "Thu,  1 Jun 2023 15:42:19 +0400",
        "Message-Id": "<20230601114220.17796-4-denis.pryazhennikov@arknetworks.am>",
        "X-Mailer": "git-send-email 2.37.0 (Apple Git-136)",
        "In-Reply-To": "<20230601114220.17796-1-denis.pryazhennikov@arknetworks.am>",
        "References": "<20230601114220.17796-1-denis.pryazhennikov@arknetworks.am>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "Drivers cannot determine if received packet includes the FCS or not.\nOnly packets with an external port have the FCS included and functions\nwithout link control privilege cannot determine the MAC configuration.\nThis patch is trying to make assumptions that: if PF is the only function\n(there are no VFs or additional PFs); it can set the MAC configuration and\nit never expects packets it sends to be looped back then it can assume that\nchanged the MAC configuration to include the FCS is safe and that all\nreceived packets will include their FCS.\n\nSigned-off-by: Roman Zhukov <roman.zhukov@arknetworks.am>\nSigned-off-by: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/ef10_mac.c |  5 +--\n drivers/common/sfc_efx/base/efx.h      |  5 +++\n drivers/common/sfc_efx/base/efx_impl.h |  1 +\n drivers/common/sfc_efx/base/efx_mac.c  | 48 ++++++++++++++++++++++++++\n drivers/common/sfc_efx/version.map     |  1 +\n 5 files changed, 58 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/ef10_mac.c b/drivers/common/sfc_efx/base/ef10_mac.c\nindex 28228a9fb784..bfc82b80c7e5 100644\n--- a/drivers/common/sfc_efx/base/ef10_mac.c\n+++ b/drivers/common/sfc_efx/base/ef10_mac.c\n@@ -307,9 +307,10 @@ ef10_mac_reconfigure(\n \t */\n \tMCDI_IN_SET_DWORD(req, SET_MAC_IN_FCNTL, MC_CMD_FCNTL_AUTO);\n \n-\t/* Do not include the Ethernet frame checksum in RX packets */\n+\t/* Include the Ethernet frame checksum in RX packets if it's required */\n \tMCDI_IN_POPULATE_DWORD_1(req, SET_MAC_IN_FLAGS,\n-\t\t\t\t    SET_MAC_IN_FLAG_INCLUDE_FCS, 0);\n+\t\t\t\t    SET_MAC_IN_FLAG_INCLUDE_FCS,\n+\t\t\t\t    epp->ep_include_fcs ? 1 : 0);\n \n \tefx_mcdi_execute_quiet(enp, &req);\n \ndiff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex ff281167767d..b52baaa7a452 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -747,6 +747,11 @@ efx_mac_fcntl_get(\n \t__out\t\tunsigned int *fcntl_wantedp,\n \t__out\t\tunsigned int *fcntl_linkp);\n \n+LIBEFX_API\n+extern\t__checkReturn\tefx_rc_t\n+efx_mac_include_fcs_set(\n+\t__in efx_nic_t *enp,\n+\t__in boolean_t enabled);\n \n #if EFSYS_OPT_MAC_STATS\n \ndiff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h\nindex 45e99d01c58f..b6461c14399e 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -363,6 +363,7 @@ typedef struct efx_port_s {\n \tuint32_t\t\tep_default_adv_cap_mask;\n \tuint32_t\t\tep_phy_cap_mask;\n \tboolean_t\t\tep_mac_drain;\n+\tboolean_t\t\tep_include_fcs;\n #if EFSYS_OPT_BIST\n \tefx_bist_type_t\t\tep_current_bist;\n #endif\ndiff --git a/drivers/common/sfc_efx/base/efx_mac.c b/drivers/common/sfc_efx/base/efx_mac.c\nindex c51e86b52c29..13cac5a75130 100644\n--- a/drivers/common/sfc_efx/base/efx_mac.c\n+++ b/drivers/common/sfc_efx/base/efx_mac.c\n@@ -527,6 +527,54 @@ efx_mac_filter_default_rxq_clear(\n \t\temop->emo_filter_default_rxq_clear(enp);\n }\n \n+\t__checkReturn\tefx_rc_t\n+efx_mac_include_fcs_set(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tboolean_t enabled)\n+{\n+\tefx_port_t *epp = &(enp->en_port);\n+\tefx_nic_cfg_t *encp = &(enp->en_nic_cfg);\n+\tconst efx_mac_ops_t *emop = epp->ep_emop;\n+\tefx_rc_t rc;\n+\n+\tEFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);\n+\tEFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);\n+\tEFSYS_ASSERT(emop != NULL);\n+\n+\tif (enabled && !encp->enc_rx_include_fcs_supported) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail1;\n+\t}\n+\n+\t/*\n+\t * Enabling 'include FCS' changes link control state and affects\n+\t * behaviour for all PCI functions on the port, so to avoid this it\n+\t * can be enabled only if the PCI function is exclusive port user\n+\t */\n+\tif (enabled && encp->enc_port_usage != EFX_PORT_USAGE_EXCLUSIVE) {\n+\t\trc = EACCES;\n+\t\tgoto fail2;\n+\t}\n+\n+\tif (epp->ep_include_fcs != enabled) {\n+\t\tepp->ep_include_fcs = enabled;\n+\n+\t\trc = emop->emo_reconfigure(enp);\n+\t\tif (rc != 0)\n+\t\t\tgoto fail3;\n+\t}\n+\n+\treturn 0;\n+\n+fail3:\n+\tEFSYS_PROBE(fail3);\n+fail2:\n+\tEFSYS_PROBE(fail2);\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\n+\treturn rc;\n+}\n \n #if EFSYS_OPT_MAC_STATS\n \ndiff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map\nindex d9b04a611d25..a54dba81f578 100644\n--- a/drivers/common/sfc_efx/version.map\n+++ b/drivers/common/sfc_efx/version.map\n@@ -71,6 +71,7 @@ INTERNAL {\n \tefx_mac_drain;\n \tefx_mac_fcntl_get;\n \tefx_mac_fcntl_set;\n+\tefx_mac_include_fcs_set;\n \tefx_mac_filter_default_rxq_clear;\n \tefx_mac_filter_default_rxq_set;\n \tefx_mac_filter_get_all_ucast_mcast;\n",
    "prefixes": [
        "3/4"
    ]
}