summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rw-r--r--usr/src/cmd/dladm/dladm.c68
-rw-r--r--usr/src/lib/Makefile2
-rw-r--r--usr/src/lib/liblaadm/common/liblaadm.c6
-rw-r--r--usr/src/lib/libmacadm/Makefile.com2
-rw-r--r--usr/src/lib/libmacadm/common/libmacadm.c61
-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
-rw-r--r--usr/src/uts/sparc/Makefile2
15 files changed, 178 insertions, 81 deletions
diff --git a/usr/src/cmd/dladm/dladm.c b/usr/src/cmd/dladm/dladm.c
index f74eab440c..a6787f235a 100644
--- a/usr/src/cmd/dladm/dladm.c
+++ b/usr/src/cmd/dladm/dladm.c
@@ -38,13 +38,13 @@
#include <strings.h>
#include <getopt.h>
#include <unistd.h>
+#include <priv.h>
#include <libintl.h>
#include <libdlpi.h>
#include <libdladm.h>
#include <liblaadm.h>
#include <libmacadm.h>
-#define AGGR_DRIVER "aggr"
#define AGGR_DEV "aggr0"
#define MAXPORT 256
#define DUMP_LACP_FORMAT " %-9s %-8s %-7s %-12s " \
@@ -198,6 +198,13 @@ main(int argc, char *argv[])
if (argc < 2)
usage();
+ if (!priv_ineffect(PRIV_SYS_NET_CONFIG) ||
+ !priv_ineffect(PRIV_NET_RAWACCESS)) {
+ (void) fprintf(stderr,
+ gettext("%s: insufficient privileges\n"), progname);
+ exit(1);
+ }
+
for (i = 0; i < sizeof (cmds) / sizeof (cmds[0]); i++) {
cmdp = &cmds[i];
if (strcmp(argv[1], cmdp->c_name) == 0) {
@@ -1207,10 +1214,6 @@ show_dev(void *arg, const char *dev)
{
show_mac_state_t *state = (show_mac_state_t *)arg;
- /* aggregations are already managed by a set of subcommands */
- if (strcmp(dev, AGGR_DEV) == 0)
- return;
-
(void) printf("%s", dev);
if (!state->ms_parseable) {
@@ -1235,10 +1238,6 @@ show_dev_stats(void *arg, const char *dev)
show_mac_state_t *state = (show_mac_state_t *)arg;
pktsum_t stats, diff_stats;
- /* aggregations are already managed by a set of subcommands */
- if (strcmp(dev, AGGR_DEV) == 0)
- return;
-
if (state->ms_firstonly) {
if (state->ms_donefirst)
return;
@@ -1568,12 +1567,25 @@ do_show_dev(int argc, char *argv[])
else if (optind != argc)
usage();
- if ((dev != NULL) && (strcmp(dev, AGGR_DEV) == 0)) {
- /* aggregations are already managed by a set of subcommands */
- (void) fprintf(stderr,
- gettext("%s: non-existant device '%s'\n"),
- progname, dev);
- exit(1);
+ if (dev != NULL) {
+ int index;
+ char drv[LIFNAMSIZ];
+ dladm_attr_t dlattr;
+ boolean_t legacy;
+
+ /*
+ * Check for invalid devices.
+ * aggregations and vlans are not considered devices.
+ */
+ if (strncmp(dev, "aggr", 4) == 0 ||
+ dlpi_if_parse(dev, drv, &index) < 0 ||
+ index >= 1000 ||
+ get_if_info(dev, &dlattr, &legacy) < 0) {
+ (void) fprintf(stderr,
+ gettext("%s: invalid device '%s'\n"),
+ progname, dev);
+ exit(1);
+ }
}
if (s_arg) {
@@ -1714,6 +1726,16 @@ stats_diff(pktsum_t *s1, pktsum_t *s2, pktsum_t *s3)
s1->oerrors = s2->oerrors - s3->oerrors;
}
+/*
+ * In the following routines, we do the first kstat_lookup()
+ * assuming that the device is gldv3-based and that the kstat
+ * name is of the format <driver_name><instance>/<port>. If the
+ * lookup fails, we redo the kstat_lookup() using the kstat name
+ * <driver_name><instance>. This second lookup is needed for
+ * getting kstats from legacy devices. This can fail too if the
+ * device is not attached or the device is legacy and doesn't
+ * export the kstats we need.
+ */
static void
get_stats(char *module, int instance, char *name, pktsum_t *stats)
{
@@ -1727,7 +1749,9 @@ get_stats(char *module, int instance, char *name, pktsum_t *stats)
return;
}
- if ((ksp = kstat_lookup(kcp, module, instance, name)) == NULL) {
+ if ((ksp = kstat_lookup(kcp, module, instance, name)) == NULL &&
+ (module == NULL ||
+ (ksp = kstat_lookup(kcp, NULL, -1, module)) == NULL)) {
/*
* The kstat query could fail if the underlying MAC
* driver was already detached.
@@ -1807,7 +1831,9 @@ mac_ifspeed(const char *dev, uint_t port)
}
(void) snprintf(name, MAXNAMELEN - 1, "%s/%u", dev, port);
- if ((ksp = kstat_lookup(kcp, (char *)dev, 0, name)) == NULL) {
+ if ((ksp = kstat_lookup(kcp, (char *)dev, -1, name)) == NULL &&
+ (ksp = kstat_lookup(kcp, NULL, -1, (char *)dev)) == NULL) {
+
/*
* The kstat query could fail if the underlying MAC
* driver was already detached.
@@ -1851,7 +1877,9 @@ mac_link_state(const char *dev, uint_t port)
}
(void) snprintf(name, MAXNAMELEN - 1, "%s/%u", dev, port);
- if ((ksp = kstat_lookup(kcp, (char *)dev, 0, name)) == NULL) {
+
+ if ((ksp = kstat_lookup(kcp, (char *)dev, -1, name)) == NULL &&
+ (ksp = kstat_lookup(kcp, NULL, -1, (char *)dev)) == NULL) {
/*
* The kstat query could fail if the underlying MAC
* driver was already detached.
@@ -1905,7 +1933,9 @@ mac_link_duplex(const char *dev, uint_t port)
}
(void) snprintf(name, MAXNAMELEN - 1, "%s/%u", dev, port);
- if ((ksp = kstat_lookup(kcp, (char *)dev, 0, name)) == NULL) {
+
+ if ((ksp = kstat_lookup(kcp, (char *)dev, -1, name)) == NULL &&
+ (ksp = kstat_lookup(kcp, NULL, -1, (char *)dev)) == NULL) {
/*
* The kstat query could fail if the underlying MAC
* driver was already detached.
diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile
index 758c917dab..e32be73554 100644
--- a/usr/src/lib/Makefile
+++ b/usr/src/lib/Makefile
@@ -401,7 +401,7 @@ libefi: libuuid
libelfsign: libike libcryptoutil pkcs11
libinetcfg: libnsl libsocket libdevinfo
libnsl: libmd5 libscf
-libmacadm: libdevinfo libdladm libdlpi
+libmacadm: libdevinfo
libuuid: libsocket
libinetutil: libsocket
libsecdb: libcmd libnsl
diff --git a/usr/src/lib/liblaadm/common/liblaadm.c b/usr/src/lib/liblaadm/common/liblaadm.c
index 6add61fcb8..11004c78ea 100644
--- a/usr/src/lib/liblaadm/common/liblaadm.c
+++ b/usr/src/lib/liblaadm/common/liblaadm.c
@@ -1237,6 +1237,12 @@ laadm_str_to_mac_addr(const char *str, boolean_t *mac_fixed, uchar_t *mac_addr)
return (B_FALSE);
}
+ if ((bcmp(zero_mac, conv_str, ETHERADDRL) == 0) ||
+ (conv_str[0] & 0x01)) {
+ free(conv_str);
+ return (B_FALSE);
+ }
+
bcopy(conv_str, mac_addr, ETHERADDRL);
free(conv_str);
diff --git a/usr/src/lib/libmacadm/Makefile.com b/usr/src/lib/libmacadm/Makefile.com
index b3d7635878..95e9cf09f4 100644
--- a/usr/src/lib/libmacadm/Makefile.com
+++ b/usr/src/lib/libmacadm/Makefile.com
@@ -37,7 +37,7 @@ include ../../Makefile.rootfs
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -ldevinfo -ldladm -ldlpi -lc
+LDLIBS += -ldevinfo -lc
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
SRCDIR = ../common
diff --git a/usr/src/lib/libmacadm/common/libmacadm.c b/usr/src/lib/libmacadm/common/libmacadm.c
index 053d1c5011..9e6061099d 100644
--- a/usr/src/lib/libmacadm/common/libmacadm.c
+++ b/usr/src/lib/libmacadm/common/libmacadm.c
@@ -30,11 +30,11 @@
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
#include <stropts.h>
#include <sys/dld.h>
#include <libdevinfo.h>
-#include <libdladm.h>
-#include <libdlpi.h>
#define _KERNEL
#include <sys/sysmacros.h>
@@ -48,9 +48,13 @@
*
*/
+typedef struct macadm_dev {
+ char md_name[MAXNAMELEN];
+ struct macadm_dev *md_next;
+} macadm_dev_t;
+
typedef struct macadm_walk {
- void *mw_arg;
- void (*mw_fn)(void *, const char *);
+ macadm_dev_t *mw_dev_list;
} macadm_walk_t;
/*
@@ -61,28 +65,36 @@ static int
i_macadm_apply(di_node_t node, di_minor_t minor, void *arg)
{
macadm_walk_t *mwp = arg;
+ macadm_dev_t *mdp = mwp->mw_dev_list;
+ macadm_dev_t **lastp = &mwp->mw_dev_list;
char dev[MAXNAMELEN];
- dladm_attr_t dlattr;
- int fd;
(void) snprintf(dev, MAXNAMELEN, "%s%d",
di_driver_name(node), di_instance(node));
/*
- * We need to be able to report devices that are
- * reported by the walker, but have not yet attached
- * to the system. Attempting to opening them will
- * cause them to temporarely attach and be known
- * by dld.
+ * Skip aggregations.
*/
- if ((fd = dlpi_open(dev)) == -1 && errno != EPERM)
+ if (strcmp("aggr", di_driver_name(node)) == 0)
+ return (DI_WALK_CONTINUE);
+
+ while (mdp) {
+ /*
+ * Skip duplicates.
+ */
+ if (strcmp(mdp->md_name, dev) == 0)
+ return (DI_WALK_CONTINUE);
+
+ lastp = &mdp->md_next;
+ mdp = mdp->md_next;
+ }
+
+ if ((mdp = malloc(sizeof (*mdp))) == NULL)
return (DI_WALK_CONTINUE);
- if (fd != 0)
- (void) dlpi_close(fd);
- /* invoke callback only for non-legacy devices */
- if (dladm_info(dev, &dlattr) == 0)
- mwp->mw_fn(mwp->mw_arg, dev);
+ (void) strlcpy(mdp->md_name, dev, MAXNAMELEN);
+ mdp->md_next = NULL;
+ *lastp = mdp;
return (DI_WALK_CONTINUE);
}
@@ -96,7 +108,8 @@ macadm_walk(void (*fn)(void *, const char *), void *arg,
{
di_node_t root;
macadm_walk_t mw;
- uint_t flags;
+ macadm_dev_t *mdp;
+ uint_t flags;
if (use_cache) {
flags = DINFOCACHE;
@@ -107,12 +120,18 @@ macadm_walk(void (*fn)(void *, const char *), void *arg,
if ((root = di_init("/", flags)) == DI_NODE_NIL) {
return (-1);
}
+ mw.mw_dev_list = NULL;
- mw.mw_fn = fn;
- mw.mw_arg = arg;
+ (void) di_walk_minor(root, DDI_NT_NET, DI_CHECK_ALIAS, &mw,
+ i_macadm_apply);
- (void) di_walk_minor(root, DDI_NT_NET, 0, &mw, i_macadm_apply);
di_fini(root);
+ mdp = mw.mw_dev_list;
+ while (mdp) {
+ (*fn)(arg, mdp->md_name);
+ mdp = mdp->md_next;
+ }
+
return (0);
}
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
}
diff --git a/usr/src/uts/sparc/Makefile b/usr/src/uts/sparc/Makefile
index 4ce7d05c72..60dab88132 100644
--- a/usr/src/uts/sparc/Makefile
+++ b/usr/src/uts/sparc/Makefile
@@ -37,7 +37,7 @@ UTSBASE = ..
include Makefile.sparc
LINT_LIBS = $(LINT_LIB) $(GEN_LINT_LIB) \
- $(LINT_KMODLIBS:%=$(LINT_LIB_DIR)/llib-l%.ln)
+ $(LINT_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln)
# EXPORT DELETE START
LINT_LIBS += $(SVVS_KMODS:%=$(LINT_LIB_DIR)/llib-l%.ln)