.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * QLogic qlcnic NIC Driver |
---|
3 | 4 | * Copyright (c) 2009-2013 QLogic Corporation |
---|
4 | | - * |
---|
5 | | - * See LICENSE.qlcnic for copyright and licensing details. |
---|
6 | 5 | */ |
---|
7 | 6 | |
---|
8 | 7 | #include "qlcnic_sriov.h" |
---|
.. | .. |
---|
1028 | 1027 | #define QLCNIC_ENABLE_INGRESS_ENCAP_PARSING 1 |
---|
1029 | 1028 | #define QLCNIC_DISABLE_INGRESS_ENCAP_PARSING 0 |
---|
1030 | 1029 | |
---|
1031 | | -static int qlcnic_set_vxlan_port(struct qlcnic_adapter *adapter) |
---|
| 1030 | +int qlcnic_set_vxlan_port(struct qlcnic_adapter *adapter, u16 port) |
---|
1032 | 1031 | { |
---|
1033 | | - u16 port = adapter->ahw->vxlan_port; |
---|
1034 | 1032 | struct qlcnic_cmd_args cmd; |
---|
1035 | 1033 | int ret = 0; |
---|
1036 | 1034 | |
---|
.. | .. |
---|
1057 | 1055 | return ret; |
---|
1058 | 1056 | } |
---|
1059 | 1057 | |
---|
1060 | | -static int qlcnic_set_vxlan_parsing(struct qlcnic_adapter *adapter, |
---|
1061 | | - bool state) |
---|
| 1058 | +int qlcnic_set_vxlan_parsing(struct qlcnic_adapter *adapter, u16 port) |
---|
1062 | 1059 | { |
---|
1063 | | - u16 vxlan_port = adapter->ahw->vxlan_port; |
---|
1064 | 1060 | struct qlcnic_cmd_args cmd; |
---|
1065 | 1061 | int ret = 0; |
---|
1066 | 1062 | |
---|
.. | .. |
---|
1071 | 1067 | if (ret) |
---|
1072 | 1068 | return ret; |
---|
1073 | 1069 | |
---|
1074 | | - cmd.req.arg[1] = state ? QLCNIC_ENABLE_INGRESS_ENCAP_PARSING : |
---|
1075 | | - QLCNIC_DISABLE_INGRESS_ENCAP_PARSING; |
---|
| 1070 | + cmd.req.arg[1] = port ? QLCNIC_ENABLE_INGRESS_ENCAP_PARSING : |
---|
| 1071 | + QLCNIC_DISABLE_INGRESS_ENCAP_PARSING; |
---|
1076 | 1072 | |
---|
1077 | 1073 | ret = qlcnic_issue_cmd(adapter, &cmd); |
---|
1078 | 1074 | if (ret) |
---|
1079 | 1075 | netdev_err(adapter->netdev, |
---|
1080 | 1076 | "Failed to %s VXLAN parsing for port %d\n", |
---|
1081 | | - state ? "enable" : "disable", vxlan_port); |
---|
| 1077 | + port ? "enable" : "disable", port); |
---|
1082 | 1078 | else |
---|
1083 | 1079 | netdev_info(adapter->netdev, |
---|
1084 | 1080 | "%s VXLAN parsing for port %d\n", |
---|
1085 | | - state ? "Enabled" : "Disabled", vxlan_port); |
---|
| 1081 | + port ? "Enabled" : "Disabled", port); |
---|
1086 | 1082 | |
---|
1087 | 1083 | qlcnic_free_mbx_args(&cmd); |
---|
1088 | 1084 | |
---|
.. | .. |
---|
1093 | 1089 | { |
---|
1094 | 1090 | if (adapter->fhash.fnum) |
---|
1095 | 1091 | qlcnic_prune_lb_filters(adapter); |
---|
1096 | | - |
---|
1097 | | - if (adapter->flags & QLCNIC_ADD_VXLAN_PORT) { |
---|
1098 | | - if (qlcnic_set_vxlan_port(adapter)) |
---|
1099 | | - return; |
---|
1100 | | - |
---|
1101 | | - if (qlcnic_set_vxlan_parsing(adapter, true)) |
---|
1102 | | - return; |
---|
1103 | | - |
---|
1104 | | - adapter->flags &= ~QLCNIC_ADD_VXLAN_PORT; |
---|
1105 | | - } else if (adapter->flags & QLCNIC_DEL_VXLAN_PORT) { |
---|
1106 | | - if (qlcnic_set_vxlan_parsing(adapter, false)) |
---|
1107 | | - return; |
---|
1108 | | - |
---|
1109 | | - adapter->ahw->vxlan_port = 0; |
---|
1110 | | - adapter->flags &= ~QLCNIC_DEL_VXLAN_PORT; |
---|
1111 | | - } |
---|
1112 | 1092 | } |
---|
1113 | 1093 | |
---|
1114 | 1094 | /** |
---|
.. | .. |
---|
2525 | 2505 | goto disable_mbx_intr; |
---|
2526 | 2506 | |
---|
2527 | 2507 | qlcnic_83xx_clear_function_resources(adapter); |
---|
2528 | | - qlcnic_dcb_enable(adapter->dcb); |
---|
| 2508 | + |
---|
| 2509 | + err = qlcnic_dcb_enable(adapter->dcb); |
---|
| 2510 | + if (err) { |
---|
| 2511 | + qlcnic_dcb_free(adapter->dcb); |
---|
| 2512 | + goto disable_mbx_intr; |
---|
| 2513 | + } |
---|
| 2514 | + |
---|
2529 | 2515 | qlcnic_83xx_initialize_nic(adapter, 1); |
---|
2530 | 2516 | qlcnic_dcb_get_info(adapter->dcb); |
---|
2531 | 2517 | |
---|