get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 834174,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/834174/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20171104085030.25430-7-saeedm@mellanox.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20171104085030.25430-7-saeedm@mellanox.com>",
    "list_archive_url": null,
    "date": "2017-11-04T08:50:24",
    "name": "[net-next,06/12] net/mlx5e: Support DSCP trust state to Ethernet's IP packet on SQ",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "14fe070c3a74f0e65d8fdc9d4399b1fc0f390e1e",
    "submitter": {
        "id": 65299,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/65299/?format=api",
        "name": "Saeed Mahameed",
        "email": "saeedm@mellanox.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/1.2/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20171104085030.25430-7-saeedm@mellanox.com/mbox/",
    "series": [
        {
            "id": 11869,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/11869/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=11869",
            "date": "2017-11-04T08:50:18",
            "name": "[net-next,01/12] net/dcb: Add dscp to priority selector type",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/11869/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/834174/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/834174/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yTXdH6LDlz9sBW\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  4 Nov 2017 19:52:19 +1100 (AEDT)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932240AbdKDIwM (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 4 Nov 2017 04:52:12 -0400",
            "from mail-il-dmz.mellanox.com ([193.47.165.129]:54508 \"EHLO\n\tmellanox.co.il\" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org\n\twith ESMTP id S1756274AbdKDIwE (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 4 Nov 2017 04:52:04 -0400",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tsaeedm@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 4 Nov 2017 10:51:59 +0200",
            "from mti-swat15.mti.labs.mlnx. (mti-swat15.mti.labs.mlnx\n\t[10.20.1.123])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id vA48pkiU022678;\n\tSat, 4 Nov 2017 10:51:58 +0200"
        ],
        "From": "Saeed Mahameed <saeedm@mellanox.com>",
        "To": "\"David S. Miller\" <davem@davemloft.net>",
        "Cc": "netdev@vger.kernel.org, Huy Nguyen <huyn@mellanox.com>,\n\tSaeed Mahameed <saeedm@mellanox.com>",
        "Subject": "[net-next 06/12] net/mlx5e: Support DSCP trust state to Ethernet's\n\tIP packet on SQ",
        "Date": "Sat,  4 Nov 2017 01:50:24 -0700",
        "Message-Id": "<20171104085030.25430-7-saeedm@mellanox.com>",
        "X-Mailer": "git-send-email 2.14.2",
        "In-Reply-To": "<20171104085030.25430-1-saeedm@mellanox.com>",
        "References": "<20171104085030.25430-1-saeedm@mellanox.com>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Huy Nguyen <huyn@mellanox.com>\n\nIf the port is in DSCP trust state, packets are placed in the right\npriority queue based on the dscp value. This is done by selecting\nthe transmit queue based on the dscp of the skb.\n\nUntil now select_queue honors priority only from the vlan header.\nHowever that is not sufficient in cases where port trust state is DSCP\nmode as packet might not even contain vlan header. Therefore if the port\nis in dscp trust state and vport's min inline mode is not NONE,\ncopy the IP header to the eseg's inline header if the skb has it.\nThis is done by changing the transmit queue sq's min inline mode to L3.\nNote that the min inline mode of sqs that belong to other features such\nas xdpsq, icosq are not modified.\n\nSigned-off-by: Huy Nguyen <huyn@mellanox.com>\nReviewed-by: Parav Pandit <parav@mellanox.com>\nSigned-off-by: Saeed Mahameed <saeedm@mellanox.com>\n---\n drivers/net/ethernet/mellanox/mlx5/core/en.h       |  1 +\n .../net/ethernet/mellanox/mlx5/core/en_common.c    | 12 +++++++\n drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 37 ++++++++++++++++++++++\n drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  5 +--\n drivers/net/ethernet/mellanox/mlx5/core/en_tx.c    | 24 ++++++++++++--\n 5 files changed, 73 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h\nindex ab6f0c18850f..fae7b62d173f 100644\n--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h\n+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h\n@@ -1083,4 +1083,5 @@ void mlx5e_destroy_netdev(struct mlx5e_priv *priv);\n void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,\n \t\t\t    struct mlx5e_params *params,\n \t\t\t    u16 max_channels);\n+u8 mlx5e_params_calculate_tx_min_inline(struct mlx5_core_dev *mdev);\n #endif /* __MLX5_EN_H__ */\ndiff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c\nindex 157d02917237..784e282803db 100644\n--- a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c\n+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c\n@@ -171,3 +171,15 @@ int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb)\n \n \treturn err;\n }\n+\n+u8 mlx5e_params_calculate_tx_min_inline(struct mlx5_core_dev *mdev)\n+{\n+\tu8 min_inline_mode;\n+\n+\tmlx5_query_min_inline(mdev, &min_inline_mode);\n+\tif (min_inline_mode == MLX5_INLINE_MODE_NONE &&\n+\t    !MLX5_CAP_ETH(mdev, wqe_vlan_insert))\n+\t\tmin_inline_mode = MLX5_INLINE_MODE_L2;\n+\n+\treturn min_inline_mode;\n+}\ndiff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c\nindex aa59c4324159..b402d69a701b 100644\n--- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c\n+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c\n@@ -960,6 +960,40 @@ void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv)\n \tmlx5e_dcbnl_dscp_app(priv, DELETE);\n }\n \n+static void mlx5e_trust_update_tx_min_inline_mode(struct mlx5e_priv *priv,\n+\t\t\t\t\t\t  struct mlx5e_params *params)\n+{\n+\tparams->tx_min_inline_mode = mlx5e_params_calculate_tx_min_inline(priv->mdev);\n+\tif (priv->dcbx_dp.trust_state == MLX5_QPTS_TRUST_DSCP &&\n+\t    params->tx_min_inline_mode == MLX5_INLINE_MODE_L2)\n+\t\tparams->tx_min_inline_mode = MLX5_INLINE_MODE_IP;\n+}\n+\n+static void mlx5e_trust_update_sq_inline_mode(struct mlx5e_priv *priv)\n+{\n+\tstruct mlx5e_channels new_channels = {};\n+\n+\tmutex_lock(&priv->state_lock);\n+\n+\tif (!test_bit(MLX5E_STATE_OPENED, &priv->state))\n+\t\tgoto out;\n+\n+\tnew_channels.params = priv->channels.params;\n+\tmlx5e_trust_update_tx_min_inline_mode(priv, &new_channels.params);\n+\n+\t/* Skip if tx_min_inline is the same */\n+\tif (new_channels.params.tx_min_inline_mode ==\n+\t    priv->channels.params.tx_min_inline_mode)\n+\t\tgoto out;\n+\n+\tif (mlx5e_open_channels(priv, &new_channels))\n+\t\tgoto out;\n+\tmlx5e_switch_priv_channels(priv, &new_channels, NULL);\n+\n+out:\n+\tmutex_unlock(&priv->state_lock);\n+}\n+\n static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)\n {\n \tint err;\n@@ -968,6 +1002,7 @@ static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)\n \tif (err)\n \t\treturn err;\n \tpriv->dcbx_dp.trust_state = trust_state;\n+\tmlx5e_trust_update_sq_inline_mode(priv);\n \n \treturn err;\n }\n@@ -996,6 +1031,8 @@ static int mlx5e_trust_initialize(struct mlx5e_priv *priv)\n \tif (err)\n \t\treturn err;\n \n+\tmlx5e_trust_update_tx_min_inline_mode(priv, &priv->channels.params);\n+\n \terr = mlx5_query_dscp2prio(priv->mdev, priv->dcbx_dp.dscp2prio);\n \tif (err)\n \t\treturn err;\ndiff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c\nindex 8633476fb536..a97ee38143aa 100644\n--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c\n+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c\n@@ -4071,10 +4071,7 @@ void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,\n \n \t/* TX inline */\n \tparams->tx_max_inline = mlx5e_get_max_inline_cap(mdev);\n-\tmlx5_query_min_inline(mdev, &params->tx_min_inline_mode);\n-\tif (params->tx_min_inline_mode == MLX5_INLINE_MODE_NONE &&\n-\t    !MLX5_CAP_ETH(mdev, wqe_vlan_insert))\n-\t\tparams->tx_min_inline_mode = MLX5_INLINE_MODE_L2;\n+\tparams->tx_min_inline_mode = mlx5e_params_calculate_tx_min_inline(mdev);\n \n \t/* RSS */\n \tparams->rss_hfunc = ETH_RSS_HASH_XOR;\ndiff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c\nindex a7c208a1ad83..de651de35c9b 100644\n--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c\n+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c\n@@ -32,6 +32,7 @@\n \n #include <linux/tcp.h>\n #include <linux/if_vlan.h>\n+#include <net/dsfield.h>\n #include \"en.h\"\n #include \"ipoib/ipoib.h\"\n #include \"en_accel/ipsec_rxtx.h\"\n@@ -86,6 +87,20 @@ static void mlx5e_dma_unmap_wqe_err(struct mlx5e_txqsq *sq, u8 num_dma)\n \t}\n }\n \n+#ifdef CONFIG_MLX5_CORE_EN_DCB\n+static inline int mlx5e_get_dscp_up(struct mlx5e_priv *priv, struct sk_buff *skb)\n+{\n+\tint dscp_cp = 0;\n+\n+\tif (skb->protocol == htons(ETH_P_IP))\n+\t\tdscp_cp = ipv4_get_dsfield(ip_hdr(skb)) >> 2;\n+\telse if (skb->protocol == htons(ETH_P_IPV6))\n+\t\tdscp_cp = ipv6_get_dsfield(ipv6_hdr(skb)) >> 2;\n+\n+\treturn priv->dcbx_dp.dscp2prio[dscp_cp];\n+}\n+#endif\n+\n u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,\n \t\t       void *accel_priv, select_queue_fallback_t fallback)\n {\n@@ -97,8 +112,13 @@ u16 mlx5e_select_queue(struct net_device *dev, struct sk_buff *skb,\n \tif (!netdev_get_num_tc(dev))\n \t\treturn channel_ix;\n \n-\tif (skb_vlan_tag_present(skb))\n-\t\tup = skb->vlan_tci >> VLAN_PRIO_SHIFT;\n+#ifdef CONFIG_MLX5_CORE_EN_DCB\n+\tif (priv->dcbx_dp.trust_state == MLX5_QPTS_TRUST_DSCP)\n+\t\tup = mlx5e_get_dscp_up(priv, skb);\n+\telse\n+#endif\n+\t\tif (skb_vlan_tag_present(skb))\n+\t\t\tup = skb->vlan_tci >> VLAN_PRIO_SHIFT;\n \n \t/* channel_ix can be larger than num_channels since\n \t * dev->num_real_tx_queues = num_channels * num_tc\n",
    "prefixes": [
        "net-next",
        "06/12"
    ]
}