Deleted Added
full compact
3c3
< Copyright (c) 2001-2015, Intel Corporation
---
> Copyright (c) 2001-2017, Intel Corporation
5,6c5,6
<
< Redistribution and use in source and binary forms, with or without
---
>
> Redistribution and use in source and binary forms, with or without
8,9c8,9
<
< 1. Redistributions of source code must retain the above copyright notice,
---
>
> 1. Redistributions of source code must retain the above copyright notice,
11,13c11,13
<
< 2. Redistributions in binary form must reproduce the above copyright
< notice, this list of conditions and the following disclaimer in the
---
>
> 2. Redistributions in binary form must reproduce the above copyright
> notice, this list of conditions and the following disclaimer in the
15,17c15,17
<
< 3. Neither the name of the Intel Corporation nor the names of its
< contributors may be used to endorse or promote products derived from
---
>
> 3. Neither the name of the Intel Corporation nor the names of its
> contributors may be used to endorse or promote products derived from
19c19
<
---
>
21,28c21,28
< AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
< IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
< ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
< LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
< CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
< SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
< INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
< CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
---
> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33c33
< /*$FreeBSD: stable/11/sys/dev/ixgbe/ixgbe_vf.c 292674 2015-12-23 22:45:17Z sbruno $*/
---
> /*$FreeBSD: stable/11/sys/dev/ixgbe/ixgbe_vf.c 320897 2017-07-11 21:25:07Z erj $*/
36,38c36
< #include "ixgbe_api.h"
< #include "ixgbe_type.h"
< #include "ixgbe_vf.h"
---
> #include "ixgbe.h"
67a66
> hw->mac.ops.negotiate_api_version = ixgbevf_negotiate_api_version;
78a78
> hw->mac.ops.update_xcast_mode = ixgbevf_update_xcast_mode;
82a83
> hw->mac.ops.set_rlpml = ixgbevf_rlpml_set_vf;
232c233,235
< memcpy(hw->mac.perm_addr, addr, IXGBE_ETH_LENGTH_OF_ADDRESS);
---
> if (msgbuf[0] == (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK))
> memcpy(hw->mac.perm_addr, addr, IXGBE_ETH_LENGTH_OF_ADDRESS);
>
324,325c327,328
< static void ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw,
< u32 *msg, u16 size)
---
> static s32 ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw, u32 *msg,
> u32 *retmsg, u16 size)
328d330
< u32 retmsg[IXGBE_VFMAILBOX_SIZE];
331,332c333,336
< if (!retval)
< mbx->ops.read_posted(hw, retmsg, size, 0);
---
> if (retval)
> return retval;
>
> return mbx->ops.read_posted(hw, retmsg, size, 0);
346d349
< struct ixgbe_mbx_info *mbx = &hw->mbx;
355c358
< ret_val = mbx->ops.write_posted(hw, msgbuf, 3, 0);
---
> ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 3);
357,359d359
< if (!ret_val)
< ret_val = mbx->ops.read_posted(hw, msgbuf, 3, 0);
<
364c364
< (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_NACK)))
---
> (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_NACK))) {
365a366,367
> return IXGBE_ERR_MBX;
> }
418a421,457
> * ixgbevf_update_xcast_mode - Update Multicast mode
> * @hw: pointer to the HW structure
> * @xcast_mode: new multicast mode
> *
> * Updates the Multicast Mode of VF.
> **/
> s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
> {
> u32 msgbuf[2];
> s32 err;
>
> switch (hw->api_version) {
> case ixgbe_mbox_api_12:
> /* New modes were introduced in 1.3 version */
> if (xcast_mode > IXGBEVF_XCAST_MODE_ALLMULTI)
> return IXGBE_ERR_FEATURE_NOT_SUPPORTED;
> /* Fall through */
> case ixgbe_mbox_api_13:
> break;
> default:
> return IXGBE_ERR_FEATURE_NOT_SUPPORTED;
> }
>
> msgbuf[0] = IXGBE_VF_UPDATE_XCAST_MODE;
> msgbuf[1] = xcast_mode;
>
> err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2);
> if (err)
> return err;
>
> msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
> if (msgbuf[0] == (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_NACK))
> return IXGBE_ERR_FEATURE_NOT_SUPPORTED;
> return IXGBE_SUCCESS;
> }
>
> /**
423a463,465
> * @vlvf_bypass: boolean flag indicating updating default pool is okay
> *
> * Turn on/off specified VLAN in the VLAN filter table.
425c467,468
< s32 ixgbe_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on)
---
> s32 ixgbe_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind,
> bool vlan_on, bool vlvf_bypass)
427d469
< struct ixgbe_mbx_info *mbx = &hw->mbx;
430c472
< UNREFERENCED_1PARAMETER(vind);
---
> UNREFERENCED_2PARAMETER(vind, vlvf_bypass);
437,440c479
< ret_val = mbx->ops.write_posted(hw, msgbuf, 2, 0);
< if (!ret_val)
< ret_val = mbx->ops.read_posted(hw, msgbuf, 1, 0);
<
---
> ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2);
487,488c526
< struct ixgbe_mbx_info *mbx = &hw->mbx;
< u32 msgbuf[3];
---
> u32 msgbuf[3], msgbuf_chk;
500a539
> msgbuf_chk = msgbuf[0];
503d541
< ret_val = mbx->ops.write_posted(hw, msgbuf, 3, 0);
505,506c543,545
< if (!ret_val)
< ret_val = mbx->ops.read_posted(hw, msgbuf, 3, 0);
---
> ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 3);
> if (!ret_val) {
> msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
508c547,549
< msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
---
> if (msgbuf[0] == (msgbuf_chk | IXGBE_VT_MSGTYPE_NACK))
> return IXGBE_ERR_OUT_OF_MEM;
> }
510,513d550
< if (!ret_val)
< if (msgbuf[0] == (IXGBE_VF_SET_MACVLAN | IXGBE_VT_MSGTYPE_NACK))
< ret_val = IXGBE_ERR_OUT_OF_MEM;
<
581a619,622
> if (hw->mac.type >= ixgbe_mac_X550) {
> if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
> *speed = IXGBE_LINK_SPEED_2_5GB_FULL;
> }
587a629,632
> if (hw->mac.type == ixgbe_mac_X550) {
> if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
> *speed = IXGBE_LINK_SPEED_5GB_FULL;
> }
588a634,641
> case IXGBE_LINKS_SPEED_10_X550EM_A:
> *speed = IXGBE_LINK_SPEED_UNKNOWN;
> /* Since Reserved in older MAC's */
> if (hw->mac.type >= ixgbe_mac_X550)
> *speed = IXGBE_LINK_SPEED_10_FULL;
> break;
> default:
> *speed = IXGBE_LINK_SPEED_UNKNOWN;
625c678
< void ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size)
---
> s32 ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size)
627a681
> s32 retval;
631c685,693
< ixgbevf_write_msg_read_ack(hw, msgbuf, 2);
---
>
> retval = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2);
> if (retval)
> return retval;
> if ((msgbuf[0] & IXGBE_VF_SET_LPE) &&
> (msgbuf[0] & IXGBE_VT_MSGTYPE_NACK))
> return IXGBE_ERR_MBX;
>
> return 0;
648d709
< err = hw->mbx.ops.write_posted(hw, msg, 3, 0);
650,652c711
< if (!err)
< err = hw->mbx.ops.read_posted(hw, msg, 3, 0);
<
---
> err = ixgbevf_write_msg_read_ack(hw, msg, msg, 3);
676a736,737
> case ixgbe_mbox_api_12:
> case ixgbe_mbox_api_13:
685d745
< err = hw->mbx.ops.write_posted(hw, msg, 5, 0);
687,689c747
< if (!err)
< err = hw->mbx.ops.read_posted(hw, msg, 5, 0);
<
---
> err = ixgbevf_write_msg_read_ack(hw, msg, msg, 5);