diff options
author | Devesh Sharma <devesh.sharma@emulex.com> | 2014-07-02 02:06:04 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-08-13 01:07:30 -0400 |
commit | 0ea8726250cae3defa0c1065801017f26a269c93 (patch) | |
tree | 06712b6edb9ed314d049ad6bb6a1731a9704fc4f /drivers/infiniband/hw/ocrdma/ocrdma_ah.c | |
parent | 741742ed71c2cc12573ea6cf41ef1fbb3b2efe97 (diff) |
RDMA/ocrdma: Obtain SL from device structure
Currently, driver obtains service level value from ah_attr->sl field.
However, this field is set to zero all the times from rdma-cm. This
patch allows create_ah to obtain service level from dev->sl.
Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_ah.c')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_ah.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c index a023234d4b92..40f8536c10b0 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include "ocrdma_ah.h" | 35 | #include "ocrdma_ah.h" |
36 | #include "ocrdma_hw.h" | 36 | #include "ocrdma_hw.h" |
37 | 37 | ||
38 | #define OCRDMA_VID_PCP_SHIFT 0xD | ||
39 | |||
38 | static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, | 40 | static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, |
39 | struct ib_ah_attr *attr, int pdid) | 41 | struct ib_ah_attr *attr, int pdid) |
40 | { | 42 | { |
@@ -55,7 +57,7 @@ static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah, | |||
55 | if (vlan_tag && (vlan_tag < 0x1000)) { | 57 | if (vlan_tag && (vlan_tag < 0x1000)) { |
56 | eth.eth_type = cpu_to_be16(0x8100); | 58 | eth.eth_type = cpu_to_be16(0x8100); |
57 | eth.roce_eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE); | 59 | eth.roce_eth_type = cpu_to_be16(OCRDMA_ROCE_ETH_TYPE); |
58 | vlan_tag |= (attr->sl & 7) << 13; | 60 | vlan_tag |= (dev->sl & 0x07) << OCRDMA_VID_PCP_SHIFT; |
59 | eth.vlan_tag = cpu_to_be16(vlan_tag); | 61 | eth.vlan_tag = cpu_to_be16(vlan_tag); |
60 | eth_sz = sizeof(struct ocrdma_eth_vlan); | 62 | eth_sz = sizeof(struct ocrdma_eth_vlan); |
61 | vlan_enabled = true; | 63 | vlan_enabled = true; |