get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1291780,
    "url": "http://patchwork.ozlabs.org/api/patches/1291780/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200516005121.4963-13-anthony.l.nguyen@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20200516005121.4963-13-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2020-05-16T00:51:19",
    "name": "[S45,13/15] ice: Fix transmit for all software offloaded VLANs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9e0068daa9121597d108b9e72752e74ddce12230",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200516005121.4963-13-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 177330,
            "url": "http://patchwork.ozlabs.org/api/series/177330/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=177330",
            "date": "2020-05-16T00:51:18",
            "name": "[S45,01/15] ice: Refactor ice_ena_vf_mappings to split MSIX and queue mappings",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/177330/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1291780/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1291780/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49P6H513Gfz9sTC\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 16 May 2020 10:54:09 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 7374E89A27;\n\tSat, 16 May 2020 00:54:07 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id gtOJ3EW4Jsyw; Sat, 16 May 2020 00:54:05 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id DED0489A23;\n\tSat, 16 May 2020 00:54:04 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id 5E0F61BF9C6\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:53:59 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by fraxinus.osuosl.org (Postfix) with ESMTP id 5B18D87F7D\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:53:59 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id 4qjqc1_jVZHJ for <intel-wired-lan@lists.osuosl.org>;\n Sat, 16 May 2020 00:53:58 +0000 (UTC)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by fraxinus.osuosl.org (Postfix) with ESMTPS id E3F08881F1\n for <intel-wired-lan@lists.osuosl.org>; Sat, 16 May 2020 00:53:56 +0000 (UTC)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 May 2020 17:53:54 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by orsmga003.jf.intel.com with ESMTP; 15 May 2020 17:53:54 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n Ra+VD6KhlYWN1CAxaJxwnOn7BQGIBefRp9M5568OKh6Gaowvg5dpwsEdI3VjxEtMLEVEP7ZpgZ\n UGCkYZqcg0JQ==",
            "\n IBsUSnH1laFUrBu0jBjtfIAe4Y9CLk788UHr0jVS/neCYITHpdaK6PsahfEWZcFBKwEmeV5/GP\n +KaL0XdayxMQ=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,397,1583222400\"; d=\"scan'208\";a=\"263360549\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 15 May 2020 17:51:19 -0700",
        "Message-Id": "<20200516005121.4963-13-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200516005121.4963-1-anthony.l.nguyen@intel.com>",
        "References": "<20200516005121.4963-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S45 13/15] ice: Fix transmit for all\n software offloaded VLANs",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Brett Creeley <brett.creeley@intel.com>\n\nCurrently the driver does not recognize when there is an 802.1AD VLAN\ntag right after the dmac/smac (outermost VLAN tag). If any DCB map is\napplied and/or DCB is enabled this is causing the hardware to insert a\nVLAN 0 tag after the 802.1AD VLAN tag that is already in the packet.\nFix this by preventing VLAN tag 0 from being added when any VLAN is\nalready present after dmac/smac (software offloaded) or skb (hardware\noffloaded).\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 28 +++++-------\n drivers/net/ethernet/intel/ice/ice_dcb_lib.h |  2 +-\n drivers/net/ethernet/intel/ice/ice_txrx.c    | 45 +++++---------------\n 3 files changed, 21 insertions(+), 54 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex d5055d9e3fd2..663d29c0f4a4 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -828,39 +828,31 @@ void ice_update_dcb_stats(struct ice_pf *pf)\n  * ice_tx_prepare_vlan_flags_dcb - prepare VLAN tagging for DCB\n  * @tx_ring: ring to send buffer on\n  * @first: pointer to struct ice_tx_buf\n+ *\n+ * This should not be called if the outer VLAN is software offloaded as the VLAN\n+ * tag will already be configured with the correct ID and priority bits\n  */\n-int\n+void\n ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,\n \t\t\t      struct ice_tx_buf *first)\n {\n \tstruct sk_buff *skb = first->skb;\n \n \tif (!test_bit(ICE_FLAG_DCB_ENA, tx_ring->vsi->back->flags))\n-\t\treturn 0;\n+\t\treturn;\n \n \t/* Insert 802.1p priority into VLAN header */\n-\tif ((first->tx_flags & (ICE_TX_FLAGS_HW_VLAN | ICE_TX_FLAGS_SW_VLAN)) ||\n+\tif ((first->tx_flags & ICE_TX_FLAGS_HW_VLAN) ||\n \t    skb->priority != TC_PRIO_CONTROL) {\n \t\tfirst->tx_flags &= ~ICE_TX_FLAGS_VLAN_PR_M;\n \t\t/* Mask the lower 3 bits to set the 802.1p priority */\n \t\tfirst->tx_flags |= (skb->priority & 0x7) <<\n \t\t\t\t   ICE_TX_FLAGS_VLAN_PR_S;\n-\t\tif (first->tx_flags & ICE_TX_FLAGS_SW_VLAN) {\n-\t\t\tstruct vlan_ethhdr *vhdr;\n-\t\t\tint rc;\n-\n-\t\t\trc = skb_cow_head(skb, 0);\n-\t\t\tif (rc < 0)\n-\t\t\t\treturn rc;\n-\t\t\tvhdr = (struct vlan_ethhdr *)skb->data;\n-\t\t\tvhdr->h_vlan_TCI = htons(first->tx_flags >>\n-\t\t\t\t\t\t ICE_TX_FLAGS_VLAN_S);\n-\t\t} else {\n-\t\t\tfirst->tx_flags |= ICE_TX_FLAGS_HW_VLAN;\n-\t\t}\n+\t\t/* if this is not already set it means a VLAN 0 + priority needs\n+\t\t * to be offloaded\n+\t\t */\n+\t\tfirst->tx_flags |= ICE_TX_FLAGS_HW_VLAN;\n \t}\n-\n-\treturn 0;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\nindex a7a5d9833a93..c76cca3e489e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\n@@ -27,7 +27,7 @@ void ice_pf_dcb_recfg(struct ice_pf *pf);\n void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi);\n int ice_init_pf_dcb(struct ice_pf *pf, bool locked);\n void ice_update_dcb_stats(struct ice_pf *pf);\n-int\n+void\n ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,\n \t\t\t      struct ice_tx_buf *first);\n void\ndiff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c\nindex 4b1a7ab147f8..4d08e4756f50 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx.c\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c\n@@ -2037,49 +2037,25 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)\n  *\n  * Checks the skb and set up correspondingly several generic transmit flags\n  * related to VLAN tagging for the HW, such as VLAN, DCB, etc.\n- *\n- * Returns error code indicate the frame should be dropped upon error and the\n- * otherwise returns 0 to indicate the flags has been set properly.\n  */\n-static int\n+static void\n ice_tx_prepare_vlan_flags(struct ice_ring *tx_ring, struct ice_tx_buf *first)\n {\n \tstruct sk_buff *skb = first->skb;\n-\t__be16 protocol = skb->protocol;\n-\n-\tif (protocol == htons(ETH_P_8021Q) &&\n-\t    !(tx_ring->netdev->features & NETIF_F_HW_VLAN_CTAG_TX)) {\n-\t\t/* when HW VLAN acceleration is turned off by the user the\n-\t\t * stack sets the protocol to 8021q so that the driver\n-\t\t * can take any steps required to support the SW only\n-\t\t * VLAN handling. In our case the driver doesn't need\n-\t\t * to take any further steps so just set the protocol\n-\t\t * to the encapsulated ethertype.\n-\t\t */\n-\t\tskb->protocol = vlan_get_protocol(skb);\n-\t\treturn 0;\n-\t}\n \n-\t/* if we have a HW VLAN tag being added, default to the HW one */\n+\t/* nothing left to do, software offloaded VLAN */\n+\tif (!skb_vlan_tag_present(skb) && eth_type_vlan(skb->protocol))\n+\t\treturn;\n+\n+\t/* currently, we always assume 802.1Q for VLAN insertion as VLAN\n+\t * insertion for 802.1AD is not supported\n+\t */\n \tif (skb_vlan_tag_present(skb)) {\n \t\tfirst->tx_flags |= skb_vlan_tag_get(skb) << ICE_TX_FLAGS_VLAN_S;\n \t\tfirst->tx_flags |= ICE_TX_FLAGS_HW_VLAN;\n-\t} else if (protocol == htons(ETH_P_8021Q)) {\n-\t\tstruct vlan_hdr *vhdr, _vhdr;\n-\n-\t\t/* for SW VLAN, check the next protocol and store the tag */\n-\t\tvhdr = (struct vlan_hdr *)skb_header_pointer(skb, ETH_HLEN,\n-\t\t\t\t\t\t\t     sizeof(_vhdr),\n-\t\t\t\t\t\t\t     &_vhdr);\n-\t\tif (!vhdr)\n-\t\t\treturn -EINVAL;\n-\n-\t\tfirst->tx_flags |= ntohs(vhdr->h_vlan_TCI) <<\n-\t\t\t\t   ICE_TX_FLAGS_VLAN_S;\n-\t\tfirst->tx_flags |= ICE_TX_FLAGS_SW_VLAN;\n \t}\n \n-\treturn ice_tx_prepare_vlan_flags_dcb(tx_ring, first);\n+\tice_tx_prepare_vlan_flags_dcb(tx_ring, first);\n }\n \n /**\n@@ -2387,8 +2363,7 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)\n \tfirst->tx_flags = 0;\n \n \t/* prepare the VLAN tagging flags for Tx */\n-\tif (ice_tx_prepare_vlan_flags(tx_ring, first))\n-\t\tgoto out_drop;\n+\tice_tx_prepare_vlan_flags(tx_ring, first);\n \n \t/* set up TSO offload */\n \ttso = ice_tso(first, &offload);\n",
    "prefixes": [
        "S45",
        "13/15"
    ]
}