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>


 104 extern int mac_link_flow_modify(char *, mac_resource_props_t *);
 105 extern boolean_t mac_link_has_flows(mac_client_handle_t);
 106 
 107 typedef struct {
 108         char                    fi_flow_name[MAXFLOWNAMELEN];
 109         datalink_id_t           fi_link_id;
 110         flow_desc_t             fi_flow_desc;
 111         mac_resource_props_t    fi_resource_props;
 112 } mac_flowinfo_t;
 113 
 114 extern int mac_link_flow_walk(datalink_id_t,
 115     int (*)(mac_flowinfo_t *, void *), void *);
 116 extern int mac_link_flow_info(char *, mac_flowinfo_t *);
 117 
 118 extern void mac_rx_client_quiesce(mac_client_handle_t);
 119 extern void mac_rx_client_restart(mac_client_handle_t);
 120 extern void mac_tx_client_quiesce(mac_client_handle_t);
 121 extern void mac_tx_client_condemn(mac_client_handle_t);
 122 extern void mac_tx_client_restart(mac_client_handle_t);
 123 extern void mac_srs_perm_quiesce(mac_client_handle_t, boolean_t);


 124 extern int mac_hwrings_get(mac_client_handle_t, mac_group_handle_t *,
 125     mac_ring_handle_t *, mac_ring_type_t);
 126 extern uint_t mac_hwring_getinfo(mac_ring_handle_t);






 127 extern void mac_hwring_setup(mac_ring_handle_t, mac_resource_handle_t,
 128     mac_ring_handle_t);
 129 extern void mac_hwring_teardown(mac_ring_handle_t);
 130 extern int mac_hwring_disable_intr(mac_ring_handle_t);
 131 extern int mac_hwring_enable_intr(mac_ring_handle_t);
 132 extern int mac_hwring_start(mac_ring_handle_t);
 133 extern void mac_hwring_stop(mac_ring_handle_t);


 134 extern mblk_t *mac_hwring_poll(mac_ring_handle_t, int);
 135 extern mblk_t *mac_hwring_tx(mac_ring_handle_t, mblk_t *);
 136 extern int mac_hwring_getstat(mac_ring_handle_t, uint_t, uint64_t *);
 137 extern mblk_t *mac_hwring_send_priv(mac_client_handle_t,
 138     mac_ring_handle_t, mblk_t *);
 139 extern void mac_hwring_set_default(mac_handle_t, mac_ring_handle_t);
 140 
 141 #define MAC_HWRING_POLL(ring, bytes)                    \
 142         (((ring)->mr_info.mri_poll)                  \
 143         ((ring)->mr_info.mri_driver, (bytes)))
 144 
 145 extern int mac_hwgroup_addmac(mac_group_handle_t, const uint8_t *);
 146 extern int mac_hwgroup_remmac(mac_group_handle_t, const uint8_t *);
 147 extern int mac_hwgroup_addvlan(mac_group_handle_t, uint16_t);
 148 extern int mac_hwgroup_remvlan(mac_group_handle_t, uint16_t);
 149 
 150 extern boolean_t mac_has_hw_vlan(mac_handle_t);
 151 



 152 extern void mac_set_upper_mac(mac_client_handle_t, mac_handle_t,
 153     mac_resource_props_t *);
 154 
 155 extern int mac_mark_exclusive(mac_handle_t);
 156 extern void mac_unmark_exclusive(mac_handle_t);
 157 
 158 extern uint_t mac_hwgrp_num(mac_handle_t, int);
 159 extern void mac_get_hwrxgrp_info(mac_handle_t, int, uint_t *, uint_t *,
 160     uint_t *, uint_t *, uint_t *, char *);
 161 extern void mac_get_hwtxgrp_info(mac_handle_t, int, uint_t *, uint_t *,
 162     uint_t *, uint_t *, uint_t *, char *);
 163 
 164 extern uint_t mac_txavail_get(mac_handle_t);
 165 extern uint_t mac_rxavail_get(mac_handle_t);
 166 extern uint_t mac_txrsvd_get(mac_handle_t);
 167 extern uint_t mac_rxrsvd_get(mac_handle_t);
 168 extern uint_t mac_rxhwlnksavail_get(mac_handle_t);
 169 extern uint_t mac_rxhwlnksrsvd_get(mac_handle_t);
 170 extern uint_t mac_txhwlnksavail_get(mac_handle_t);
 171 extern uint_t mac_txhwlnksrsvd_get(mac_handle_t);




 104 extern int mac_link_flow_modify(char *, mac_resource_props_t *);
 105 extern boolean_t mac_link_has_flows(mac_client_handle_t);
 106 
 107 typedef struct {
 108         char                    fi_flow_name[MAXFLOWNAMELEN];
 109         datalink_id_t           fi_link_id;
 110         flow_desc_t             fi_flow_desc;
 111         mac_resource_props_t    fi_resource_props;
 112 } mac_flowinfo_t;
 113 
 114 extern int mac_link_flow_walk(datalink_id_t,
 115     int (*)(mac_flowinfo_t *, void *), void *);
 116 extern int mac_link_flow_info(char *, mac_flowinfo_t *);
 117 
 118 extern void mac_rx_client_quiesce(mac_client_handle_t);
 119 extern void mac_rx_client_restart(mac_client_handle_t);
 120 extern void mac_tx_client_quiesce(mac_client_handle_t);
 121 extern void mac_tx_client_condemn(mac_client_handle_t);
 122 extern void mac_tx_client_restart(mac_client_handle_t);
 123 extern void mac_srs_perm_quiesce(mac_client_handle_t, boolean_t);
 124 extern uint_t mac_hwrings_idx_get(mac_handle_t, uint_t, mac_group_handle_t *,
 125     mac_ring_handle_t *, mac_ring_type_t);
 126 extern int mac_hwrings_get(mac_client_handle_t, mac_group_handle_t *,
 127     mac_ring_handle_t *, mac_ring_type_t);
 128 extern uint_t mac_hwring_getinfo(mac_ring_handle_t);
 129 extern void mac_hwring_set_passthru(mac_ring_handle_t, mac_rx_t, void *,
 130     mac_resource_handle_t);
 131 extern void mac_hwring_clear_passthru(mac_ring_handle_t);
 132 extern void mac_client_set_flow_cb(mac_client_handle_t, mac_rx_t, void *);
 133 extern void mac_client_clear_flow_cb(mac_client_handle_t);
 134 
 135 extern void mac_hwring_setup(mac_ring_handle_t, mac_resource_handle_t,
 136     mac_ring_handle_t);
 137 extern void mac_hwring_teardown(mac_ring_handle_t);
 138 extern int mac_hwring_disable_intr(mac_ring_handle_t);
 139 extern int mac_hwring_enable_intr(mac_ring_handle_t);
 140 extern int mac_hwring_start(mac_ring_handle_t);
 141 extern void mac_hwring_stop(mac_ring_handle_t);
 142 extern int mac_hwring_activate(mac_ring_handle_t);
 143 extern void mac_hwring_quiesce(mac_ring_handle_t);
 144 extern mblk_t *mac_hwring_poll(mac_ring_handle_t, int);
 145 extern mblk_t *mac_hwring_tx(mac_ring_handle_t, mblk_t *);
 146 extern int mac_hwring_getstat(mac_ring_handle_t, uint_t, uint64_t *);
 147 extern mblk_t *mac_hwring_send_priv(mac_client_handle_t,
 148     mac_ring_handle_t, mblk_t *);
 149 extern void mac_hwring_set_default(mac_handle_t, mac_ring_handle_t);
 150 
 151 #define MAC_HWRING_POLL(ring, bytes)                    \
 152         (((ring)->mr_info.mri_poll)                  \
 153         ((ring)->mr_info.mri_driver, (bytes)))
 154 
 155 extern int mac_hwgroup_addmac(mac_group_handle_t, const uint8_t *);
 156 extern int mac_hwgroup_remmac(mac_group_handle_t, const uint8_t *);
 157 extern int mac_hwgroup_addvlan(mac_group_handle_t, uint16_t);
 158 extern int mac_hwgroup_remvlan(mac_group_handle_t, uint16_t);
 159 
 160 extern boolean_t mac_has_hw_vlan(mac_handle_t);
 161 
 162 extern uint_t mac_get_num_rx_groups(mac_handle_t);
 163 extern int mac_set_promisc(mac_handle_t, boolean_t);
 164 
 165 extern void mac_set_upper_mac(mac_client_handle_t, mac_handle_t,
 166     mac_resource_props_t *);
 167 
 168 extern int mac_mark_exclusive(mac_handle_t);
 169 extern void mac_unmark_exclusive(mac_handle_t);
 170 
 171 extern uint_t mac_hwgrp_num(mac_handle_t, int);
 172 extern void mac_get_hwrxgrp_info(mac_handle_t, int, uint_t *, uint_t *,
 173     uint_t *, uint_t *, uint_t *, char *);
 174 extern void mac_get_hwtxgrp_info(mac_handle_t, int, uint_t *, uint_t *,
 175     uint_t *, uint_t *, uint_t *, char *);
 176 
 177 extern uint_t mac_txavail_get(mac_handle_t);
 178 extern uint_t mac_rxavail_get(mac_handle_t);
 179 extern uint_t mac_txrsvd_get(mac_handle_t);
 180 extern uint_t mac_rxrsvd_get(mac_handle_t);
 181 extern uint_t mac_rxhwlnksavail_get(mac_handle_t);
 182 extern uint_t mac_rxhwlnksrsvd_get(mac_handle_t);
 183 extern uint_t mac_txhwlnksavail_get(mac_handle_t);
 184 extern uint_t mac_txhwlnksrsvd_get(mac_handle_t);