8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
24 */
25
26 /*
27 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
28 */
29
30 #include "ixgbe_sw.h"
31
32 /*
33 * Bring the device out of the reset/quiesced state that it
34 * was in when the interface was registered.
35 */
36 int
37 ixgbe_m_start(void *arg)
38 {
39 ixgbe_t *ixgbe = (ixgbe_t *)arg;
40
41 mutex_enter(&ixgbe->gen_lock);
42
43 if (ixgbe->ixgbe_state & IXGBE_SUSPENDED) {
44 mutex_exit(&ixgbe->gen_lock);
45 return (ECANCELED);
46 }
47
693 err = EINVAL;
694 else {
695 ixgbe->rx_limit_per_intr = (uint32_t)result;
696 }
697 return (err);
698 }
699 if (strcmp(pr_name, "_intr_throttling") == 0) {
700 if (pr_val == NULL) {
701 err = EINVAL;
702 return (err);
703 }
704 (void) ddi_strtol(pr_val, (char **)NULL, 0, &result);
705
706 if (result < ixgbe->capab->min_intr_throttle ||
707 result > ixgbe->capab->max_intr_throttle)
708 err = EINVAL;
709 else {
710 ixgbe->intr_throttling[0] = (uint32_t)result;
711
712 /*
713 * 82599 requires the interupt throttling rate is
714 * a multiple of 8. This is enforced by the register
715 * definiton.
716 */
717 if (hw->mac.type == ixgbe_mac_82599EB)
718 ixgbe->intr_throttling[0] =
719 ixgbe->intr_throttling[0] & 0xFF8;
720
721 for (i = 0; i < MAX_INTR_VECTOR; i++)
722 ixgbe->intr_throttling[i] =
723 ixgbe->intr_throttling[0];
724
725 /* Set interrupt throttling rate */
726 for (i = 0; i < ixgbe->intr_cnt; i++)
727 IXGBE_WRITE_REG(hw, IXGBE_EITR(i),
728 ixgbe->intr_throttling[i]);
729 }
730 return (err);
731 }
732 return (ENOTSUP);
733 }
734
735 int
736 ixgbe_get_priv_prop(ixgbe_t *ixgbe, const char *pr_name,
737 uint_t pr_valsize, void *pr_val)
738 {
739 int err = ENOTSUP;
|
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
24 */
25
26 /*
27 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
29 */
30
31 #include "ixgbe_sw.h"
32
33 /*
34 * Bring the device out of the reset/quiesced state that it
35 * was in when the interface was registered.
36 */
37 int
38 ixgbe_m_start(void *arg)
39 {
40 ixgbe_t *ixgbe = (ixgbe_t *)arg;
41
42 mutex_enter(&ixgbe->gen_lock);
43
44 if (ixgbe->ixgbe_state & IXGBE_SUSPENDED) {
45 mutex_exit(&ixgbe->gen_lock);
46 return (ECANCELED);
47 }
48
694 err = EINVAL;
695 else {
696 ixgbe->rx_limit_per_intr = (uint32_t)result;
697 }
698 return (err);
699 }
700 if (strcmp(pr_name, "_intr_throttling") == 0) {
701 if (pr_val == NULL) {
702 err = EINVAL;
703 return (err);
704 }
705 (void) ddi_strtol(pr_val, (char **)NULL, 0, &result);
706
707 if (result < ixgbe->capab->min_intr_throttle ||
708 result > ixgbe->capab->max_intr_throttle)
709 err = EINVAL;
710 else {
711 ixgbe->intr_throttling[0] = (uint32_t)result;
712
713 /*
714 * 82599 and X540 require the interupt throttling
715 * rate is a multiple of 8. This is enforced by the
716 * register definiton.
717 */
718 if (hw->mac.type == ixgbe_mac_82599EB ||
719 hw->mac.type == ixgbe_mac_X540) {
720 ixgbe->intr_throttling[0] =
721 ixgbe->intr_throttling[0] & 0xFF8;
722 }
723
724 for (i = 0; i < MAX_INTR_VECTOR; i++)
725 ixgbe->intr_throttling[i] =
726 ixgbe->intr_throttling[0];
727
728 /* Set interrupt throttling rate */
729 for (i = 0; i < ixgbe->intr_cnt; i++)
730 IXGBE_WRITE_REG(hw, IXGBE_EITR(i),
731 ixgbe->intr_throttling[i]);
732 }
733 return (err);
734 }
735 return (ENOTSUP);
736 }
737
738 int
739 ixgbe_get_priv_prop(ixgbe_t *ixgbe, const char *pr_name,
740 uint_t pr_valsize, void *pr_val)
741 {
742 int err = ENOTSUP;
|