.. | .. |
---|
| 1 | +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) |
---|
1 | 2 | /* QLogic qed NIC Driver |
---|
2 | 3 | * Copyright (c) 2015-2017 QLogic Corporation |
---|
3 | | - * |
---|
4 | | - * This software is available to you under a choice of one of two |
---|
5 | | - * licenses. You may choose to be licensed under the terms of the GNU |
---|
6 | | - * General Public License (GPL) Version 2, available from the file |
---|
7 | | - * COPYING in the main directory of this source tree, or the |
---|
8 | | - * OpenIB.org BSD license below: |
---|
9 | | - * |
---|
10 | | - * Redistribution and use in source and binary forms, with or |
---|
11 | | - * without modification, are permitted provided that the following |
---|
12 | | - * conditions are met: |
---|
13 | | - * |
---|
14 | | - * - Redistributions of source code must retain the above |
---|
15 | | - * copyright notice, this list of conditions and the following |
---|
16 | | - * disclaimer. |
---|
17 | | - * |
---|
18 | | - * - Redistributions in binary form must reproduce the above |
---|
19 | | - * copyright notice, this list of conditions and the following |
---|
20 | | - * disclaimer in the documentation and /or other materials |
---|
21 | | - * provided with the distribution. |
---|
22 | | - * |
---|
23 | | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
---|
24 | | - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
---|
25 | | - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
---|
26 | | - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
---|
27 | | - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
---|
28 | | - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
---|
29 | | - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
---|
30 | | - * SOFTWARE. |
---|
| 4 | + * Copyright (c) 2019-2020 Marvell International Ltd. |
---|
31 | 5 | */ |
---|
32 | 6 | |
---|
33 | 7 | #include <linux/types.h> |
---|
.. | .. |
---|
204 | 178 | else |
---|
205 | 179 | p_data->arr[type].update = DONT_UPDATE_DCB_DSCP; |
---|
206 | 180 | |
---|
207 | | - /* Do not add vlan tag 0 when DCB is enabled and port in UFP/OV mode */ |
---|
208 | | - if ((test_bit(QED_MF_8021Q_TAGGING, &p_hwfn->cdev->mf_bits) || |
---|
209 | | - test_bit(QED_MF_8021AD_TAGGING, &p_hwfn->cdev->mf_bits))) |
---|
| 181 | + if (test_bit(QED_MF_DONT_ADD_VLAN0_TAG, &p_hwfn->cdev->mf_bits)) |
---|
210 | 182 | p_data->arr[type].dont_add_vlan0 = true; |
---|
211 | 183 | |
---|
212 | 184 | /* QM reconf data */ |
---|
.. | .. |
---|
262 | 234 | *type = DCBX_PROTOCOL_ROCE_V2; |
---|
263 | 235 | } else { |
---|
264 | 236 | *type = DCBX_MAX_PROTOCOL_TYPE; |
---|
265 | | - DP_ERR(p_hwfn, "No action required, App TLV entry = 0x%x\n", |
---|
266 | | - app_prio_bitmap); |
---|
| 237 | + DP_VERBOSE(p_hwfn, QED_MSG_DCB, |
---|
| 238 | + "No action required, App TLV entry = 0x%x\n", |
---|
| 239 | + app_prio_bitmap); |
---|
267 | 240 | return false; |
---|
268 | 241 | } |
---|
269 | 242 | |
---|
.. | .. |
---|
574 | 547 | struct dcbx_ets_feature *p_ets, |
---|
575 | 548 | struct qed_dcbx_params *p_params) |
---|
576 | 549 | { |
---|
577 | | - u32 bw_map[2], tsa_map[2], pri_map; |
---|
| 550 | + __be32 bw_map[2], tsa_map[2]; |
---|
| 551 | + u32 pri_map; |
---|
578 | 552 | int i; |
---|
579 | 553 | |
---|
580 | 554 | p_params->ets_willing = QED_MFW_GET_FIELD(p_ets->flags, |
---|
.. | .. |
---|
600 | 574 | /* 8 bit tsa and bw data corresponding to each of the 8 TC's are |
---|
601 | 575 | * encoded in a type u32 array of size 2. |
---|
602 | 576 | */ |
---|
603 | | - bw_map[0] = be32_to_cpu(p_ets->tc_bw_tbl[0]); |
---|
604 | | - bw_map[1] = be32_to_cpu(p_ets->tc_bw_tbl[1]); |
---|
605 | | - tsa_map[0] = be32_to_cpu(p_ets->tc_tsa_tbl[0]); |
---|
606 | | - tsa_map[1] = be32_to_cpu(p_ets->tc_tsa_tbl[1]); |
---|
| 577 | + cpu_to_be32_array(bw_map, p_ets->tc_bw_tbl, 2); |
---|
| 578 | + cpu_to_be32_array(tsa_map, p_ets->tc_tsa_tbl, 2); |
---|
607 | 579 | pri_map = p_ets->pri_tc_tbl[0]; |
---|
| 580 | + |
---|
608 | 581 | for (i = 0; i < QED_MAX_PFC_PRIORITIES; i++) { |
---|
609 | 582 | p_params->ets_tc_bw_tbl[i] = ((u8 *)bw_map)[i]; |
---|
610 | 583 | p_params->ets_tc_tsa_tbl[i] = ((u8 *)tsa_map)[i]; |
---|
.. | .. |
---|
1081 | 1054 | struct dcbx_ets_feature *p_ets, |
---|
1082 | 1055 | struct qed_dcbx_params *p_params) |
---|
1083 | 1056 | { |
---|
1084 | | - u8 *bw_map, *tsa_map; |
---|
| 1057 | + __be32 bw_map[2], tsa_map[2]; |
---|
1085 | 1058 | u32 val; |
---|
1086 | 1059 | int i; |
---|
1087 | 1060 | |
---|
.. | .. |
---|
1103 | 1076 | p_ets->flags &= ~DCBX_ETS_MAX_TCS_MASK; |
---|
1104 | 1077 | p_ets->flags |= (u32)p_params->max_ets_tc << DCBX_ETS_MAX_TCS_SHIFT; |
---|
1105 | 1078 | |
---|
1106 | | - bw_map = (u8 *)&p_ets->tc_bw_tbl[0]; |
---|
1107 | | - tsa_map = (u8 *)&p_ets->tc_tsa_tbl[0]; |
---|
1108 | 1079 | p_ets->pri_tc_tbl[0] = 0; |
---|
| 1080 | + |
---|
1109 | 1081 | for (i = 0; i < QED_MAX_PFC_PRIORITIES; i++) { |
---|
1110 | | - bw_map[i] = p_params->ets_tc_bw_tbl[i]; |
---|
1111 | | - tsa_map[i] = p_params->ets_tc_tsa_tbl[i]; |
---|
| 1082 | + ((u8 *)bw_map)[i] = p_params->ets_tc_bw_tbl[i]; |
---|
| 1083 | + ((u8 *)tsa_map)[i] = p_params->ets_tc_tsa_tbl[i]; |
---|
| 1084 | + |
---|
1112 | 1085 | /* Copy the priority value to the corresponding 4 bits in the |
---|
1113 | 1086 | * traffic class table. |
---|
1114 | 1087 | */ |
---|
1115 | 1088 | val = (((u32)p_params->ets_pri_tc_tbl[i]) << ((7 - i) * 4)); |
---|
1116 | 1089 | p_ets->pri_tc_tbl[0] |= val; |
---|
1117 | 1090 | } |
---|
1118 | | - for (i = 0; i < 2; i++) { |
---|
1119 | | - p_ets->tc_bw_tbl[i] = cpu_to_be32(p_ets->tc_bw_tbl[i]); |
---|
1120 | | - p_ets->tc_tsa_tbl[i] = cpu_to_be32(p_ets->tc_tsa_tbl[i]); |
---|
1121 | | - } |
---|
| 1091 | + |
---|
| 1092 | + be32_to_cpu_array(p_ets->tc_bw_tbl, bw_map, 2); |
---|
| 1093 | + be32_to_cpu_array(p_ets->tc_tsa_tbl, tsa_map, 2); |
---|
1122 | 1094 | } |
---|
1123 | 1095 | |
---|
1124 | 1096 | static void |
---|