Print this page
11493 aggr needs support for multiple pseudo rx groups
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
*** 20,29 ****
--- 20,30 ----
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018 Joyent, Inc.
*/
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/param.h>
*** 2403,2413 ****
rx_ringp->gen_num = mr_gen_num;
rx_ringp->state |= VNET_RXRING_STARTED;
return (0);
}
! err = mac_hwring_start(rx_ringp->hw_rh);
if (err == 0) {
rx_ringp->gen_num = mr_gen_num;
rx_ringp->state |= VNET_RXRING_STARTED;
} else {
err = ENXIO;
--- 2404,2414 ----
rx_ringp->gen_num = mr_gen_num;
rx_ringp->state |= VNET_RXRING_STARTED;
return (0);
}
! err = mac_hwring_activate(rx_ringp->hw_rh);
if (err == 0) {
rx_ringp->gen_num = mr_gen_num;
rx_ringp->state |= VNET_RXRING_STARTED;
} else {
err = ENXIO;
*** 2441,2451 ****
if (rx_ringp->hw_rh == NULL) {
rx_ringp->state &= ~VNET_RXRING_STARTED;
return;
}
! mac_hwring_stop(rx_ringp->hw_rh);
rx_ringp->state &= ~VNET_RXRING_STARTED;
}
static int
vnet_rx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val)
--- 2442,2452 ----
if (rx_ringp->hw_rh == NULL) {
rx_ringp->state &= ~VNET_RXRING_STARTED;
return;
}
! mac_hwring_quiesce(rx_ringp->hw_rh);
rx_ringp->state &= ~VNET_RXRING_STARTED;
}
static int
vnet_rx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val)
*** 2844,2854 ****
mac_hwring_setup(rx_ringp->hw_rh,
(mac_resource_handle_t)rx_ringp, NULL);
/* Start the hwring if needed */
if (rx_ringp->state & VNET_RXRING_STARTED) {
! rv = mac_hwring_start(rx_ringp->hw_rh);
if (rv != 0) {
mac_hwring_teardown(rx_ringp->hw_rh);
rx_ringp->hw_rh = NULL;
goto fail;
}
--- 2845,2855 ----
mac_hwring_setup(rx_ringp->hw_rh,
(mac_resource_handle_t)rx_ringp, NULL);
/* Start the hwring if needed */
if (rx_ringp->state & VNET_RXRING_STARTED) {
! rv = mac_hwring_activate(rx_ringp->hw_rh);
if (rv != 0) {
mac_hwring_teardown(rx_ringp->hw_rh);
rx_ringp->hw_rh = NULL;
goto fail;
}
*** 2918,2928 ****
rx_grp = &vnetp->rx_grp[0];
for (i = 0; i < VNET_NUM_HYBRID_RINGS; i++) {
rx_ringp = &rx_grp->rings[i + VNET_HYBRID_RXRING_INDEX];
if (rx_ringp->hw_rh != NULL) {
/* Stop the hwring */
! mac_hwring_stop(rx_ringp->hw_rh);
/* Teardown the hwring */
mac_hwring_teardown(rx_ringp->hw_rh);
rx_ringp->hw_rh = NULL;
}
--- 2919,2929 ----
rx_grp = &vnetp->rx_grp[0];
for (i = 0; i < VNET_NUM_HYBRID_RINGS; i++) {
rx_ringp = &rx_grp->rings[i + VNET_HYBRID_RXRING_INDEX];
if (rx_ringp->hw_rh != NULL) {
/* Stop the hwring */
! mac_hwring_quiesce(rx_ringp->hw_rh);
/* Teardown the hwring */
mac_hwring_teardown(rx_ringp->hw_rh);
rx_ringp->hw_rh = NULL;
}