i40iw: Add missing VLAN priority
authorMustafa Ismail <mustafa.ismail@intel.com>
Tue, 19 Sep 2017 14:19:12 +0000 (09:19 -0500)
committerDoug Ledford <dledford@redhat.com>
Fri, 22 Sep 2017 17:43:36 +0000 (13:43 -0400)
Set the VLAN priority which is in the upper 3 bits of the VLAN
tag field in the QP context.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_cm.c
drivers/infiniband/hw/i40iw/i40iw_cm.h

index 14f36ba4e5bebf8e35970c9cc5b6030c95ffa213..b7215448bb63bb0431fd025ec7c5c0428e781f6c 100644 (file)
@@ -3255,7 +3255,8 @@ static void i40iw_init_tcp_ctx(struct i40iw_cm_node *cm_node,
        tcp_info->snd_mss = cpu_to_le32(((u32)cm_node->tcp_cntxt.mss));
        if (cm_node->vlan_id < VLAN_TAG_PRESENT) {
                tcp_info->insert_vlan_tag = true;
-               tcp_info->vlan_tag = cpu_to_le16(cm_node->vlan_id);
+               tcp_info->vlan_tag = cpu_to_le16(((u16)cm_node->user_pri << I40IW_VLAN_PRIO_SHIFT) |
+                                                 cm_node->vlan_id);
        }
        if (cm_node->ipv4) {
                tcp_info->src_port = cpu_to_le16(cm_node->loc_port);
index 2e52e38ffcf37cf5673868f873536907dddc2cf1..8626e7f1fdd34af8349dba569e9b0f782ea580d9 100644 (file)
@@ -71,6 +71,8 @@
 #define        I40IW_HW_IRD_SETTING_32 32
 #define        I40IW_HW_IRD_SETTING_64 64
 
+#define I40IW_VLAN_PRIO_SHIFT   13
+
 enum ietf_mpa_flags {
        IETF_MPA_FLAGS_MARKERS = 0x80,  /* receive Markers */
        IETF_MPA_FLAGS_CRC = 0x40,      /* receive Markers */