Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * |
| 3 | * Intel Ethernet Controller XL710 Family Linux Virtual Function Driver |
Mitch Williams | ef8693e | 2014-02-13 03:48:53 -0800 | [diff] [blame] | 4 | * Copyright(c) 2013 - 2014 Intel Corporation. |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms and conditions of the GNU General Public License, |
| 8 | * version 2, as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | * more details. |
| 14 | * |
Jesse Brandeburg | b831607 | 2014-04-05 07:46:11 +0000 | [diff] [blame] | 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | * |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 18 | * The full GNU General Public License is included in this distribution in |
| 19 | * the file called "COPYING". |
| 20 | * |
| 21 | * Contact Information: |
| 22 | * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> |
| 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 24 | * |
| 25 | ******************************************************************************/ |
| 26 | |
| 27 | #include "i40evf.h" |
| 28 | #include "i40e_prototype.h" |
Mitch Williams | ed0e894 | 2017-01-24 10:23:59 -0800 | [diff] [blame] | 29 | #include "i40evf_client.h" |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 30 | |
| 31 | /* busy wait delay in msec */ |
| 32 | #define I40EVF_BUSY_WAIT_DELAY 10 |
| 33 | #define I40EVF_BUSY_WAIT_COUNT 50 |
| 34 | |
| 35 | /** |
| 36 | * i40evf_send_pf_msg |
| 37 | * @adapter: adapter structure |
| 38 | * @op: virtual channel opcode |
| 39 | * @msg: pointer to message buffer |
| 40 | * @len: message length |
| 41 | * |
| 42 | * Send message to PF and print status if failure. |
| 43 | **/ |
| 44 | static int i40evf_send_pf_msg(struct i40evf_adapter *adapter, |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 45 | enum virtchnl_ops op, u8 *msg, u16 len) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 46 | { |
| 47 | struct i40e_hw *hw = &adapter->hw; |
| 48 | i40e_status err; |
| 49 | |
Mitch Williams | ef8693e | 2014-02-13 03:48:53 -0800 | [diff] [blame] | 50 | if (adapter->flags & I40EVF_FLAG_PF_COMMS_FAILED) |
| 51 | return 0; /* nothing to see here, move along */ |
| 52 | |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 53 | err = i40e_aq_send_msg_to_pf(hw, op, 0, msg, len, NULL); |
| 54 | if (err) |
Mitch Williams | 905770f | 2017-07-14 09:27:01 -0400 | [diff] [blame] | 55 | dev_dbg(&adapter->pdev->dev, "Unable to send opcode %d to PF, err %s, aq_err %s\n", |
Shannon Nelson | f1c7e72 | 2015-06-04 16:24:01 -0400 | [diff] [blame] | 56 | op, i40evf_stat_str(hw, err), |
| 57 | i40evf_aq_str(hw, hw->aq.asq_last_status)); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 58 | return err; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * i40evf_send_api_ver |
| 63 | * @adapter: adapter structure |
| 64 | * |
| 65 | * Send API version admin queue message to the PF. The reply is not checked |
| 66 | * in this function. Returns 0 if the message was successfully |
| 67 | * sent, or one of the I40E_ADMIN_QUEUE_ERROR_ statuses if not. |
| 68 | **/ |
| 69 | int i40evf_send_api_ver(struct i40evf_adapter *adapter) |
| 70 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 71 | struct virtchnl_version_info vvi; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 72 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 73 | vvi.major = VIRTCHNL_VERSION_MAJOR; |
| 74 | vvi.minor = VIRTCHNL_VERSION_MINOR; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 75 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 76 | return i40evf_send_pf_msg(adapter, VIRTCHNL_OP_VERSION, (u8 *)&vvi, |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 77 | sizeof(vvi)); |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * i40evf_verify_api_ver |
| 82 | * @adapter: adapter structure |
| 83 | * |
| 84 | * Compare API versions with the PF. Must be called after admin queue is |
Mitch Williams | 6a8e93d | 2014-06-05 00:09:17 +0000 | [diff] [blame] | 85 | * initialized. Returns 0 if API versions match, -EIO if they do not, |
| 86 | * I40E_ERR_ADMIN_QUEUE_NO_WORK if the admin queue is empty, and any errors |
| 87 | * from the firmware are propagated. |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 88 | **/ |
| 89 | int i40evf_verify_api_ver(struct i40evf_adapter *adapter) |
| 90 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 91 | struct virtchnl_version_info *pf_vvi; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 92 | struct i40e_hw *hw = &adapter->hw; |
| 93 | struct i40e_arq_event_info event; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 94 | enum virtchnl_ops op; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 95 | i40e_status err; |
| 96 | |
Mitch Williams | 1001dc3 | 2014-11-11 20:02:19 +0000 | [diff] [blame] | 97 | event.buf_len = I40EVF_MAX_AQ_BUF_SIZE; |
| 98 | event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 99 | if (!event.msg_buf) { |
| 100 | err = -ENOMEM; |
| 101 | goto out; |
| 102 | } |
| 103 | |
Mitch Williams | f8d4db3 | 2014-10-25 03:24:33 +0000 | [diff] [blame] | 104 | while (1) { |
| 105 | err = i40evf_clean_arq_element(hw, &event, NULL); |
| 106 | /* When the AQ is empty, i40evf_clean_arq_element will return |
| 107 | * nonzero and this loop will terminate. |
| 108 | */ |
| 109 | if (err) |
| 110 | goto out_alloc; |
| 111 | op = |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 112 | (enum virtchnl_ops)le32_to_cpu(event.desc.cookie_high); |
| 113 | if (op == VIRTCHNL_OP_VERSION) |
Mitch Williams | f8d4db3 | 2014-10-25 03:24:33 +0000 | [diff] [blame] | 114 | break; |
| 115 | } |
| 116 | |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 117 | |
| 118 | err = (i40e_status)le32_to_cpu(event.desc.cookie_low); |
Mitch Williams | 6a8e93d | 2014-06-05 00:09:17 +0000 | [diff] [blame] | 119 | if (err) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 120 | goto out_alloc; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 121 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 122 | if (op != VIRTCHNL_OP_VERSION) { |
Mitch Williams | 6a8e93d | 2014-06-05 00:09:17 +0000 | [diff] [blame] | 123 | dev_info(&adapter->pdev->dev, "Invalid reply type %d from PF\n", |
Mitch Williams | f8d4db3 | 2014-10-25 03:24:33 +0000 | [diff] [blame] | 124 | op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 125 | err = -EIO; |
| 126 | goto out_alloc; |
| 127 | } |
| 128 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 129 | pf_vvi = (struct virtchnl_version_info *)event.msg_buf; |
Mitch Williams | ee1693e | 2015-06-04 16:23:59 -0400 | [diff] [blame] | 130 | adapter->pf_version = *pf_vvi; |
| 131 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 132 | if ((pf_vvi->major > VIRTCHNL_VERSION_MAJOR) || |
| 133 | ((pf_vvi->major == VIRTCHNL_VERSION_MAJOR) && |
| 134 | (pf_vvi->minor > VIRTCHNL_VERSION_MINOR))) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 135 | err = -EIO; |
| 136 | |
| 137 | out_alloc: |
| 138 | kfree(event.msg_buf); |
| 139 | out: |
| 140 | return err; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * i40evf_send_vf_config_msg |
| 145 | * @adapter: adapter structure |
| 146 | * |
| 147 | * Send VF configuration request admin queue message to the PF. The reply |
| 148 | * is not checked in this function. Returns 0 if the message was |
| 149 | * successfully sent, or one of the I40E_ADMIN_QUEUE_ERROR_ statuses if not. |
| 150 | **/ |
| 151 | int i40evf_send_vf_config_msg(struct i40evf_adapter *adapter) |
| 152 | { |
Mitch Williams | e6d038d | 2015-06-04 16:23:58 -0400 | [diff] [blame] | 153 | u32 caps; |
| 154 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 155 | caps = VIRTCHNL_VF_OFFLOAD_L2 | |
| 156 | VIRTCHNL_VF_OFFLOAD_RSS_PF | |
| 157 | VIRTCHNL_VF_OFFLOAD_RSS_AQ | |
| 158 | VIRTCHNL_VF_OFFLOAD_RSS_REG | |
| 159 | VIRTCHNL_VF_OFFLOAD_VLAN | |
| 160 | VIRTCHNL_VF_OFFLOAD_WB_ON_ITR | |
| 161 | VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 | |
| 162 | VIRTCHNL_VF_OFFLOAD_ENCAP | |
Alan Brady | 5b36e8d | 2017-08-22 06:57:50 -0400 | [diff] [blame] | 163 | VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM | |
| 164 | VIRTCHNL_VF_OFFLOAD_REQ_QUEUES; |
Anjali Singhai Jain | b9eacec | 2015-11-19 11:34:22 -0800 | [diff] [blame] | 165 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 166 | adapter->current_op = VIRTCHNL_OP_GET_VF_RESOURCES; |
Mitch Williams | e6d038d | 2015-06-04 16:23:58 -0400 | [diff] [blame] | 167 | adapter->aq_required &= ~I40EVF_FLAG_AQ_GET_CONFIG; |
| 168 | if (PF_IS_V11(adapter)) |
| 169 | return i40evf_send_pf_msg(adapter, |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 170 | VIRTCHNL_OP_GET_VF_RESOURCES, |
Mitch Williams | e6d038d | 2015-06-04 16:23:58 -0400 | [diff] [blame] | 171 | (u8 *)&caps, sizeof(caps)); |
| 172 | else |
| 173 | return i40evf_send_pf_msg(adapter, |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 174 | VIRTCHNL_OP_GET_VF_RESOURCES, |
Mitch Williams | e6d038d | 2015-06-04 16:23:58 -0400 | [diff] [blame] | 175 | NULL, 0); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | /** |
| 179 | * i40evf_get_vf_config |
| 180 | * @hw: pointer to the hardware structure |
| 181 | * @len: length of buffer |
| 182 | * |
| 183 | * Get VF configuration from PF and populate hw structure. Must be called after |
| 184 | * admin queue is initialized. Busy waits until response is received from PF, |
| 185 | * with maximum timeout. Response from PF is returned in the buffer for further |
| 186 | * processing by the caller. |
| 187 | **/ |
| 188 | int i40evf_get_vf_config(struct i40evf_adapter *adapter) |
| 189 | { |
| 190 | struct i40e_hw *hw = &adapter->hw; |
| 191 | struct i40e_arq_event_info event; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 192 | enum virtchnl_ops op; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 193 | i40e_status err; |
Mitch Williams | f8d4db3 | 2014-10-25 03:24:33 +0000 | [diff] [blame] | 194 | u16 len; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 195 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 196 | len = sizeof(struct virtchnl_vf_resource) + |
| 197 | I40E_MAX_VF_VSI * sizeof(struct virtchnl_vsi_resource); |
Mitch Williams | 1001dc3 | 2014-11-11 20:02:19 +0000 | [diff] [blame] | 198 | event.buf_len = len; |
| 199 | event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 200 | if (!event.msg_buf) { |
| 201 | err = -ENOMEM; |
| 202 | goto out; |
| 203 | } |
| 204 | |
Mitch Williams | f8d4db3 | 2014-10-25 03:24:33 +0000 | [diff] [blame] | 205 | while (1) { |
Mitch Williams | f8d4db3 | 2014-10-25 03:24:33 +0000 | [diff] [blame] | 206 | /* When the AQ is empty, i40evf_clean_arq_element will return |
| 207 | * nonzero and this loop will terminate. |
| 208 | */ |
| 209 | err = i40evf_clean_arq_element(hw, &event, NULL); |
| 210 | if (err) |
| 211 | goto out_alloc; |
| 212 | op = |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 213 | (enum virtchnl_ops)le32_to_cpu(event.desc.cookie_high); |
| 214 | if (op == VIRTCHNL_OP_GET_VF_RESOURCES) |
Mitch Williams | f8d4db3 | 2014-10-25 03:24:33 +0000 | [diff] [blame] | 215 | break; |
| 216 | } |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 217 | |
| 218 | err = (i40e_status)le32_to_cpu(event.desc.cookie_low); |
Mitch Williams | 1001dc3 | 2014-11-11 20:02:19 +0000 | [diff] [blame] | 219 | memcpy(adapter->vf_res, event.msg_buf, min(event.msg_len, len)); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 220 | |
| 221 | i40e_vf_parse_hw_config(hw, adapter->vf_res); |
| 222 | out_alloc: |
| 223 | kfree(event.msg_buf); |
| 224 | out: |
| 225 | return err; |
| 226 | } |
| 227 | |
| 228 | /** |
| 229 | * i40evf_configure_queues |
| 230 | * @adapter: adapter structure |
| 231 | * |
| 232 | * Request that the PF set up our (previously allocated) queues. |
| 233 | **/ |
| 234 | void i40evf_configure_queues(struct i40evf_adapter *adapter) |
| 235 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 236 | struct virtchnl_vsi_queue_config_info *vqci; |
| 237 | struct virtchnl_queue_pair_info *vqpi; |
Mitch Williams | cc05292 | 2014-10-25 03:24:34 +0000 | [diff] [blame] | 238 | int pairs = adapter->num_active_queues; |
Alexander Duyck | dab86af | 2017-03-14 10:15:27 -0700 | [diff] [blame] | 239 | int i, len, max_frame = I40E_MAX_RXBUFFER; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 240 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 241 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 242 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 243 | dev_err(&adapter->pdev->dev, "Cannot configure queues, command %d pending\n", |
| 244 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 245 | return; |
| 246 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 247 | adapter->current_op = VIRTCHNL_OP_CONFIG_VSI_QUEUES; |
| 248 | len = sizeof(struct virtchnl_vsi_queue_config_info) + |
| 249 | (sizeof(struct virtchnl_queue_pair_info) * pairs); |
Mitch Williams | a85088d | 2015-11-06 15:26:04 -0800 | [diff] [blame] | 250 | vqci = kzalloc(len, GFP_KERNEL); |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 251 | if (!vqci) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 252 | return; |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 253 | |
Alexander Duyck | dab86af | 2017-03-14 10:15:27 -0700 | [diff] [blame] | 254 | /* Limit maximum frame size when jumbo frames is not enabled */ |
| 255 | if (!(adapter->flags & I40EVF_FLAG_LEGACY_RX) && |
| 256 | (adapter->netdev->mtu <= ETH_DATA_LEN)) |
| 257 | max_frame = I40E_RXBUFFER_1536 - NET_IP_ALIGN; |
| 258 | |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 259 | vqci->vsi_id = adapter->vsi_res->vsi_id; |
| 260 | vqci->num_queue_pairs = pairs; |
| 261 | vqpi = vqci->qpair; |
| 262 | /* Size check is not needed here - HW max is 16 queue pairs, and we |
| 263 | * can fit info for 31 of them into the AQ buffer before it overflows. |
| 264 | */ |
| 265 | for (i = 0; i < pairs; i++) { |
| 266 | vqpi->txq.vsi_id = vqci->vsi_id; |
| 267 | vqpi->txq.queue_id = i; |
Mitch Williams | 0dd438d | 2015-10-26 19:44:40 -0400 | [diff] [blame] | 268 | vqpi->txq.ring_len = adapter->tx_rings[i].count; |
| 269 | vqpi->txq.dma_ring_addr = adapter->tx_rings[i].dma; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 270 | vqpi->rxq.vsi_id = vqci->vsi_id; |
| 271 | vqpi->rxq.queue_id = i; |
Mitch Williams | 0dd438d | 2015-10-26 19:44:40 -0400 | [diff] [blame] | 272 | vqpi->rxq.ring_len = adapter->rx_rings[i].count; |
| 273 | vqpi->rxq.dma_ring_addr = adapter->rx_rings[i].dma; |
Alexander Duyck | dab86af | 2017-03-14 10:15:27 -0700 | [diff] [blame] | 274 | vqpi->rxq.max_pkt_size = max_frame; |
| 275 | vqpi->rxq.databuffer_size = |
| 276 | ALIGN(adapter->rx_rings[i].rx_buf_len, |
| 277 | BIT_ULL(I40E_RXQ_CTX_DBUFF_SHIFT)); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 278 | vqpi++; |
| 279 | } |
| 280 | |
Mitch Williams | fc86a97 | 2014-06-04 20:41:38 +0000 | [diff] [blame] | 281 | adapter->aq_required &= ~I40EVF_FLAG_AQ_CONFIGURE_QUEUES; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 282 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_VSI_QUEUES, |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 283 | (u8 *)vqci, len); |
| 284 | kfree(vqci); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | /** |
| 288 | * i40evf_enable_queues |
| 289 | * @adapter: adapter structure |
| 290 | * |
| 291 | * Request that the PF enable all of our queues. |
| 292 | **/ |
| 293 | void i40evf_enable_queues(struct i40evf_adapter *adapter) |
| 294 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 295 | struct virtchnl_queue_select vqs; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 296 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 297 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 298 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 299 | dev_err(&adapter->pdev->dev, "Cannot enable queues, command %d pending\n", |
| 300 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 301 | return; |
| 302 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 303 | adapter->current_op = VIRTCHNL_OP_ENABLE_QUEUES; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 304 | vqs.vsi_id = adapter->vsi_res->vsi_id; |
Jesse Brandeburg | 41a1d04 | 2015-06-04 16:24:02 -0400 | [diff] [blame] | 305 | vqs.tx_queues = BIT(adapter->num_active_queues) - 1; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 306 | vqs.rx_queues = vqs.tx_queues; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 307 | adapter->aq_required &= ~I40EVF_FLAG_AQ_ENABLE_QUEUES; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 308 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_ENABLE_QUEUES, |
Mitch Williams | fc86a97 | 2014-06-04 20:41:38 +0000 | [diff] [blame] | 309 | (u8 *)&vqs, sizeof(vqs)); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | /** |
| 313 | * i40evf_disable_queues |
| 314 | * @adapter: adapter structure |
| 315 | * |
| 316 | * Request that the PF disable all of our queues. |
| 317 | **/ |
| 318 | void i40evf_disable_queues(struct i40evf_adapter *adapter) |
| 319 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 320 | struct virtchnl_queue_select vqs; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 321 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 322 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 323 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 324 | dev_err(&adapter->pdev->dev, "Cannot disable queues, command %d pending\n", |
| 325 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 326 | return; |
| 327 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 328 | adapter->current_op = VIRTCHNL_OP_DISABLE_QUEUES; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 329 | vqs.vsi_id = adapter->vsi_res->vsi_id; |
Jesse Brandeburg | 41a1d04 | 2015-06-04 16:24:02 -0400 | [diff] [blame] | 330 | vqs.tx_queues = BIT(adapter->num_active_queues) - 1; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 331 | vqs.rx_queues = vqs.tx_queues; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 332 | adapter->aq_required &= ~I40EVF_FLAG_AQ_DISABLE_QUEUES; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 333 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_DISABLE_QUEUES, |
Mitch Williams | fc86a97 | 2014-06-04 20:41:38 +0000 | [diff] [blame] | 334 | (u8 *)&vqs, sizeof(vqs)); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 335 | } |
| 336 | |
| 337 | /** |
| 338 | * i40evf_map_queues |
| 339 | * @adapter: adapter structure |
| 340 | * |
| 341 | * Request that the PF map queues to interrupt vectors. Misc causes, including |
| 342 | * admin queue, are always mapped to vector 0. |
| 343 | **/ |
| 344 | void i40evf_map_queues(struct i40evf_adapter *adapter) |
| 345 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 346 | struct virtchnl_irq_map_info *vimi; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 347 | int v_idx, q_vectors, len; |
| 348 | struct i40e_q_vector *q_vector; |
| 349 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 350 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 351 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 352 | dev_err(&adapter->pdev->dev, "Cannot map queues to vectors, command %d pending\n", |
| 353 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 354 | return; |
| 355 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 356 | adapter->current_op = VIRTCHNL_OP_CONFIG_IRQ_MAP; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 357 | |
| 358 | q_vectors = adapter->num_msix_vectors - NONQ_VECS; |
| 359 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 360 | len = sizeof(struct virtchnl_irq_map_info) + |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 361 | (adapter->num_msix_vectors * |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 362 | sizeof(struct virtchnl_vector_map)); |
Mitch Williams | a85088d | 2015-11-06 15:26:04 -0800 | [diff] [blame] | 363 | vimi = kzalloc(len, GFP_KERNEL); |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 364 | if (!vimi) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 365 | return; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 366 | |
| 367 | vimi->num_vectors = adapter->num_msix_vectors; |
| 368 | /* Queue vectors first */ |
| 369 | for (v_idx = 0; v_idx < q_vectors; v_idx++) { |
Mitch Williams | 7d96ba1 | 2015-10-26 19:44:39 -0400 | [diff] [blame] | 370 | q_vector = adapter->q_vectors + v_idx; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 371 | vimi->vecmap[v_idx].vsi_id = adapter->vsi_res->vsi_id; |
| 372 | vimi->vecmap[v_idx].vector_id = v_idx + NONQ_VECS; |
| 373 | vimi->vecmap[v_idx].txq_map = q_vector->ring_mask; |
| 374 | vimi->vecmap[v_idx].rxq_map = q_vector->ring_mask; |
| 375 | } |
| 376 | /* Misc vector last - this is only for AdminQ messages */ |
| 377 | vimi->vecmap[v_idx].vsi_id = adapter->vsi_res->vsi_id; |
| 378 | vimi->vecmap[v_idx].vector_id = 0; |
| 379 | vimi->vecmap[v_idx].txq_map = 0; |
| 380 | vimi->vecmap[v_idx].rxq_map = 0; |
| 381 | |
Mitch Williams | fc86a97 | 2014-06-04 20:41:38 +0000 | [diff] [blame] | 382 | adapter->aq_required &= ~I40EVF_FLAG_AQ_MAP_VECTORS; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 383 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_IRQ_MAP, |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 384 | (u8 *)vimi, len); |
| 385 | kfree(vimi); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | /** |
Alan Brady | 5b36e8d | 2017-08-22 06:57:50 -0400 | [diff] [blame] | 389 | * i40evf_request_queues |
| 390 | * @adapter: adapter structure |
| 391 | * @num: number of requested queues |
| 392 | * |
| 393 | * We get a default number of queues from the PF. This enables us to request a |
| 394 | * different number. Returns 0 on success, negative on failure |
| 395 | **/ |
| 396 | int i40evf_request_queues(struct i40evf_adapter *adapter, int num) |
| 397 | { |
| 398 | struct virtchnl_vf_res_request vfres; |
| 399 | |
| 400 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
| 401 | /* bail because we already have a command pending */ |
| 402 | dev_err(&adapter->pdev->dev, "Cannot request queues, command %d pending\n", |
| 403 | adapter->current_op); |
| 404 | return -EBUSY; |
| 405 | } |
| 406 | |
| 407 | vfres.num_queue_pairs = num; |
| 408 | |
| 409 | adapter->current_op = VIRTCHNL_OP_REQUEST_QUEUES; |
Alan Brady | 17a9422 | 2017-10-11 14:49:43 -0700 | [diff] [blame] | 410 | adapter->flags |= I40EVF_FLAG_REINIT_ITR_NEEDED; |
Alan Brady | 5b36e8d | 2017-08-22 06:57:50 -0400 | [diff] [blame] | 411 | return i40evf_send_pf_msg(adapter, VIRTCHNL_OP_REQUEST_QUEUES, |
| 412 | (u8 *)&vfres, sizeof(vfres)); |
| 413 | } |
| 414 | |
| 415 | /** |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 416 | * i40evf_add_ether_addrs |
| 417 | * @adapter: adapter structure |
| 418 | * @addrs: the MAC address filters to add (contiguous) |
| 419 | * @count: number of filters |
| 420 | * |
| 421 | * Request that the PF add one or more addresses to our filters. |
| 422 | **/ |
| 423 | void i40evf_add_ether_addrs(struct i40evf_adapter *adapter) |
| 424 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 425 | struct virtchnl_ether_addr_list *veal; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 426 | int len, i = 0, count = 0; |
| 427 | struct i40evf_mac_filter *f; |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 428 | bool more = false; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 429 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 430 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 431 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 432 | dev_err(&adapter->pdev->dev, "Cannot add filters, command %d pending\n", |
| 433 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 434 | return; |
| 435 | } |
| 436 | list_for_each_entry(f, &adapter->mac_filter_list, list) { |
| 437 | if (f->add) |
| 438 | count++; |
| 439 | } |
| 440 | if (!count) { |
| 441 | adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_MAC_FILTER; |
| 442 | return; |
| 443 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 444 | adapter->current_op = VIRTCHNL_OP_ADD_ETH_ADDR; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 445 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 446 | len = sizeof(struct virtchnl_ether_addr_list) + |
| 447 | (count * sizeof(struct virtchnl_ether_addr)); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 448 | if (len > I40EVF_MAX_AQ_BUF_SIZE) { |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 449 | dev_warn(&adapter->pdev->dev, "Too many add MAC changes in one request\n"); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 450 | count = (I40EVF_MAX_AQ_BUF_SIZE - |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 451 | sizeof(struct virtchnl_ether_addr_list)) / |
| 452 | sizeof(struct virtchnl_ether_addr); |
| 453 | len = sizeof(struct virtchnl_ether_addr_list) + |
| 454 | (count * sizeof(struct virtchnl_ether_addr)); |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 455 | more = true; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 456 | } |
| 457 | |
Mitch Williams | a85088d | 2015-11-06 15:26:04 -0800 | [diff] [blame] | 458 | veal = kzalloc(len, GFP_KERNEL); |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 459 | if (!veal) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 460 | return; |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 461 | |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 462 | veal->vsi_id = adapter->vsi_res->vsi_id; |
| 463 | veal->num_elements = count; |
| 464 | list_for_each_entry(f, &adapter->mac_filter_list, list) { |
| 465 | if (f->add) { |
Greg Rose | 9a17390 | 2014-05-22 06:32:02 +0000 | [diff] [blame] | 466 | ether_addr_copy(veal->list[i].addr, f->macaddr); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 467 | i++; |
| 468 | f->add = false; |
Mitch Williams | 0e8d95f89 | 2016-05-16 10:26:36 -0700 | [diff] [blame] | 469 | if (i == count) |
| 470 | break; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 471 | } |
| 472 | } |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 473 | if (!more) |
| 474 | adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_MAC_FILTER; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 475 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_ETH_ADDR, |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 476 | (u8 *)veal, len); |
| 477 | kfree(veal); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 478 | } |
| 479 | |
| 480 | /** |
| 481 | * i40evf_del_ether_addrs |
| 482 | * @adapter: adapter structure |
| 483 | * @addrs: the MAC address filters to remove (contiguous) |
| 484 | * @count: number of filtes |
| 485 | * |
| 486 | * Request that the PF remove one or more addresses from our filters. |
| 487 | **/ |
| 488 | void i40evf_del_ether_addrs(struct i40evf_adapter *adapter) |
| 489 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 490 | struct virtchnl_ether_addr_list *veal; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 491 | struct i40evf_mac_filter *f, *ftmp; |
| 492 | int len, i = 0, count = 0; |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 493 | bool more = false; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 494 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 495 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 496 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 497 | dev_err(&adapter->pdev->dev, "Cannot remove filters, command %d pending\n", |
| 498 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 499 | return; |
| 500 | } |
| 501 | list_for_each_entry(f, &adapter->mac_filter_list, list) { |
| 502 | if (f->remove) |
| 503 | count++; |
| 504 | } |
| 505 | if (!count) { |
| 506 | adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_MAC_FILTER; |
| 507 | return; |
| 508 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 509 | adapter->current_op = VIRTCHNL_OP_DEL_ETH_ADDR; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 510 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 511 | len = sizeof(struct virtchnl_ether_addr_list) + |
| 512 | (count * sizeof(struct virtchnl_ether_addr)); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 513 | if (len > I40EVF_MAX_AQ_BUF_SIZE) { |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 514 | dev_warn(&adapter->pdev->dev, "Too many delete MAC changes in one request\n"); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 515 | count = (I40EVF_MAX_AQ_BUF_SIZE - |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 516 | sizeof(struct virtchnl_ether_addr_list)) / |
| 517 | sizeof(struct virtchnl_ether_addr); |
| 518 | len = sizeof(struct virtchnl_ether_addr_list) + |
| 519 | (count * sizeof(struct virtchnl_ether_addr)); |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 520 | more = true; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 521 | } |
Mitch Williams | a85088d | 2015-11-06 15:26:04 -0800 | [diff] [blame] | 522 | veal = kzalloc(len, GFP_KERNEL); |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 523 | if (!veal) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 524 | return; |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 525 | |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 526 | veal->vsi_id = adapter->vsi_res->vsi_id; |
| 527 | veal->num_elements = count; |
| 528 | list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { |
| 529 | if (f->remove) { |
Greg Rose | 9a17390 | 2014-05-22 06:32:02 +0000 | [diff] [blame] | 530 | ether_addr_copy(veal->list[i].addr, f->macaddr); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 531 | i++; |
| 532 | list_del(&f->list); |
| 533 | kfree(f); |
Mitch Williams | 0e8d95f89 | 2016-05-16 10:26:36 -0700 | [diff] [blame] | 534 | if (i == count) |
| 535 | break; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 536 | } |
| 537 | } |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 538 | if (!more) |
| 539 | adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_MAC_FILTER; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 540 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_ETH_ADDR, |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 541 | (u8 *)veal, len); |
| 542 | kfree(veal); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 543 | } |
| 544 | |
| 545 | /** |
| 546 | * i40evf_add_vlans |
| 547 | * @adapter: adapter structure |
| 548 | * @vlans: the VLANs to add |
| 549 | * @count: number of VLANs |
| 550 | * |
| 551 | * Request that the PF add one or more VLAN filters to our VSI. |
| 552 | **/ |
| 553 | void i40evf_add_vlans(struct i40evf_adapter *adapter) |
| 554 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 555 | struct virtchnl_vlan_filter_list *vvfl; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 556 | int len, i = 0, count = 0; |
| 557 | struct i40evf_vlan_filter *f; |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 558 | bool more = false; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 559 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 560 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 561 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 562 | dev_err(&adapter->pdev->dev, "Cannot add VLANs, command %d pending\n", |
| 563 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 564 | return; |
| 565 | } |
| 566 | |
| 567 | list_for_each_entry(f, &adapter->vlan_filter_list, list) { |
| 568 | if (f->add) |
| 569 | count++; |
| 570 | } |
| 571 | if (!count) { |
| 572 | adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_VLAN_FILTER; |
| 573 | return; |
| 574 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 575 | adapter->current_op = VIRTCHNL_OP_ADD_VLAN; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 576 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 577 | len = sizeof(struct virtchnl_vlan_filter_list) + |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 578 | (count * sizeof(u16)); |
| 579 | if (len > I40EVF_MAX_AQ_BUF_SIZE) { |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 580 | dev_warn(&adapter->pdev->dev, "Too many add VLAN changes in one request\n"); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 581 | count = (I40EVF_MAX_AQ_BUF_SIZE - |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 582 | sizeof(struct virtchnl_vlan_filter_list)) / |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 583 | sizeof(u16); |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 584 | len = sizeof(struct virtchnl_vlan_filter_list) + |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 585 | (count * sizeof(u16)); |
| 586 | more = true; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 587 | } |
Mitch Williams | a85088d | 2015-11-06 15:26:04 -0800 | [diff] [blame] | 588 | vvfl = kzalloc(len, GFP_KERNEL); |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 589 | if (!vvfl) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 590 | return; |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 591 | |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 592 | vvfl->vsi_id = adapter->vsi_res->vsi_id; |
| 593 | vvfl->num_elements = count; |
| 594 | list_for_each_entry(f, &adapter->vlan_filter_list, list) { |
| 595 | if (f->add) { |
| 596 | vvfl->vlan_id[i] = f->vlan; |
| 597 | i++; |
| 598 | f->add = false; |
Mitch Williams | 0e8d95f89 | 2016-05-16 10:26:36 -0700 | [diff] [blame] | 599 | if (i == count) |
| 600 | break; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 601 | } |
| 602 | } |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 603 | if (!more) |
| 604 | adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_VLAN_FILTER; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 605 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_ADD_VLAN, (u8 *)vvfl, len); |
Mitch Williams | fc86a97 | 2014-06-04 20:41:38 +0000 | [diff] [blame] | 606 | kfree(vvfl); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 607 | } |
| 608 | |
| 609 | /** |
| 610 | * i40evf_del_vlans |
| 611 | * @adapter: adapter structure |
| 612 | * @vlans: the VLANs to remove |
| 613 | * @count: number of VLANs |
| 614 | * |
| 615 | * Request that the PF remove one or more VLAN filters from our VSI. |
| 616 | **/ |
| 617 | void i40evf_del_vlans(struct i40evf_adapter *adapter) |
| 618 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 619 | struct virtchnl_vlan_filter_list *vvfl; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 620 | struct i40evf_vlan_filter *f, *ftmp; |
| 621 | int len, i = 0, count = 0; |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 622 | bool more = false; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 623 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 624 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 625 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 626 | dev_err(&adapter->pdev->dev, "Cannot remove VLANs, command %d pending\n", |
| 627 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 628 | return; |
| 629 | } |
| 630 | |
| 631 | list_for_each_entry(f, &adapter->vlan_filter_list, list) { |
| 632 | if (f->remove) |
| 633 | count++; |
| 634 | } |
| 635 | if (!count) { |
| 636 | adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_VLAN_FILTER; |
| 637 | return; |
| 638 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 639 | adapter->current_op = VIRTCHNL_OP_DEL_VLAN; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 640 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 641 | len = sizeof(struct virtchnl_vlan_filter_list) + |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 642 | (count * sizeof(u16)); |
| 643 | if (len > I40EVF_MAX_AQ_BUF_SIZE) { |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 644 | dev_warn(&adapter->pdev->dev, "Too many delete VLAN changes in one request\n"); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 645 | count = (I40EVF_MAX_AQ_BUF_SIZE - |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 646 | sizeof(struct virtchnl_vlan_filter_list)) / |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 647 | sizeof(u16); |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 648 | len = sizeof(struct virtchnl_vlan_filter_list) + |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 649 | (count * sizeof(u16)); |
| 650 | more = true; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 651 | } |
Mitch Williams | a85088d | 2015-11-06 15:26:04 -0800 | [diff] [blame] | 652 | vvfl = kzalloc(len, GFP_KERNEL); |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 653 | if (!vvfl) |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 654 | return; |
Mitch Williams | 249c8b8 | 2014-05-10 04:49:04 +0000 | [diff] [blame] | 655 | |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 656 | vvfl->vsi_id = adapter->vsi_res->vsi_id; |
| 657 | vvfl->num_elements = count; |
| 658 | list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { |
| 659 | if (f->remove) { |
| 660 | vvfl->vlan_id[i] = f->vlan; |
| 661 | i++; |
| 662 | list_del(&f->list); |
| 663 | kfree(f); |
Mitch Williams | 0e8d95f89 | 2016-05-16 10:26:36 -0700 | [diff] [blame] | 664 | if (i == count) |
| 665 | break; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 666 | } |
| 667 | } |
Mitch Williams | 1418c34 | 2015-10-21 19:47:12 -0400 | [diff] [blame] | 668 | if (!more) |
| 669 | adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_VLAN_FILTER; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 670 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_DEL_VLAN, (u8 *)vvfl, len); |
Mitch Williams | fc86a97 | 2014-06-04 20:41:38 +0000 | [diff] [blame] | 671 | kfree(vvfl); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 672 | } |
| 673 | |
| 674 | /** |
| 675 | * i40evf_set_promiscuous |
| 676 | * @adapter: adapter structure |
| 677 | * @flags: bitmask to control unicast/multicast promiscuous. |
| 678 | * |
| 679 | * Request that the PF enable promiscuous mode for our VSI. |
| 680 | **/ |
| 681 | void i40evf_set_promiscuous(struct i40evf_adapter *adapter, int flags) |
| 682 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 683 | struct virtchnl_promisc_info vpi; |
Anjali Singhai Jain | f42a5c7 | 2016-05-03 15:13:10 -0700 | [diff] [blame] | 684 | int promisc_all; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 685 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 686 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 687 | /* bail because we already have a command pending */ |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 688 | dev_err(&adapter->pdev->dev, "Cannot set promiscuous mode, command %d pending\n", |
| 689 | adapter->current_op); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 690 | return; |
| 691 | } |
Anjali Singhai Jain | 47d3483 | 2016-04-12 08:30:52 -0700 | [diff] [blame] | 692 | |
Jesse Brandeburg | ff3f4cc | 2017-05-11 11:23:16 -0700 | [diff] [blame] | 693 | promisc_all = FLAG_VF_UNICAST_PROMISC | |
| 694 | FLAG_VF_MULTICAST_PROMISC; |
Anjali Singhai Jain | f42a5c7 | 2016-05-03 15:13:10 -0700 | [diff] [blame] | 695 | if ((flags & promisc_all) == promisc_all) { |
Anjali Singhai Jain | 47d3483 | 2016-04-12 08:30:52 -0700 | [diff] [blame] | 696 | adapter->flags |= I40EVF_FLAG_PROMISC_ON; |
| 697 | adapter->aq_required &= ~I40EVF_FLAG_AQ_REQUEST_PROMISC; |
| 698 | dev_info(&adapter->pdev->dev, "Entering promiscuous mode\n"); |
Anjali Singhai Jain | f42a5c7 | 2016-05-03 15:13:10 -0700 | [diff] [blame] | 699 | } |
| 700 | |
Jesse Brandeburg | ff3f4cc | 2017-05-11 11:23:16 -0700 | [diff] [blame] | 701 | if (flags & FLAG_VF_MULTICAST_PROMISC) { |
Anjali Singhai Jain | f42a5c7 | 2016-05-03 15:13:10 -0700 | [diff] [blame] | 702 | adapter->flags |= I40EVF_FLAG_ALLMULTI_ON; |
| 703 | adapter->aq_required &= ~I40EVF_FLAG_AQ_REQUEST_ALLMULTI; |
| 704 | dev_info(&adapter->pdev->dev, "Entering multicast promiscuous mode\n"); |
| 705 | } |
| 706 | |
| 707 | if (!flags) { |
Anjali Singhai Jain | 47d3483 | 2016-04-12 08:30:52 -0700 | [diff] [blame] | 708 | adapter->flags &= ~I40EVF_FLAG_PROMISC_ON; |
| 709 | adapter->aq_required &= ~I40EVF_FLAG_AQ_RELEASE_PROMISC; |
| 710 | dev_info(&adapter->pdev->dev, "Leaving promiscuous mode\n"); |
| 711 | } |
| 712 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 713 | adapter->current_op = VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 714 | vpi.vsi_id = adapter->vsi_res->vsi_id; |
| 715 | vpi.flags = flags; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 716 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 717 | (u8 *)&vpi, sizeof(vpi)); |
| 718 | } |
| 719 | |
| 720 | /** |
| 721 | * i40evf_request_stats |
| 722 | * @adapter: adapter structure |
| 723 | * |
| 724 | * Request VSI statistics from PF. |
| 725 | **/ |
| 726 | void i40evf_request_stats(struct i40evf_adapter *adapter) |
| 727 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 728 | struct virtchnl_queue_select vqs; |
Mitch Williams | 75a6443 | 2014-11-11 20:02:42 +0000 | [diff] [blame] | 729 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 730 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 731 | /* no error message, this isn't crucial */ |
| 732 | return; |
| 733 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 734 | adapter->current_op = VIRTCHNL_OP_GET_STATS; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 735 | vqs.vsi_id = adapter->vsi_res->vsi_id; |
| 736 | /* queue maps are ignored for this message - only the vsi is used */ |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 737 | if (i40evf_send_pf_msg(adapter, VIRTCHNL_OP_GET_STATS, |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 738 | (u8 *)&vqs, sizeof(vqs))) |
| 739 | /* if the request failed, don't lock out others */ |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 740 | adapter->current_op = VIRTCHNL_OP_UNKNOWN; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 741 | } |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 742 | |
| 743 | /** |
| 744 | * i40evf_get_hena |
| 745 | * @adapter: adapter structure |
| 746 | * |
| 747 | * Request hash enable capabilities from PF |
| 748 | **/ |
| 749 | void i40evf_get_hena(struct i40evf_adapter *adapter) |
| 750 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 751 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 752 | /* bail because we already have a command pending */ |
| 753 | dev_err(&adapter->pdev->dev, "Cannot get RSS hash capabilities, command %d pending\n", |
| 754 | adapter->current_op); |
| 755 | return; |
| 756 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 757 | adapter->current_op = VIRTCHNL_OP_GET_RSS_HENA_CAPS; |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 758 | adapter->aq_required &= ~I40EVF_FLAG_AQ_GET_HENA; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 759 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_GET_RSS_HENA_CAPS, |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 760 | NULL, 0); |
| 761 | } |
| 762 | |
| 763 | /** |
| 764 | * i40evf_set_hena |
| 765 | * @adapter: adapter structure |
| 766 | * |
| 767 | * Request the PF to set our RSS hash capabilities |
| 768 | **/ |
| 769 | void i40evf_set_hena(struct i40evf_adapter *adapter) |
| 770 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 771 | struct virtchnl_rss_hena vrh; |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 772 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 773 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 774 | /* bail because we already have a command pending */ |
| 775 | dev_err(&adapter->pdev->dev, "Cannot set RSS hash enable, command %d pending\n", |
| 776 | adapter->current_op); |
| 777 | return; |
| 778 | } |
| 779 | vrh.hena = adapter->hena; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 780 | adapter->current_op = VIRTCHNL_OP_SET_RSS_HENA; |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 781 | adapter->aq_required &= ~I40EVF_FLAG_AQ_SET_HENA; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 782 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_SET_RSS_HENA, |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 783 | (u8 *)&vrh, sizeof(vrh)); |
| 784 | } |
| 785 | |
| 786 | /** |
| 787 | * i40evf_set_rss_key |
| 788 | * @adapter: adapter structure |
| 789 | * |
| 790 | * Request the PF to set our RSS hash key |
| 791 | **/ |
| 792 | void i40evf_set_rss_key(struct i40evf_adapter *adapter) |
| 793 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 794 | struct virtchnl_rss_key *vrk; |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 795 | int len; |
| 796 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 797 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 798 | /* bail because we already have a command pending */ |
| 799 | dev_err(&adapter->pdev->dev, "Cannot set RSS key, command %d pending\n", |
| 800 | adapter->current_op); |
| 801 | return; |
| 802 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 803 | len = sizeof(struct virtchnl_rss_key) + |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 804 | (adapter->rss_key_size * sizeof(u8)) - 1; |
| 805 | vrk = kzalloc(len, GFP_KERNEL); |
| 806 | if (!vrk) |
| 807 | return; |
| 808 | vrk->vsi_id = adapter->vsi.id; |
| 809 | vrk->key_len = adapter->rss_key_size; |
| 810 | memcpy(vrk->key, adapter->rss_key, adapter->rss_key_size); |
| 811 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 812 | adapter->current_op = VIRTCHNL_OP_CONFIG_RSS_KEY; |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 813 | adapter->aq_required &= ~I40EVF_FLAG_AQ_SET_RSS_KEY; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 814 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_RSS_KEY, |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 815 | (u8 *)vrk, len); |
| 816 | kfree(vrk); |
| 817 | } |
| 818 | |
| 819 | /** |
| 820 | * i40evf_set_rss_lut |
| 821 | * @adapter: adapter structure |
| 822 | * |
| 823 | * Request the PF to set our RSS lookup table |
| 824 | **/ |
| 825 | void i40evf_set_rss_lut(struct i40evf_adapter *adapter) |
| 826 | { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 827 | struct virtchnl_rss_lut *vrl; |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 828 | int len; |
| 829 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 830 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 831 | /* bail because we already have a command pending */ |
| 832 | dev_err(&adapter->pdev->dev, "Cannot set RSS LUT, command %d pending\n", |
| 833 | adapter->current_op); |
| 834 | return; |
| 835 | } |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 836 | len = sizeof(struct virtchnl_rss_lut) + |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 837 | (adapter->rss_lut_size * sizeof(u8)) - 1; |
| 838 | vrl = kzalloc(len, GFP_KERNEL); |
| 839 | if (!vrl) |
| 840 | return; |
| 841 | vrl->vsi_id = adapter->vsi.id; |
| 842 | vrl->lut_entries = adapter->rss_lut_size; |
| 843 | memcpy(vrl->lut, adapter->rss_lut, adapter->rss_lut_size); |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 844 | adapter->current_op = VIRTCHNL_OP_CONFIG_RSS_LUT; |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 845 | adapter->aq_required &= ~I40EVF_FLAG_AQ_SET_RSS_LUT; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 846 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_CONFIG_RSS_LUT, |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 847 | (u8 *)vrl, len); |
| 848 | kfree(vrl); |
| 849 | } |
| 850 | |
Mitch Williams | 625777e | 2014-02-20 19:29:05 -0800 | [diff] [blame] | 851 | /** |
Mariusz Stachura | 8774370 | 2017-07-17 22:09:45 -0700 | [diff] [blame] | 852 | * i40evf_enable_vlan_stripping |
| 853 | * @adapter: adapter structure |
| 854 | * |
| 855 | * Request VLAN header stripping to be enabled |
| 856 | **/ |
| 857 | void i40evf_enable_vlan_stripping(struct i40evf_adapter *adapter) |
| 858 | { |
| 859 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
| 860 | /* bail because we already have a command pending */ |
| 861 | dev_err(&adapter->pdev->dev, "Cannot enable stripping, command %d pending\n", |
| 862 | adapter->current_op); |
| 863 | return; |
| 864 | } |
| 865 | adapter->current_op = VIRTCHNL_OP_ENABLE_VLAN_STRIPPING; |
| 866 | adapter->aq_required &= ~I40EVF_FLAG_AQ_ENABLE_VLAN_STRIPPING; |
| 867 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_ENABLE_VLAN_STRIPPING, |
| 868 | NULL, 0); |
| 869 | } |
| 870 | |
| 871 | /** |
| 872 | * i40evf_disable_vlan_stripping |
| 873 | * @adapter: adapter structure |
| 874 | * |
| 875 | * Request VLAN header stripping to be disabled |
| 876 | **/ |
| 877 | void i40evf_disable_vlan_stripping(struct i40evf_adapter *adapter) |
| 878 | { |
| 879 | if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) { |
| 880 | /* bail because we already have a command pending */ |
| 881 | dev_err(&adapter->pdev->dev, "Cannot disable stripping, command %d pending\n", |
| 882 | adapter->current_op); |
| 883 | return; |
| 884 | } |
| 885 | adapter->current_op = VIRTCHNL_OP_DISABLE_VLAN_STRIPPING; |
| 886 | adapter->aq_required &= ~I40EVF_FLAG_AQ_DISABLE_VLAN_STRIPPING; |
| 887 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING, |
| 888 | NULL, 0); |
| 889 | } |
| 890 | |
| 891 | /** |
Mitch Williams | fe458e5 | 2016-08-04 11:37:02 -0700 | [diff] [blame] | 892 | * i40evf_print_link_message - print link up or down |
| 893 | * @adapter: adapter structure |
| 894 | * |
| 895 | * Log a message telling the world of our wonderous link status |
| 896 | */ |
| 897 | static void i40evf_print_link_message(struct i40evf_adapter *adapter) |
| 898 | { |
| 899 | struct net_device *netdev = adapter->netdev; |
| 900 | char *speed = "Unknown "; |
| 901 | |
| 902 | if (!adapter->link_up) { |
| 903 | netdev_info(netdev, "NIC Link is Down\n"); |
| 904 | return; |
| 905 | } |
| 906 | |
| 907 | switch (adapter->link_speed) { |
| 908 | case I40E_LINK_SPEED_40GB: |
| 909 | speed = "40 G"; |
| 910 | break; |
Carolyn Wyborny | 3123237 | 2016-11-21 13:03:48 -0800 | [diff] [blame] | 911 | case I40E_LINK_SPEED_25GB: |
| 912 | speed = "25 G"; |
| 913 | break; |
Mitch Williams | fe458e5 | 2016-08-04 11:37:02 -0700 | [diff] [blame] | 914 | case I40E_LINK_SPEED_20GB: |
| 915 | speed = "20 G"; |
| 916 | break; |
| 917 | case I40E_LINK_SPEED_10GB: |
| 918 | speed = "10 G"; |
| 919 | break; |
| 920 | case I40E_LINK_SPEED_1GB: |
| 921 | speed = "1000 M"; |
| 922 | break; |
| 923 | case I40E_LINK_SPEED_100MB: |
| 924 | speed = "100 M"; |
| 925 | break; |
| 926 | default: |
| 927 | break; |
| 928 | } |
| 929 | |
| 930 | netdev_info(netdev, "NIC Link is Up %sbps Full Duplex\n", speed); |
| 931 | } |
| 932 | |
| 933 | /** |
Mitch Williams | 625777e | 2014-02-20 19:29:05 -0800 | [diff] [blame] | 934 | * i40evf_request_reset |
| 935 | * @adapter: adapter structure |
| 936 | * |
| 937 | * Request that the PF reset this VF. No response is expected. |
| 938 | **/ |
| 939 | void i40evf_request_reset(struct i40evf_adapter *adapter) |
| 940 | { |
| 941 | /* Don't check CURRENT_OP - this is always higher priority */ |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 942 | i40evf_send_pf_msg(adapter, VIRTCHNL_OP_RESET_VF, NULL, 0); |
| 943 | adapter->current_op = VIRTCHNL_OP_UNKNOWN; |
Mitch Williams | 625777e | 2014-02-20 19:29:05 -0800 | [diff] [blame] | 944 | } |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 945 | |
| 946 | /** |
| 947 | * i40evf_virtchnl_completion |
| 948 | * @adapter: adapter structure |
| 949 | * @v_opcode: opcode sent by PF |
| 950 | * @v_retval: retval sent by PF |
| 951 | * @msg: message sent by PF |
| 952 | * @msglen: message length |
| 953 | * |
| 954 | * Asynchronous completion function for admin queue messages. Rather than busy |
| 955 | * wait, we fire off our requests and assume that no errors will be returned. |
| 956 | * This function handles the reply messages. |
| 957 | **/ |
| 958 | void i40evf_virtchnl_completion(struct i40evf_adapter *adapter, |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 959 | enum virtchnl_ops v_opcode, |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 960 | i40e_status v_retval, |
| 961 | u8 *msg, u16 msglen) |
| 962 | { |
| 963 | struct net_device *netdev = adapter->netdev; |
| 964 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 965 | if (v_opcode == VIRTCHNL_OP_EVENT) { |
| 966 | struct virtchnl_pf_event *vpe = |
| 967 | (struct virtchnl_pf_event *)msg; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 968 | switch (vpe->event) { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 969 | case VIRTCHNL_EVENT_LINK_CHANGE: |
Mitch Williams | fe458e5 | 2016-08-04 11:37:02 -0700 | [diff] [blame] | 970 | adapter->link_speed = |
| 971 | vpe->event_data.link_event.link_speed; |
| 972 | if (adapter->link_up != |
| 973 | vpe->event_data.link_event.link_status) { |
| 974 | adapter->link_up = |
| 975 | vpe->event_data.link_event.link_status; |
Sridhar Samudrala | 3f341ac | 2016-09-01 22:27:27 +0200 | [diff] [blame] | 976 | if (adapter->link_up) { |
| 977 | netif_tx_start_all_queues(netdev); |
| 978 | netif_carrier_on(netdev); |
| 979 | } else { |
| 980 | netif_tx_stop_all_queues(netdev); |
| 981 | netif_carrier_off(netdev); |
| 982 | } |
Mitch Williams | fe458e5 | 2016-08-04 11:37:02 -0700 | [diff] [blame] | 983 | i40evf_print_link_message(adapter); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 984 | } |
| 985 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 986 | case VIRTCHNL_EVENT_RESET_IMPENDING: |
Mitch Williams | ef8693e | 2014-02-13 03:48:53 -0800 | [diff] [blame] | 987 | dev_info(&adapter->pdev->dev, "PF reset warning received\n"); |
| 988 | if (!(adapter->flags & I40EVF_FLAG_RESET_PENDING)) { |
| 989 | adapter->flags |= I40EVF_FLAG_RESET_PENDING; |
| 990 | dev_info(&adapter->pdev->dev, "Scheduling reset task\n"); |
| 991 | schedule_work(&adapter->reset_task); |
| 992 | } |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 993 | break; |
| 994 | default: |
Shannon Nelson | fb43201f | 2015-08-26 15:14:17 -0400 | [diff] [blame] | 995 | dev_err(&adapter->pdev->dev, "Unknown event %d from PF\n", |
| 996 | vpe->event); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 997 | break; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 998 | } |
| 999 | return; |
| 1000 | } |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1001 | if (v_retval) { |
Mitch Williams | 8d8f229 | 2015-10-21 19:47:11 -0400 | [diff] [blame] | 1002 | switch (v_opcode) { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1003 | case VIRTCHNL_OP_ADD_VLAN: |
Mitch Williams | 8d8f229 | 2015-10-21 19:47:11 -0400 | [diff] [blame] | 1004 | dev_err(&adapter->pdev->dev, "Failed to add VLAN filter, error %s\n", |
| 1005 | i40evf_stat_str(&adapter->hw, v_retval)); |
| 1006 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1007 | case VIRTCHNL_OP_ADD_ETH_ADDR: |
Mitch Williams | 8d8f229 | 2015-10-21 19:47:11 -0400 | [diff] [blame] | 1008 | dev_err(&adapter->pdev->dev, "Failed to add MAC filter, error %s\n", |
| 1009 | i40evf_stat_str(&adapter->hw, v_retval)); |
| 1010 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1011 | case VIRTCHNL_OP_DEL_VLAN: |
Mitch Williams | 8d8f229 | 2015-10-21 19:47:11 -0400 | [diff] [blame] | 1012 | dev_err(&adapter->pdev->dev, "Failed to delete VLAN filter, error %s\n", |
| 1013 | i40evf_stat_str(&adapter->hw, v_retval)); |
| 1014 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1015 | case VIRTCHNL_OP_DEL_ETH_ADDR: |
Mitch Williams | 8d8f229 | 2015-10-21 19:47:11 -0400 | [diff] [blame] | 1016 | dev_err(&adapter->pdev->dev, "Failed to delete MAC filter, error %s\n", |
| 1017 | i40evf_stat_str(&adapter->hw, v_retval)); |
| 1018 | break; |
| 1019 | default: |
| 1020 | dev_err(&adapter->pdev->dev, "PF returned error %d (%s) to our request %d\n", |
| 1021 | v_retval, |
| 1022 | i40evf_stat_str(&adapter->hw, v_retval), |
| 1023 | v_opcode); |
| 1024 | } |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1025 | } |
| 1026 | switch (v_opcode) { |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1027 | case VIRTCHNL_OP_GET_STATS: { |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1028 | struct i40e_eth_stats *stats = |
| 1029 | (struct i40e_eth_stats *)msg; |
Tobias Klauser | 4a0a3ab | 2017-04-06 08:46:28 +0200 | [diff] [blame] | 1030 | netdev->stats.rx_packets = stats->rx_unicast + |
| 1031 | stats->rx_multicast + |
| 1032 | stats->rx_broadcast; |
| 1033 | netdev->stats.tx_packets = stats->tx_unicast + |
| 1034 | stats->tx_multicast + |
| 1035 | stats->tx_broadcast; |
| 1036 | netdev->stats.rx_bytes = stats->rx_bytes; |
| 1037 | netdev->stats.tx_bytes = stats->tx_bytes; |
| 1038 | netdev->stats.tx_errors = stats->tx_errors; |
| 1039 | netdev->stats.rx_dropped = stats->rx_discards; |
| 1040 | netdev->stats.tx_dropped = stats->tx_discards; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1041 | adapter->current_stats = *stats; |
| 1042 | } |
| 1043 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1044 | case VIRTCHNL_OP_GET_VF_RESOURCES: { |
| 1045 | u16 len = sizeof(struct virtchnl_vf_resource) + |
Mitch Williams | e6d038d | 2015-06-04 16:23:58 -0400 | [diff] [blame] | 1046 | I40E_MAX_VF_VSI * |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1047 | sizeof(struct virtchnl_vsi_resource); |
Mitch Williams | e6d038d | 2015-06-04 16:23:58 -0400 | [diff] [blame] | 1048 | memcpy(adapter->vf_res, msg, min(msglen, len)); |
| 1049 | i40e_vf_parse_hw_config(&adapter->hw, adapter->vf_res); |
Mitch Williams | 8552d85 | 2015-08-31 19:54:51 -0400 | [diff] [blame] | 1050 | /* restore current mac address */ |
| 1051 | ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr); |
Mitch Williams | e6d038d | 2015-06-04 16:23:58 -0400 | [diff] [blame] | 1052 | i40evf_process_config(adapter); |
| 1053 | } |
| 1054 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1055 | case VIRTCHNL_OP_ENABLE_QUEUES: |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1056 | /* enable transmits */ |
| 1057 | i40evf_irq_enable(adapter, true); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1058 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1059 | case VIRTCHNL_OP_DISABLE_QUEUES: |
Mitch Williams | e284fc8 | 2015-03-27 00:12:09 -0700 | [diff] [blame] | 1060 | i40evf_free_all_tx_resources(adapter); |
| 1061 | i40evf_free_all_rx_resources(adapter); |
Sudheer Mogilappagari | fe2647a | 2017-06-23 04:24:44 -0400 | [diff] [blame] | 1062 | if (adapter->state == __I40EVF_DOWN_PENDING) { |
Mitch Williams | 209dc4d | 2015-12-09 15:50:27 -0800 | [diff] [blame] | 1063 | adapter->state = __I40EVF_DOWN; |
Sudheer Mogilappagari | fe2647a | 2017-06-23 04:24:44 -0400 | [diff] [blame] | 1064 | wake_up(&adapter->down_waitqueue); |
| 1065 | } |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1066 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1067 | case VIRTCHNL_OP_VERSION: |
| 1068 | case VIRTCHNL_OP_CONFIG_IRQ_MAP: |
Mitch Williams | ed63696 | 2015-04-07 19:45:32 -0400 | [diff] [blame] | 1069 | /* Don't display an error if we get these out of sequence. |
| 1070 | * If the firmware needed to get kicked, we'll get these and |
| 1071 | * it's no problem. |
| 1072 | */ |
| 1073 | if (v_opcode != adapter->current_op) |
| 1074 | return; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1075 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1076 | case VIRTCHNL_OP_IWARP: |
Mitch Williams | ed0e894 | 2017-01-24 10:23:59 -0800 | [diff] [blame] | 1077 | /* Gobble zero-length replies from the PF. They indicate that |
| 1078 | * a previous message was received OK, and the client doesn't |
| 1079 | * care about that. |
| 1080 | */ |
| 1081 | if (msglen && CLIENT_ENABLED(adapter)) |
| 1082 | i40evf_notify_client_message(&adapter->vsi, |
| 1083 | msg, msglen); |
| 1084 | break; |
| 1085 | |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1086 | case VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP: |
Mitch Williams | e5f77f4 | 2017-02-09 23:35:18 -0800 | [diff] [blame] | 1087 | adapter->client_pending &= |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1088 | ~(BIT(VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP)); |
Mitch Williams | e5f77f4 | 2017-02-09 23:35:18 -0800 | [diff] [blame] | 1089 | break; |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1090 | case VIRTCHNL_OP_GET_RSS_HENA_CAPS: { |
Jesse Brandeburg | f0adc6e | 2017-05-11 11:23:15 -0700 | [diff] [blame] | 1091 | struct virtchnl_rss_hena *vrh = (struct virtchnl_rss_hena *)msg; |
Mitch Williams | 43a3d9b | 2016-04-12 08:30:44 -0700 | [diff] [blame] | 1092 | if (msglen == sizeof(*vrh)) |
| 1093 | adapter->hena = vrh->hena; |
| 1094 | else |
| 1095 | dev_warn(&adapter->pdev->dev, |
| 1096 | "Invalid message %d from PF\n", v_opcode); |
| 1097 | } |
| 1098 | break; |
Alan Brady | 5b36e8d | 2017-08-22 06:57:50 -0400 | [diff] [blame] | 1099 | case VIRTCHNL_OP_REQUEST_QUEUES: { |
| 1100 | struct virtchnl_vf_res_request *vfres = |
| 1101 | (struct virtchnl_vf_res_request *)msg; |
Alan Brady | 17a9422 | 2017-10-11 14:49:43 -0700 | [diff] [blame] | 1102 | if (vfres->num_queue_pairs != adapter->num_req_queues) { |
Alan Brady | 5b36e8d | 2017-08-22 06:57:50 -0400 | [diff] [blame] | 1103 | dev_info(&adapter->pdev->dev, |
| 1104 | "Requested %d queues, PF can support %d\n", |
| 1105 | adapter->num_req_queues, |
| 1106 | vfres->num_queue_pairs); |
| 1107 | adapter->num_req_queues = 0; |
Alan Brady | 17a9422 | 2017-10-11 14:49:43 -0700 | [diff] [blame] | 1108 | adapter->flags &= ~I40EVF_FLAG_REINIT_ITR_NEEDED; |
Alan Brady | 5b36e8d | 2017-08-22 06:57:50 -0400 | [diff] [blame] | 1109 | } |
| 1110 | } |
| 1111 | break; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1112 | default: |
Mitch Williams | ed0e894 | 2017-01-24 10:23:59 -0800 | [diff] [blame] | 1113 | if (adapter->current_op && (v_opcode != adapter->current_op)) |
Mitch Williams | ed63696 | 2015-04-07 19:45:32 -0400 | [diff] [blame] | 1114 | dev_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n", |
| 1115 | adapter->current_op, v_opcode); |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1116 | break; |
| 1117 | } /* switch v_opcode */ |
Jesse Brandeburg | 310a2ad | 2017-05-11 11:23:11 -0700 | [diff] [blame] | 1118 | adapter->current_op = VIRTCHNL_OP_UNKNOWN; |
Greg Rose | 62683ab | 2013-12-21 06:13:01 +0000 | [diff] [blame] | 1119 | } |