summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/inet/ip.h14
-rw-r--r--usr/src/uts/common/inet/ip/ip_if.c4
-rw-r--r--usr/src/uts/common/io/aggr/aggr_grp.c3
-rw-r--r--usr/src/uts/common/io/aggr/aggr_port.c3
-rw-r--r--usr/src/uts/common/io/dld/dld_str.c6
-rw-r--r--usr/src/uts/common/io/dls/dls.c18
-rw-r--r--usr/src/uts/common/io/dls/dls_link.c56
-rw-r--r--usr/src/uts/common/sys/dlpi.h8
-rw-r--r--usr/src/uts/common/sys/dls_impl.h6
9 files changed, 80 insertions, 38 deletions
diff --git a/usr/src/uts/common/inet/ip.h b/usr/src/uts/common/inet/ip.h
index 9709a106f3..c499914ee9 100644
--- a/usr/src/uts/common/inet/ip.h
+++ b/usr/src/uts/common/inet/ip.h
@@ -2954,12 +2954,11 @@ struct ill_zerocopy_capab_s {
#define ILL_POLLING 0x01 /* Polling in use */
/*
- * these two functions pointer types are exported by the mac layer.
- * we need to duplicate the definitions here because we cannot
+ * This function pointer type is exported by the mac layer.
+ * we need to duplicate the definition here because we cannot
* include mac.h in this file.
*/
typedef void (*ip_mac_blank_t)(void *, time_t, uint_t);
-typedef void (*ip_mac_tx_t)(void *, mblk_t *);
struct ill_rx_ring {
ip_mac_blank_t rr_blank; /* Driver interrupt blanking func */
@@ -2977,9 +2976,14 @@ struct ill_rx_ring {
uint32_t rr_ring_state; /* State of this ring */
};
+/*
+ * This is exported by dld and is meant to be invoked from a ULP.
+ */
+typedef void (*ip_dld_tx_t)(void *, mblk_t *);
+
struct ill_poll_capab_s {
- ip_mac_tx_t ill_tx; /* Driver Tx routine */
- void *ill_tx_handle; /* Driver Tx handle */
+ ip_dld_tx_t ill_tx; /* dld-supplied tx routine */
+ void *ill_tx_handle; /* dld-supplied tx handle */
ill_rx_ring_t *ill_ring_tbl; /* Ring to Sqp mapping table */
conn_t *ill_unbind_conn; /* Conn used during unplumb */
};
diff --git a/usr/src/uts/common/inet/ip/ip_if.c b/usr/src/uts/common/inet/ip/ip_if.c
index 1bffa34682..1fbf9a5257 100644
--- a/usr/src/uts/common/inet/ip/ip_if.c
+++ b/usr/src/uts/common/inet/ip/ip_if.c
@@ -2813,8 +2813,8 @@ ill_capability_poll_capable(ill_t *ill, dl_capab_poll_t *ipoll,
/* Copy locally to get the members aligned */
bcopy((void *)ipoll, (void *)&poll, sizeof (dl_capab_poll_t));
- /* Get the tx function and handle from the driver */
- ill_poll->ill_tx = (ip_mac_tx_t)poll.poll_tx;
+ /* Get the tx function and handle from dld */
+ ill_poll->ill_tx = (ip_dld_tx_t)poll.poll_tx;
ill_poll->ill_tx_handle = (void *)poll.poll_tx_handle;
size = sizeof (dl_capability_req_t) + sizeof (dl_capability_sub_t) +
diff --git a/usr/src/uts/common/io/aggr/aggr_grp.c b/usr/src/uts/common/io/aggr/aggr_grp.c
index 091d6c4550..9fa95bf308 100644
--- a/usr/src/uts/common/io/aggr/aggr_grp.c
+++ b/usr/src/uts/common/io/aggr/aggr_grp.c
@@ -322,6 +322,7 @@ aggr_grp_port_mac_changed(aggr_grp_t *grp, aggr_port_t *port)
{
boolean_t grp_addr_changed = B_FALSE;
+ ASSERT(AGGR_LACP_LOCK_HELD(grp));
ASSERT(RW_WRITE_HELD(&grp->lg_lock));
ASSERT(RW_WRITE_HELD(&port->lp_lock));
@@ -1191,6 +1192,7 @@ aggr_m_promisc(void *arg, boolean_t on)
aggr_grp_t *grp = arg;
aggr_port_t *port;
+ AGGR_LACP_LOCK(grp);
rw_enter(&grp->lg_lock, RW_WRITER);
AGGR_GRP_REFHOLD(grp);
@@ -1214,6 +1216,7 @@ aggr_m_promisc(void *arg, boolean_t on)
bail:
rw_exit(&grp->lg_lock);
+ AGGR_LACP_UNLOCK(grp);
AGGR_GRP_REFRELE(grp);
return (0);
diff --git a/usr/src/uts/common/io/aggr/aggr_port.c b/usr/src/uts/common/io/aggr/aggr_port.c
index b5bc572901..19cb798352 100644
--- a/usr/src/uts/common/io/aggr/aggr_port.c
+++ b/usr/src/uts/common/io/aggr/aggr_port.c
@@ -285,6 +285,7 @@ aggr_port_notify_unicst(aggr_grp_t *grp, aggr_port_t *port)
if (port->lp_set_grpmac)
return (B_FALSE);
+ AGGR_LACP_LOCK(grp);
rw_enter(&grp->lg_lock, RW_WRITER);
rw_enter(&port->lp_lock, RW_WRITER);
@@ -297,6 +298,7 @@ aggr_port_notify_unicst(aggr_grp_t *grp, aggr_port_t *port)
if (grp->lg_closing) {
rw_exit(&grp->lg_lock);
+ AGGR_LACP_UNLOCK(grp);
return (B_FALSE);
}
@@ -309,6 +311,7 @@ aggr_port_notify_unicst(aggr_grp_t *grp, aggr_port_t *port)
aggr_grp_update_ports_mac(grp);
rw_exit(&grp->lg_lock);
+ AGGR_LACP_UNLOCK(grp);
return (grp_mac_changed);
}
diff --git a/usr/src/uts/common/io/dld/dld_str.c b/usr/src/uts/common/io/dld/dld_str.c
index 0e697c39f1..d723bd7450 100644
--- a/usr/src/uts/common/io/dld/dld_str.c
+++ b/usr/src/uts/common/io/dld/dld_str.c
@@ -231,6 +231,8 @@ dld_open(queue_t *rq, dev_t *devp, int flag, int sflag, cred_t *credp)
if ((err = dld_str_attach(dsp, (t_uscalar_t)minor - 1)) != 0)
goto failed;
ASSERT(dsp->ds_dlstate == DL_UNBOUND);
+ } else {
+ (void) qassociate(rq, -1);
}
/*
@@ -696,8 +698,8 @@ void
str_mdata_fastpath_put(dld_str_t *dsp, mblk_t *mp)
{
/*
- * We get here either as a result of putnext() from above or
- * because IP has called us directly. If we are in the busy
+ * This function can be called from within dld or from an upper
+ * layer protocol (currently only tcp). If we are in the busy
* mode enqueue the packet(s) and return. Otherwise hand them
* over to the MAC driver for transmission; any remaining one(s)
* which didn't get sent will be queued.
diff --git a/usr/src/uts/common/io/dls/dls.c b/usr/src/uts/common/io/dls/dls.c
index d7f9d876fb..0968818e07 100644
--- a/usr/src/uts/common/io/dls/dls.c
+++ b/usr/src/uts/common/io/dls/dls.c
@@ -788,7 +788,8 @@ dls_tx(dls_channel_t dc, mblk_t *mp)
}
boolean_t
-dls_accept(dls_impl_t *dip, const uint8_t *daddr)
+dls_accept(dls_impl_t *dip, const uint8_t *daddr, dls_rx_t *di_rx,
+ void **di_rx_arg)
{
boolean_t match;
dls_multicst_addr_t *dmap;
@@ -852,13 +853,20 @@ refuse:
return (B_FALSE);
accept:
+ /*
+ * Since we hold di_lock here, the returned di_rx and di_rx_arg will
+ * always be in sync.
+ */
+ *di_rx = dip->di_rx;
+ *di_rx_arg = dip->di_rx_arg;
rw_exit(&(dip->di_lock));
return (B_TRUE);
}
/*ARGSUSED*/
boolean_t
-dls_accept_loopback(dls_impl_t *dip, const uint8_t *daddr)
+dls_accept_loopback(dls_impl_t *dip, const uint8_t *daddr, dls_rx_t *di_rx,
+ void **di_rx_arg)
{
/*
* We must not accept packets if the dls_impl_t is not marked as bound
@@ -880,6 +888,12 @@ refuse:
return (B_FALSE);
accept:
+ /*
+ * Since we hold di_lock here, the returned di_rx and di_rx_arg will
+ * always be in sync.
+ */
+ *di_rx = dip->di_rx;
+ *di_rx_arg = dip->di_rx_arg;
rw_exit(&(dip->di_lock));
return (B_TRUE);
}
diff --git a/usr/src/uts/common/io/dls/dls_link.c b/usr/src/uts/common/io/dls/dls_link.c
index edb04a6b67..4b43f17114 100644
--- a/usr/src/uts/common/io/dls/dls_link.c
+++ b/usr/src/uts/common/io/dls/dls_link.c
@@ -267,6 +267,8 @@ i_dls_link_ether_rx(void *arg, mac_resource_handle_t mrh, mblk_t *mp)
mod_hash_key_t key;
uint_t npacket;
boolean_t accepted;
+ dls_rx_t di_rx, ndi_rx;
+ void *di_rx_arg, *ndi_rx_arg;
/*
* Walk the packet chain.
@@ -314,7 +316,7 @@ i_dls_link_ether_rx(void *arg, mac_resource_handle_t mrh, mblk_t *mp)
* Find the first dls_impl_t that will accept the sub-chain.
*/
for (dip = dhp->dh_list; dip != NULL; dip = dip->di_nextp)
- if (dls_accept(dip, daddr))
+ if (dls_accept(dip, daddr, &di_rx, &di_rx_arg))
break;
/*
@@ -338,7 +340,8 @@ i_dls_link_ether_rx(void *arg, mac_resource_handle_t mrh, mblk_t *mp)
*/
for (ndip = dip->di_nextp; ndip != NULL;
ndip = ndip->di_nextp)
- if (dls_accept(ndip, daddr))
+ if (dls_accept(ndip, daddr, &ndi_rx,
+ &ndi_rx_arg))
break;
/*
@@ -347,8 +350,7 @@ i_dls_link_ether_rx(void *arg, mac_resource_handle_t mrh, mblk_t *mp)
* it before handing it to the current one.
*/
if (ndip == NULL) {
- dip->di_rx(dip->di_rx_arg, mrh, mp,
- header_length);
+ di_rx(di_rx_arg, mrh, mp, header_length);
/*
* Since there are no more dls_impl_t, we're
@@ -361,10 +363,11 @@ i_dls_link_ether_rx(void *arg, mac_resource_handle_t mrh, mblk_t *mp)
* There are more dls_impl_t so dup the sub-chain.
*/
if ((nmp = copymsgchain(mp)) != NULL)
- dip->di_rx(dip->di_rx_arg, mrh, nmp,
- header_length);
+ di_rx(di_rx_arg, mrh, nmp, header_length);
dip = ndip;
+ di_rx = ndi_rx;
+ di_rx_arg = ndi_rx_arg;
}
/*
@@ -407,6 +410,8 @@ i_dls_link_ether_rx_promisc(void *arg, mac_resource_handle_t mrh,
mod_hash_key_t key;
uint_t npacket;
boolean_t accepted;
+ dls_rx_t di_rx, ndi_rx;
+ void *di_rx_arg, *ndi_rx_arg;
/*
* Walk the packet chain.
@@ -446,7 +451,7 @@ i_dls_link_ether_rx_promisc(void *arg, mac_resource_handle_t mrh,
* Find dls_impl_t that will accept the sub-chain.
*/
for (dip = dhp->dh_list; dip != NULL; dip = dip->di_nextp) {
- if (!dls_accept(dip, daddr))
+ if (!dls_accept(dip, daddr, &di_rx, &di_rx_arg))
continue;
/*
@@ -460,8 +465,7 @@ i_dls_link_ether_rx_promisc(void *arg, mac_resource_handle_t mrh,
* dls_impl_t) so dup the sub-chain.
*/
if ((nmp = copymsgchain(mp)) != NULL)
- dip->di_rx(dip->di_rx_arg, mrh, nmp,
- header_length);
+ di_rx(di_rx_arg, mrh, nmp, header_length);
}
/*
@@ -501,7 +505,7 @@ non_promisc:
* Find the first dls_impl_t that will accept the sub-chain.
*/
for (dip = dhp->dh_list; dip != NULL; dip = dip->di_nextp)
- if (dls_accept(dip, daddr))
+ if (dls_accept(dip, daddr, &di_rx, &di_rx_arg))
break;
/*
@@ -525,7 +529,8 @@ non_promisc:
*/
for (ndip = dip->di_nextp; ndip != NULL;
ndip = ndip->di_nextp)
- if (dls_accept(ndip, daddr))
+ if (dls_accept(ndip, daddr, &ndi_rx,
+ &ndi_rx_arg))
break;
/*
@@ -534,8 +539,7 @@ non_promisc:
* it before handing it to the current one.
*/
if (ndip == NULL) {
- dip->di_rx(dip->di_rx_arg, mrh, mp,
- header_length);
+ di_rx(di_rx_arg, mrh, mp, header_length);
/*
* Since there are no more dls_impl_t, we're
@@ -548,10 +552,11 @@ non_promisc:
* There are more dls_impl_t so dup the sub-chain.
*/
if ((nmp = copymsgchain(mp)) != NULL)
- dip->di_rx(dip->di_rx_arg, mrh, nmp,
- header_length);
+ di_rx(di_rx_arg, mrh, nmp, header_length);
dip = ndip;
+ di_rx = ndi_rx;
+ di_rx_arg = ndi_rx_arg;
}
/*
@@ -592,6 +597,8 @@ i_dls_link_ether_loopback(void *arg, mblk_t *mp)
mblk_t *nmp;
mod_hash_key_t key;
uint_t npacket;
+ dls_rx_t di_rx, ndi_rx;
+ void *di_rx_arg, *ndi_rx_arg;
/*
* Walk the packet chain.
@@ -633,7 +640,8 @@ i_dls_link_ether_loopback(void *arg, mblk_t *mp)
* Find dls_impl_t that will accept the sub-chain.
*/
for (dip = dhp->dh_list; dip != NULL; dip = dip->di_nextp) {
- if (!dls_accept_loopback(dip, daddr))
+ if (!dls_accept_loopback(dip, daddr, &di_rx,
+ &di_rx_arg))
continue;
/*
@@ -642,8 +650,7 @@ i_dls_link_ether_loopback(void *arg, mblk_t *mp)
* mode) so dup the sub-chain.
*/
if ((nmp = copymsgchain(mp)) != NULL)
- dip->di_rx(dip->di_rx_arg, NULL, nmp,
- header_length);
+ di_rx(di_rx_arg, NULL, nmp, header_length);
}
/*
@@ -676,7 +683,7 @@ promisc:
* Find the first dls_impl_t that will accept the sub-chain.
*/
for (dip = dhp->dh_list; dip != NULL; dip = dip->di_nextp)
- if (dls_accept_loopback(dip, daddr))
+ if (dls_accept_loopback(dip, daddr, &di_rx, &di_rx_arg))
break;
/*
@@ -696,7 +703,8 @@ promisc:
*/
for (ndip = dip->di_nextp; ndip != NULL;
ndip = ndip->di_nextp)
- if (dls_accept_loopback(ndip, daddr))
+ if (dls_accept_loopback(ndip, daddr,
+ &ndi_rx, &ndi_rx_arg))
break;
/*
@@ -705,8 +713,7 @@ promisc:
* it before handing it to the current one.
*/
if (ndip == NULL) {
- dip->di_rx(dip->di_rx_arg, NULL, mp,
- header_length);
+ di_rx(di_rx_arg, NULL, mp, header_length);
/*
* Since there are no more dls_impl_t, we're
@@ -719,10 +726,11 @@ promisc:
* There are more dls_impl_t so dup the sub-chain.
*/
if ((nmp = copymsgchain(mp)) != NULL)
- dip->di_rx(dip->di_rx_arg, NULL, nmp,
- header_length);
+ di_rx(di_rx_arg, NULL, nmp, header_length);
dip = ndip;
+ di_rx = ndi_rx;
+ di_rx_arg = ndi_rx_arg;
}
/*
diff --git a/usr/src/uts/common/sys/dlpi.h b/usr/src/uts/common/sys/dlpi.h
index f856bd9575..c35f9dc27d 100644
--- a/usr/src/uts/common/sys/dlpi.h
+++ b/usr/src/uts/common/sys/dlpi.h
@@ -693,11 +693,17 @@ typedef struct {
/* capability */
#ifdef _KERNEL
+/*
+ * This defines the DL_CAPAB_POLL capability. Currently it provides a
+ * mechanism for IP to exchange function pointers with a gldv3-based driver
+ * to enable streams-bypassing data-paths and interrupt blanking. True polling
+ * support will be added in the future.
+ */
typedef struct dl_capab_poll_s {
t_uscalar_t poll_version;
t_uscalar_t poll_flags;
- /* NIC provided information */
+ /* DLD provided information */
uintptr_t poll_tx_handle;
uintptr_t poll_tx;
diff --git a/usr/src/uts/common/sys/dls_impl.h b/usr/src/uts/common/sys/dls_impl.h
index 70de658cc4..69f9b4b3dc 100644
--- a/usr/src/uts/common/sys/dls_impl.h
+++ b/usr/src/uts/common/sys/dls_impl.h
@@ -137,8 +137,10 @@ extern int dls_vlan_walk(int (*)(dls_vlan_t *, void *), void *);
extern void dls_init(void);
extern int dls_fini(void);
-extern boolean_t dls_accept(dls_impl_t *, const uint8_t *);
-extern boolean_t dls_accept_loopback(dls_impl_t *, const uint8_t *);
+extern boolean_t dls_accept(dls_impl_t *, const uint8_t *,
+ dls_rx_t *, void **);
+extern boolean_t dls_accept_loopback(dls_impl_t *, const uint8_t *,
+ dls_rx_t *, void **);
#ifdef __cplusplus
}