| .. | .. |
|---|
| 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/etherdevice.h> |
|---|
| 34 | 8 | #include <linux/crc32.h> |
|---|
| 35 | 9 | #include <linux/vmalloc.h> |
|---|
| 10 | +#include <linux/crash_dump.h> |
|---|
| 36 | 11 | #include <linux/qed/qed_iov_if.h> |
|---|
| 37 | 12 | #include "qed_cxt.h" |
|---|
| 38 | 13 | #include "qed_hsi.h" |
|---|
| .. | .. |
|---|
| 353 | 328 | |
|---|
| 354 | 329 | /* propagate bulletin board via dmae to vm memory */ |
|---|
| 355 | 330 | memset(¶ms, 0, sizeof(params)); |
|---|
| 356 | | - params.flags = QED_DMAE_FLAG_VF_DST; |
|---|
| 331 | + SET_FIELD(params.flags, QED_DMAE_PARAMS_DST_VF_VALID, 0x1); |
|---|
| 357 | 332 | params.dst_vfid = p_vf->abs_vf_id; |
|---|
| 358 | 333 | return qed_dmae_host2host(p_hwfn, p_ptt, p_vf->bulletin.phys, |
|---|
| 359 | 334 | p_vf->vf_bulletin, p_vf->bulletin.size / 4, |
|---|
| .. | .. |
|---|
| 608 | 583 | int pos; |
|---|
| 609 | 584 | int rc; |
|---|
| 610 | 585 | |
|---|
| 586 | + if (is_kdump_kernel()) |
|---|
| 587 | + return 0; |
|---|
| 588 | + |
|---|
| 611 | 589 | if (IS_VF(p_hwfn->cdev)) |
|---|
| 612 | 590 | return 0; |
|---|
| 613 | 591 | |
|---|
| .. | .. |
|---|
| 846 | 824 | } |
|---|
| 847 | 825 | |
|---|
| 848 | 826 | /** |
|---|
| 849 | | - * @brief qed_iov_config_perm_table - configure the permission |
|---|
| 850 | | - * zone table. |
|---|
| 851 | | - * In E4, queue zone permission table size is 320x9. There |
|---|
| 852 | | - * are 320 VF queues for single engine device (256 for dual |
|---|
| 853 | | - * engine device), and each entry has the following format: |
|---|
| 854 | | - * {Valid, VF[7:0]} |
|---|
| 855 | | - * @param p_hwfn |
|---|
| 856 | | - * @param p_ptt |
|---|
| 857 | | - * @param vf |
|---|
| 858 | | - * @param enable |
|---|
| 827 | + * qed_iov_config_perm_table() - Configure the permission zone table. |
|---|
| 828 | + * |
|---|
| 829 | + * @p_hwfn: HW device data. |
|---|
| 830 | + * @p_ptt: PTT window for writing the registers. |
|---|
| 831 | + * @vf: VF info data. |
|---|
| 832 | + * @enable: The actual permision for this VF. |
|---|
| 833 | + * |
|---|
| 834 | + * In E4, queue zone permission table size is 320x9. There |
|---|
| 835 | + * are 320 VF queues for single engine device (256 for dual |
|---|
| 836 | + * engine device), and each entry has the following format: |
|---|
| 837 | + * {Valid, VF[7:0]} |
|---|
| 859 | 838 | */ |
|---|
| 860 | 839 | static void qed_iov_config_perm_table(struct qed_hwfn *p_hwfn, |
|---|
| 861 | 840 | struct qed_ptt *p_ptt, |
|---|
| .. | .. |
|---|
| 918 | 897 | /* Configure igu sb in CAU which were marked valid */ |
|---|
| 919 | 898 | qed_init_cau_sb_entry(p_hwfn, &sb_entry, |
|---|
| 920 | 899 | p_hwfn->rel_pf_id, vf->abs_vf_id, 1); |
|---|
| 900 | + |
|---|
| 921 | 901 | qed_dmae_host2grc(p_hwfn, p_ptt, |
|---|
| 922 | 902 | (u64)(uintptr_t)&sb_entry, |
|---|
| 923 | 903 | CAU_REG_SB_VAR_MEMORY + |
|---|
| 924 | | - p_block->igu_sb_id * sizeof(u64), 2, 0); |
|---|
| 904 | + p_block->igu_sb_id * sizeof(u64), 2, NULL); |
|---|
| 925 | 905 | } |
|---|
| 926 | 906 | |
|---|
| 927 | 907 | vf->num_sbs = (u8) num_rx_queues; |
|---|
| .. | .. |
|---|
| 1225 | 1205 | |
|---|
| 1226 | 1206 | eng_vf_id = p_vf->abs_vf_id; |
|---|
| 1227 | 1207 | |
|---|
| 1228 | | - memset(¶ms, 0, sizeof(struct qed_dmae_params)); |
|---|
| 1229 | | - params.flags = QED_DMAE_FLAG_VF_DST; |
|---|
| 1208 | + memset(¶ms, 0, sizeof(params)); |
|---|
| 1209 | + SET_FIELD(params.flags, QED_DMAE_PARAMS_DST_VF_VALID, 0x1); |
|---|
| 1230 | 1210 | params.dst_vfid = eng_vf_id; |
|---|
| 1231 | 1211 | |
|---|
| 1232 | 1212 | qed_dmae_host2host(p_hwfn, p_ptt, mbx->reply_phys + sizeof(u64), |
|---|
| .. | .. |
|---|
| 1592 | 1572 | p_vfdev->eth_fp_hsi_minor = ETH_HSI_VER_NO_PKT_LEN_TUNN; |
|---|
| 1593 | 1573 | } else { |
|---|
| 1594 | 1574 | DP_INFO(p_hwfn, |
|---|
| 1595 | | - "VF[%d] needs fastpath HSI %02x.%02x, which is incompatible with loaded FW's faspath HSI %02x.%02x\n", |
|---|
| 1575 | + "VF[%d] needs fastpath HSI %02x.%02x, which is incompatible with loaded FW's fastpath HSI %02x.%02x\n", |
|---|
| 1596 | 1576 | vf->abs_vf_id, |
|---|
| 1597 | 1577 | req->vfdev_info.eth_fp_hsi_major, |
|---|
| 1598 | 1578 | req->vfdev_info.eth_fp_hsi_minor, |
|---|
| .. | .. |
|---|
| 2005 | 1985 | (qed_iov_validate_active_txq(p_hwfn, vf))) { |
|---|
| 2006 | 1986 | vf->b_malicious = true; |
|---|
| 2007 | 1987 | DP_NOTICE(p_hwfn, |
|---|
| 2008 | | - "VF [%02x] - considered malicious; Unable to stop RX/TX queuess\n", |
|---|
| 1988 | + "VF [%02x] - considered malicious; Unable to stop RX/TX queues\n", |
|---|
| 2009 | 1989 | vf->abs_vf_id); |
|---|
| 2010 | 1990 | status = PFVF_STATUS_MALICIOUS; |
|---|
| 2011 | 1991 | goto out; |
|---|
| .. | .. |
|---|
| 3002 | 2982 | u8 mask = QED_ACCEPT_UCAST_UNMATCHED | QED_ACCEPT_MCAST_UNMATCHED; |
|---|
| 3003 | 2983 | struct qed_filter_accept_flags *flags = ¶ms->accept_flags; |
|---|
| 3004 | 2984 | struct qed_public_vf_info *vf_info; |
|---|
| 2985 | + u16 tlv_mask; |
|---|
| 2986 | + |
|---|
| 2987 | + tlv_mask = BIT(QED_IOV_VP_UPDATE_ACCEPT_PARAM) | |
|---|
| 2988 | + BIT(QED_IOV_VP_UPDATE_ACCEPT_ANY_VLAN); |
|---|
| 3005 | 2989 | |
|---|
| 3006 | 2990 | /* Untrusted VFs can't even be trusted to know that fact. |
|---|
| 3007 | 2991 | * Simply indicate everything is configured fine, and trace |
|---|
| 3008 | 2992 | * configuration 'behind their back'. |
|---|
| 3009 | 2993 | */ |
|---|
| 3010 | | - if (!(*tlvs & BIT(QED_IOV_VP_UPDATE_ACCEPT_PARAM))) |
|---|
| 2994 | + if (!(*tlvs & tlv_mask)) |
|---|
| 3011 | 2995 | return 0; |
|---|
| 3012 | 2996 | |
|---|
| 3013 | 2997 | vf_info = qed_iov_get_public_vf_info(hwfn, vfid, true); |
|---|
| .. | .. |
|---|
| 3022 | 3006 | vf_info->tx_accept_mode = flags->tx_accept_filter; |
|---|
| 3023 | 3007 | if (!vf_info->is_trusted_configured) |
|---|
| 3024 | 3008 | flags->tx_accept_filter &= ~mask; |
|---|
| 3009 | + } |
|---|
| 3010 | + |
|---|
| 3011 | + if (params->update_accept_any_vlan_flg) { |
|---|
| 3012 | + vf_info->accept_any_vlan = params->accept_any_vlan; |
|---|
| 3013 | + |
|---|
| 3014 | + if (vf_info->forced_vlan && !vf_info->is_trusted_configured) |
|---|
| 3015 | + params->accept_any_vlan = false; |
|---|
| 3025 | 3016 | } |
|---|
| 3026 | 3017 | |
|---|
| 3027 | 3018 | return 0; |
|---|
| .. | .. |
|---|
| 3297 | 3288 | |
|---|
| 3298 | 3289 | DP_VERBOSE(p_hwfn, |
|---|
| 3299 | 3290 | QED_MSG_IOV, |
|---|
| 3300 | | - "VF[%d]: opcode 0x%02x type 0x%02x [%s %s] [vport 0x%02x] MAC %02x:%02x:%02x:%02x:%02x:%02x, vlan 0x%04x\n", |
|---|
| 3291 | + "VF[%d]: opcode 0x%02x type 0x%02x [%s %s] [vport 0x%02x] MAC %pM, vlan 0x%04x\n", |
|---|
| 3301 | 3292 | vf->abs_vf_id, params.opcode, params.type, |
|---|
| 3302 | 3293 | params.is_rx_filter ? "RX" : "", |
|---|
| 3303 | 3294 | params.is_tx_filter ? "TX" : "", |
|---|
| 3304 | 3295 | params.vport_to_add_to, |
|---|
| 3305 | | - params.mac[0], params.mac[1], |
|---|
| 3306 | | - params.mac[2], params.mac[3], |
|---|
| 3307 | | - params.mac[4], params.mac[5], params.vlan); |
|---|
| 3296 | + params.mac, params.vlan); |
|---|
| 3308 | 3297 | |
|---|
| 3309 | 3298 | if (!vf->vport_instance) { |
|---|
| 3310 | 3299 | DP_VERBOSE(p_hwfn, |
|---|
| .. | .. |
|---|
| 3800 | 3789 | return found; |
|---|
| 3801 | 3790 | } |
|---|
| 3802 | 3791 | |
|---|
| 3803 | | -static void qed_iov_get_link(struct qed_hwfn *p_hwfn, |
|---|
| 3804 | | - u16 vfid, |
|---|
| 3805 | | - struct qed_mcp_link_params *p_params, |
|---|
| 3806 | | - struct qed_mcp_link_state *p_link, |
|---|
| 3807 | | - struct qed_mcp_link_capabilities *p_caps) |
|---|
| 3792 | +static int qed_iov_get_link(struct qed_hwfn *p_hwfn, |
|---|
| 3793 | + u16 vfid, |
|---|
| 3794 | + struct qed_mcp_link_params *p_params, |
|---|
| 3795 | + struct qed_mcp_link_state *p_link, |
|---|
| 3796 | + struct qed_mcp_link_capabilities *p_caps) |
|---|
| 3808 | 3797 | { |
|---|
| 3809 | 3798 | struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn, |
|---|
| 3810 | 3799 | vfid, |
|---|
| .. | .. |
|---|
| 3812 | 3801 | struct qed_bulletin_content *p_bulletin; |
|---|
| 3813 | 3802 | |
|---|
| 3814 | 3803 | if (!p_vf) |
|---|
| 3815 | | - return; |
|---|
| 3804 | + return -EINVAL; |
|---|
| 3816 | 3805 | |
|---|
| 3817 | 3806 | p_bulletin = p_vf->bulletin.p_virt; |
|---|
| 3818 | 3807 | |
|---|
| .. | .. |
|---|
| 3822 | 3811 | __qed_vf_get_link_state(p_hwfn, p_link, p_bulletin); |
|---|
| 3823 | 3812 | if (p_caps) |
|---|
| 3824 | 3813 | __qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin); |
|---|
| 3814 | + return 0; |
|---|
| 3825 | 3815 | } |
|---|
| 3826 | 3816 | |
|---|
| 3827 | 3817 | static int |
|---|
| .. | .. |
|---|
| 4026 | 4016 | /* List the physical address of the request so that handler |
|---|
| 4027 | 4017 | * could later on copy the message from it. |
|---|
| 4028 | 4018 | */ |
|---|
| 4029 | | - p_vf->vf_mbx.pending_req = (((u64)vf_msg->hi) << 32) | vf_msg->lo; |
|---|
| 4019 | + p_vf->vf_mbx.pending_req = HILO_64(vf_msg->hi, vf_msg->lo); |
|---|
| 4030 | 4020 | |
|---|
| 4031 | 4021 | /* Mark the event and schedule the workqueue */ |
|---|
| 4032 | 4022 | p_vf->vf_mbx.b_pending_msg = true; |
|---|
| .. | .. |
|---|
| 4058 | 4048 | } |
|---|
| 4059 | 4049 | } |
|---|
| 4060 | 4050 | |
|---|
| 4061 | | -static int qed_sriov_eqe_event(struct qed_hwfn *p_hwfn, |
|---|
| 4062 | | - u8 opcode, |
|---|
| 4063 | | - __le16 echo, |
|---|
| 4051 | +static int qed_sriov_eqe_event(struct qed_hwfn *p_hwfn, u8 opcode, __le16 echo, |
|---|
| 4064 | 4052 | union event_ring_data *data, u8 fw_return_code) |
|---|
| 4065 | 4053 | { |
|---|
| 4066 | 4054 | switch (opcode) { |
|---|
| .. | .. |
|---|
| 4103 | 4091 | if (!vf_info) |
|---|
| 4104 | 4092 | return -EINVAL; |
|---|
| 4105 | 4093 | |
|---|
| 4106 | | - memset(¶ms, 0, sizeof(struct qed_dmae_params)); |
|---|
| 4107 | | - params.flags = QED_DMAE_FLAG_VF_SRC | QED_DMAE_FLAG_COMPLETION_DST; |
|---|
| 4094 | + memset(¶ms, 0, sizeof(params)); |
|---|
| 4095 | + SET_FIELD(params.flags, QED_DMAE_PARAMS_SRC_VF_VALID, 0x1); |
|---|
| 4096 | + SET_FIELD(params.flags, QED_DMAE_PARAMS_COMPLETION_DST, 0x1); |
|---|
| 4108 | 4097 | params.src_vfid = vf_info->abs_vf_id; |
|---|
| 4109 | 4098 | |
|---|
| 4110 | 4099 | if (qed_dmae_host2host(p_hwfn, ptt, |
|---|
| .. | .. |
|---|
| 4354 | 4343 | static int qed_iov_configure_tx_rate(struct qed_hwfn *p_hwfn, |
|---|
| 4355 | 4344 | struct qed_ptt *p_ptt, int vfid, int val) |
|---|
| 4356 | 4345 | { |
|---|
| 4357 | | - struct qed_mcp_link_state *p_link; |
|---|
| 4358 | 4346 | struct qed_vf_info *vf; |
|---|
| 4359 | 4347 | u8 abs_vp_id = 0; |
|---|
| 4348 | + u16 rl_id; |
|---|
| 4360 | 4349 | int rc; |
|---|
| 4361 | 4350 | |
|---|
| 4362 | 4351 | vf = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); |
|---|
| .. | .. |
|---|
| 4367 | 4356 | if (rc) |
|---|
| 4368 | 4357 | return rc; |
|---|
| 4369 | 4358 | |
|---|
| 4370 | | - p_link = &QED_LEADING_HWFN(p_hwfn->cdev)->mcp_info->link_output; |
|---|
| 4371 | | - |
|---|
| 4372 | | - return qed_init_vport_rl(p_hwfn, p_ptt, abs_vp_id, (u32)val, |
|---|
| 4373 | | - p_link->speed); |
|---|
| 4359 | + rl_id = abs_vp_id; /* The "rl_id" is set as the "vport_id" */ |
|---|
| 4360 | + return qed_init_global_rl(p_hwfn, p_ptt, rl_id, (u32)val); |
|---|
| 4374 | 4361 | } |
|---|
| 4375 | 4362 | |
|---|
| 4376 | 4363 | static int |
|---|
| .. | .. |
|---|
| 4391 | 4378 | } |
|---|
| 4392 | 4379 | |
|---|
| 4393 | 4380 | vf = qed_iov_get_vf_info(QED_LEADING_HWFN(cdev), (u16)vfid, true); |
|---|
| 4381 | + if (!vf) |
|---|
| 4382 | + return -EINVAL; |
|---|
| 4383 | + |
|---|
| 4394 | 4384 | vport_id = vf->vport_id; |
|---|
| 4395 | 4385 | |
|---|
| 4396 | 4386 | return qed_configure_vport_wfq(cdev, vport_id, rate); |
|---|
| .. | .. |
|---|
| 4450 | 4440 | if (cdev->p_iov_info && cdev->p_iov_info->num_vfs && pci_enabled) |
|---|
| 4451 | 4441 | pci_disable_sriov(cdev->pdev); |
|---|
| 4452 | 4442 | |
|---|
| 4443 | + if (cdev->recov_in_prog) { |
|---|
| 4444 | + DP_VERBOSE(cdev, |
|---|
| 4445 | + QED_MSG_IOV, |
|---|
| 4446 | + "Skip SRIOV disable operations in the device since a recovery is in progress\n"); |
|---|
| 4447 | + goto out; |
|---|
| 4448 | + } |
|---|
| 4449 | + |
|---|
| 4453 | 4450 | for_each_hwfn(cdev, i) { |
|---|
| 4454 | 4451 | struct qed_hwfn *hwfn = &cdev->hwfns[i]; |
|---|
| 4455 | 4452 | struct qed_ptt *ptt = qed_ptt_acquire(hwfn); |
|---|
| .. | .. |
|---|
| 4489 | 4486 | |
|---|
| 4490 | 4487 | qed_ptt_release(hwfn, ptt); |
|---|
| 4491 | 4488 | } |
|---|
| 4492 | | - |
|---|
| 4489 | +out: |
|---|
| 4493 | 4490 | qed_iov_set_vfs_to_disable(cdev, false); |
|---|
| 4494 | 4491 | |
|---|
| 4495 | 4492 | return 0; |
|---|
| .. | .. |
|---|
| 4676 | 4673 | struct qed_public_vf_info *vf_info; |
|---|
| 4677 | 4674 | struct qed_mcp_link_state link; |
|---|
| 4678 | 4675 | u32 tx_rate; |
|---|
| 4676 | + int ret; |
|---|
| 4679 | 4677 | |
|---|
| 4680 | 4678 | /* Sanitize request */ |
|---|
| 4681 | 4679 | if (IS_VF(cdev)) |
|---|
| .. | .. |
|---|
| 4689 | 4687 | |
|---|
| 4690 | 4688 | vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true); |
|---|
| 4691 | 4689 | |
|---|
| 4692 | | - qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL); |
|---|
| 4690 | + ret = qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL); |
|---|
| 4691 | + if (ret) |
|---|
| 4692 | + return ret; |
|---|
| 4693 | 4693 | |
|---|
| 4694 | 4694 | /* Fill information about VF */ |
|---|
| 4695 | 4695 | ivi->vf = vf_id; |
|---|
| .. | .. |
|---|
| 4705 | 4705 | tx_rate = vf_info->tx_rate; |
|---|
| 4706 | 4706 | ivi->max_tx_rate = tx_rate ? tx_rate : link.speed; |
|---|
| 4707 | 4707 | ivi->min_tx_rate = qed_iov_get_vf_min_rate(hwfn, vf_id); |
|---|
| 4708 | + ivi->trusted = vf_info->is_trusted_request; |
|---|
| 4708 | 4709 | |
|---|
| 4709 | 4710 | return 0; |
|---|
| 4710 | 4711 | } |
|---|
| .. | .. |
|---|
| 5057 | 5058 | for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++) { |
|---|
| 5058 | 5059 | if (ether_addr_equal(vf->shadow_config.macs[i], |
|---|
| 5059 | 5060 | vf_info->mac)) { |
|---|
| 5060 | | - memset(vf->shadow_config.macs[i], 0, |
|---|
| 5061 | | - ETH_ALEN); |
|---|
| 5061 | + eth_zero_addr(vf->shadow_config.macs[i]); |
|---|
| 5062 | 5062 | DP_VERBOSE(hwfn, QED_MSG_IOV, |
|---|
| 5063 | 5063 | "Shadow MAC %pM removed for VF 0x%02x, VF trust mode is ON\n", |
|---|
| 5064 | 5064 | vf_info->mac, vf_id); |
|---|
| .. | .. |
|---|
| 5067 | 5067 | } |
|---|
| 5068 | 5068 | |
|---|
| 5069 | 5069 | ether_addr_copy(vf_info->mac, force_mac); |
|---|
| 5070 | | - memset(vf_info->forced_mac, 0, ETH_ALEN); |
|---|
| 5070 | + eth_zero_addr(vf_info->forced_mac); |
|---|
| 5071 | 5071 | vf->bulletin.p_virt->valid_bitmap &= |
|---|
| 5072 | 5072 | ~BIT(MAC_ADDR_FORCED); |
|---|
| 5073 | 5073 | qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG); |
|---|
| .. | .. |
|---|
| 5078 | 5078 | if (!vf_info->is_trusted_configured) { |
|---|
| 5079 | 5079 | u8 empty_mac[ETH_ALEN]; |
|---|
| 5080 | 5080 | |
|---|
| 5081 | | - memset(empty_mac, 0, ETH_ALEN); |
|---|
| 5081 | + eth_zero_addr(empty_mac); |
|---|
| 5082 | 5082 | for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++) { |
|---|
| 5083 | 5083 | if (ether_addr_equal(vf->shadow_config.macs[i], |
|---|
| 5084 | 5084 | empty_mac)) { |
|---|
| .. | .. |
|---|
| 5126 | 5126 | |
|---|
| 5127 | 5127 | /* Validate that the VF has a configured vport */ |
|---|
| 5128 | 5128 | vf = qed_iov_get_vf_info(hwfn, i, true); |
|---|
| 5129 | | - if (!vf->vport_instance) |
|---|
| 5129 | + if (!vf || !vf->vport_instance) |
|---|
| 5130 | 5130 | continue; |
|---|
| 5131 | 5131 | |
|---|
| 5132 | 5132 | memset(¶ms, 0, sizeof(params)); |
|---|
| .. | .. |
|---|
| 5135 | 5135 | |
|---|
| 5136 | 5136 | params.update_ctl_frame_check = 1; |
|---|
| 5137 | 5137 | params.mac_chk_en = !vf_info->is_trusted_configured; |
|---|
| 5138 | + params.update_accept_any_vlan_flg = 0; |
|---|
| 5139 | + |
|---|
| 5140 | + if (vf_info->accept_any_vlan && vf_info->forced_vlan) { |
|---|
| 5141 | + params.update_accept_any_vlan_flg = 1; |
|---|
| 5142 | + params.accept_any_vlan = vf_info->accept_any_vlan; |
|---|
| 5143 | + } |
|---|
| 5138 | 5144 | |
|---|
| 5139 | 5145 | if (vf_info->rx_accept_mode & mask) { |
|---|
| 5140 | 5146 | flags->update_rx_mode_config = 1; |
|---|
| .. | .. |
|---|
| 5150 | 5156 | if (!vf_info->is_trusted_configured) { |
|---|
| 5151 | 5157 | flags->rx_accept_filter &= ~mask; |
|---|
| 5152 | 5158 | flags->tx_accept_filter &= ~mask; |
|---|
| 5159 | + params.accept_any_vlan = false; |
|---|
| 5153 | 5160 | } |
|---|
| 5154 | 5161 | |
|---|
| 5155 | 5162 | if (flags->update_rx_mode_config || |
|---|
| 5156 | 5163 | flags->update_tx_mode_config || |
|---|
| 5157 | | - params.update_ctl_frame_check) |
|---|
| 5164 | + params.update_ctl_frame_check || |
|---|
| 5165 | + params.update_accept_any_vlan_flg) { |
|---|
| 5166 | + DP_VERBOSE(hwfn, QED_MSG_IOV, |
|---|
| 5167 | + "vport update config for %s VF[abs 0x%x rel 0x%x]\n", |
|---|
| 5168 | + vf_info->is_trusted_configured ? "trusted" : "untrusted", |
|---|
| 5169 | + vf->abs_vf_id, vf->relative_vf_id); |
|---|
| 5158 | 5170 | qed_sp_vport_update(hwfn, ¶ms, |
|---|
| 5159 | 5171 | QED_SPQ_MODE_EBLOCK, NULL); |
|---|
| 5172 | + } |
|---|
| 5160 | 5173 | } |
|---|
| 5161 | 5174 | } |
|---|
| 5162 | 5175 | |
|---|