| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ixgbe_vf.c,v 1.17 2018/04/04 08:59:22 msaitoh Exp $ */ | | 1 | /* $NetBSD: ixgbe_vf.c,v 1.18 2019/07/02 04:09:03 msaitoh Exp $ */ |
2 | | | 2 | |
3 | /****************************************************************************** | | 3 | /****************************************************************************** |
4 | SPDX-License-Identifier: BSD-3-Clause | | 4 | SPDX-License-Identifier: BSD-3-Clause |
5 | | | 5 | |
6 | Copyright (c) 2001-2017, Intel Corporation | | 6 | Copyright (c) 2001-2017, Intel Corporation |
7 | All rights reserved. | | 7 | All rights reserved. |
8 | | | 8 | |
9 | Redistribution and use in source and binary forms, with or without | | 9 | Redistribution and use in source and binary forms, with or without |
10 | modification, are permitted provided that the following conditions are met: | | 10 | modification, are permitted provided that the following conditions are met: |
11 | | | 11 | |
12 | 1. Redistributions of source code must retain the above copyright notice, | | 12 | 1. Redistributions of source code must retain the above copyright notice, |
13 | this list of conditions and the following disclaimer. | | 13 | this list of conditions and the following disclaimer. |
14 | | | 14 | |
| @@ -378,27 +378,26 @@ s32 ixgbe_set_rar_vf(struct ixgbe_hw *hw | | | @@ -378,27 +378,26 @@ s32 ixgbe_set_rar_vf(struct ixgbe_hw *hw |
378 | * ixgbe_update_mc_addr_list_vf - Update Multicast addresses | | 378 | * ixgbe_update_mc_addr_list_vf - Update Multicast addresses |
379 | * @hw: pointer to the HW structure | | 379 | * @hw: pointer to the HW structure |
380 | * @mc_addr_list: array of multicast addresses to program | | 380 | * @mc_addr_list: array of multicast addresses to program |
381 | * @mc_addr_count: number of multicast addresses to program | | 381 | * @mc_addr_count: number of multicast addresses to program |
382 | * @next: caller supplied function to return next address in list | | 382 | * @next: caller supplied function to return next address in list |
383 | * @clear: unused | | 383 | * @clear: unused |
384 | * | | 384 | * |
385 | * Updates the Multicast Table Array. | | 385 | * Updates the Multicast Table Array. |
386 | **/ | | 386 | **/ |
387 | s32 ixgbe_update_mc_addr_list_vf(struct ixgbe_hw *hw, u8 *mc_addr_list, | | 387 | s32 ixgbe_update_mc_addr_list_vf(struct ixgbe_hw *hw, u8 *mc_addr_list, |
388 | u32 mc_addr_count, ixgbe_mc_addr_itr next, | | 388 | u32 mc_addr_count, ixgbe_mc_addr_itr next, |
389 | bool clear) | | 389 | bool clear) |
390 | { | | 390 | { |
391 | struct ixgbe_mbx_info *mbx = &hw->mbx; | | | |
392 | u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; | | 391 | u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; |
393 | u16 *vector_list = (u16 *)&msgbuf[1]; | | 392 | u16 *vector_list = (u16 *)&msgbuf[1]; |
394 | u32 vector; | | 393 | u32 vector; |
395 | u32 cnt, i; | | 394 | u32 cnt, i; |
396 | u32 vmdq; | | 395 | u32 vmdq; |
397 | | | 396 | |
398 | UNREFERENCED_1PARAMETER(clear); | | 397 | UNREFERENCED_1PARAMETER(clear); |
399 | | | 398 | |
400 | DEBUGFUNC("ixgbe_update_mc_addr_list_vf"); | | 399 | DEBUGFUNC("ixgbe_update_mc_addr_list_vf"); |
401 | | | 400 | |
402 | /* Each entry in the list uses 1 16 bit word. We have 30 | | 401 | /* Each entry in the list uses 1 16 bit word. We have 30 |
403 | * 16 bit words available in our HW msg buffer (minus 1 for the | | 402 | * 16 bit words available in our HW msg buffer (minus 1 for the |
404 | * msg type). That's 30 hash values if we pack 'em right. If | | 403 | * msg type). That's 30 hash values if we pack 'em right. If |
| @@ -409,28 +408,28 @@ s32 ixgbe_update_mc_addr_list_vf(struct | | | @@ -409,28 +408,28 @@ s32 ixgbe_update_mc_addr_list_vf(struct |
409 | */ | | 408 | */ |
410 | | | 409 | |
411 | DEBUGOUT1("MC Addr Count = %d\n", mc_addr_count); | | 410 | DEBUGOUT1("MC Addr Count = %d\n", mc_addr_count); |
412 | | | 411 | |
413 | cnt = (mc_addr_count > 30) ? 30 : mc_addr_count; | | 412 | cnt = (mc_addr_count > 30) ? 30 : mc_addr_count; |
414 | msgbuf[0] = IXGBE_VF_SET_MULTICAST; | | 413 | msgbuf[0] = IXGBE_VF_SET_MULTICAST; |
415 | msgbuf[0] |= cnt << IXGBE_VT_MSGINFO_SHIFT; | | 414 | msgbuf[0] |= cnt << IXGBE_VT_MSGINFO_SHIFT; |
416 | | | 415 | |
417 | for (i = 0; i < cnt; i++) { | | 416 | for (i = 0; i < cnt; i++) { |
418 | vector = ixgbe_mta_vector(hw, next(hw, &mc_addr_list, &vmdq)); | | 417 | vector = ixgbe_mta_vector(hw, next(hw, &mc_addr_list, &vmdq)); |
419 | DEBUGOUT1("Hash value = 0x%03X\n", vector); | | 418 | DEBUGOUT1("Hash value = 0x%03X\n", vector); |
420 | vector_list[i] = (u16)vector; | | 419 | vector_list[i] = (u16)vector; |
421 | } | | 420 | } |
422 | | | 421 | return ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, |
423 | return mbx->ops.write_posted(hw, msgbuf, IXGBE_VFMAILBOX_SIZE, 0); | | 422 | IXGBE_VFMAILBOX_SIZE); |
424 | } | | 423 | } |
425 | | | 424 | |
426 | /** | | 425 | /** |
427 | * ixgbevf_update_xcast_mode - Update Multicast mode | | 426 | * ixgbevf_update_xcast_mode - Update Multicast mode |
428 | * @hw: pointer to the HW structure | | 427 | * @hw: pointer to the HW structure |
429 | * @xcast_mode: new multicast mode | | 428 | * @xcast_mode: new multicast mode |
430 | * | | 429 | * |
431 | * Updates the Multicast Mode of VF. | | 430 | * Updates the Multicast Mode of VF. |
432 | **/ | | 431 | **/ |
433 | s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) | | 432 | s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) |
434 | { | | 433 | { |
435 | u32 msgbuf[2]; | | 434 | u32 msgbuf[2]; |
436 | s32 err; | | 435 | s32 err; |