Skip to content

Commit da14ceb

Browse files
author
Eric Cheng
committed
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
6498311 Crossbow - Network Virtualization and Resource Management 6402493 DLPI provider loopback behavior should be improved 6453165 move mac capabs definitions outside mac.h 6338667 Need ability to use NAT for non-global zones 6692884 several threads hung due to deadlock scenario between aggr and mac 6768302 dls: soft_ring_bind/unbind race can panic in thread_affinity_set with cpu_id == -1 6635849 race between lacp_xmit_sm() and aggr_m_stop() ends in panic 6742712 potential message double free in the aggr driver 6754299 a potential race between aggr_m_tx() and aggr_port_delete() 6485324 mi_data_lock recursively held when enabling promiscuous mode on an aggregation 6442559 Forwarding perf bottleneck due to mac_rx() calls 6505462 assertion failure after removing a port from a snooped aggregation 6716664 need to add src/dst IP address to soft ring fanout --HG-- rename : usr/src/uts/common/io/dls/dls_soft_ring.c => usr/src/uts/common/io/mac/mac_soft_ring.c rename : usr/src/uts/common/inet/ip/ip_cksum.c => usr/src/uts/common/os/ip_cksum.c rename : usr/src/uts/common/inet/sctp_crc32.c => usr/src/uts/common/os/sctp_crc32.c rename : usr/src/uts/common/sys/dls_soft_ring.h => usr/src/uts/common/sys/mac_soft_ring.h
1 parent 0336168 commit da14ceb

File tree

326 files changed

+55725
-23539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+55725
-23539
lines changed

usr/src/cmd/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ COMMON_SUBDIRS= \
161161
file \
162162
filebench \
163163
find \
164+
flowadm \
164165
fm \
165166
fmli \
166167
fmt \
@@ -582,6 +583,7 @@ MSGSUBDIRS= \
582583
file \
583584
filesync \
584585
find \
586+
flowadm \
585587
fm \
586588
fold \
587589
fs.d \

usr/src/cmd/Makefile.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ ROOTETCTSOL= $(ROOTETCSECURITY)/tsol
6666
ROOTETCSECLIB= $(ROOTETCSECURITY)/lib
6767
ROOTETCZONES= $(ROOTETC)/zones
6868

69+
ROOTETCINET= $(ROOT)/etc/inet
6970
ROOTCCSBIN= $(ROOT)/usr/ccs/bin
7071
ROOTCCSBIN64= $(ROOTCCSBIN)/$(MACH64)
7172
ROOTCCSBINLINKDIR= $(ROOT)/../../bin
@@ -316,6 +317,9 @@ $(ROOTUSRSBIN64)/%: %
316317
$(ROOTETC)/%: %
317318
$(INS.file)
318319

320+
$(ROOTETCINET)/%: %
321+
$(INS.file)
322+
319323
$(ROOTETCDEFAULT)/%: %.dfl
320324
$(INS.rename)
321325

usr/src/cmd/acctadm/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
# CDDL HEADER END
2020
#
2121
#
22-
#ident "%Z%%M% %I% %E% SMI"
23-
#
2422
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2523
# Use is subject to license terms.
2624
#
@@ -37,7 +35,7 @@ include ../Makefile.cmd
3735
ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
3836

3937
CFLAGS += $(CCVERBOSE)
40-
LDLIBS += -lexacct -lscf -lsecdb
38+
LDLIBS += -lexacct -lscf -lsecdb -ldladm
4139
POFILE = acctadm.po
4240
XGETFLAGS = -a -x acctadm.xcl
4341
FILEMODE = 0555

usr/src/cmd/acctadm/acctadm.xcl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
# CDDL HEADER START
33
#
44
# The contents of this file are subject to the terms of the
5-
# Common Development and Distribution License, Version 1.0 only
6-
# (the "License"). You may not use this file except in compliance
7-
# with the License.
5+
# Common Development and Distribution License (the "License").
6+
# You may not use this file except in compliance with the License.
87
#
98
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
109
# or http://www.opensolaris.org/os/licensing.
@@ -19,13 +18,19 @@
1918
#
2019
# CDDL HEADER END
2120
#
21+
#
22+
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23+
# Use is subject to license terms.
24+
#
25+
2226
msgid "ruxf:e:d:"
2327
msgid "/etc/acctadm.conf"
2428
msgid ""
2529
msgid "process"
2630
msgid "proc"
2731
msgid "task"
2832
msgid "flow"
33+
msgid "net"
2934
msgid "no"
3035
msgid "none"
3136
msgid "yes"
@@ -41,6 +46,10 @@ msgid "ACCTADM_FLOW_ENABLE"
4146
msgid "ACCTADM_FLOW_FILE"
4247
msgid "ACCTADM_FLOW_TRACKED"
4348
msgid "ACCTADM_FLOW_UNTRACKED"
49+
msgid "ACCTADM_NET_ENABLE"
50+
msgid "ACCTADM_NET_FILE"
51+
msgid "ACCTADM_NET_TRACKED"
52+
msgid "ACCTADM_NET_UNTRACKED"
4453
msgid "r+"
4554
msgid "r"
4655
msgid " %[^=]=%s \n%n"

usr/src/cmd/acctadm/aconf.c

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@
2323
* Use is subject to license terms.
2424
*/
2525

26-
#pragma ident "%Z%%M% %I% %E% SMI"
27-
2826
#include <sys/types.h>
2927
#include <sys/acctctl.h>
3028
#include <unistd.h>
3129
#include <string.h>
3230
#include <stdlib.h>
3331
#include <errno.h>
3432
#include <limits.h>
33+
#include <libdllink.h>
3534
#include <libscf.h>
3635
#include <pwd.h>
3736
#include <auth_attr.h>
@@ -47,6 +46,7 @@
4746
#define FMRI_FLOW_ACCT "svc:/system/extended-accounting:flow"
4847
#define FMRI_PROC_ACCT "svc:/system/extended-accounting:process"
4948
#define FMRI_TASK_ACCT "svc:/system/extended-accounting:task"
49+
#define FMRI_NET_ACCT "svc:/system/extended-accounting:net"
5050

5151
#define NELEM(x) (sizeof (x)) / (sizeof (x[0]))
5252

@@ -134,13 +134,14 @@ aconf_setup(const char *fmri)
134134
}
135135

136136
/*
137-
* Flow accounting is not available in non-global zones and
137+
* Net/Flow accounting is not available in non-global zones and
138138
* the service instance should therefore never be 'enabled' in
139139
* non-global zones. This is enforced by acctadm(1M), but there is
140140
* nothing that prevents someone from calling svcadm enable directly,
141141
* so we handle that case here by disabling the instance.
142142
*/
143-
if (type == AC_FLOW && getzoneid() != GLOBAL_ZONEID) {
143+
if ((type == AC_FLOW || type == AC_NET) &&
144+
getzoneid() != GLOBAL_ZONEID) {
144145
(void) smf_disable_instance(fmri, 0);
145146
warn(gettext("%s accounting cannot be configured in "
146147
"non-global zones\n"), ac_type_name(type));
@@ -210,6 +211,19 @@ aconf_setup(const char *fmri)
210211
ret = SMF_EXIT_ERR_FATAL;
211212
}
212213
(void) priv_set(PRIV_OFF, PRIV_EFFECTIVE, PRIV_SYS_ACCT, NULL);
214+
215+
if (state == AC_ON && type == AC_NET) {
216+
/*
217+
* Start logging.
218+
*/
219+
(void) priv_set(PRIV_ON, PRIV_EFFECTIVE, PRIV_SYS_DL_CONFIG,
220+
NULL);
221+
(void) dladm_start_usagelog(strncmp(tracked, "basic",
222+
strlen("basic")) == 0 ? DLADM_LOGTYPE_LINK :
223+
DLADM_LOGTYPE_FLOW, 20);
224+
(void) priv_set(PRIV_OFF, PRIV_EFFECTIVE, PRIV_SYS_DL_CONFIG,
225+
NULL);
226+
}
213227
out:
214228
aconf_scf_fini();
215229
return (ret);
@@ -219,7 +233,7 @@ void
219233
aconf_print(FILE *fp, int types)
220234
{
221235
acctconf_t ac;
222-
int print_order[] = { AC_TASK, AC_PROC, AC_FLOW };
236+
int print_order[] = { AC_TASK, AC_PROC, AC_FLOW, AC_NET };
223237
int i;
224238

225239
for (i = 0; i < NELEM(print_order); i++) {
@@ -279,6 +293,21 @@ aconf_print_type(acctconf_t *acp, FILE *fp, int type)
279293
gettext(" Untracked flow resources: %s\n"),
280294
acp->untracked);
281295
break;
296+
case AC_NET:
297+
(void) fprintf(fp,
298+
gettext(" Net accounting: %s\n"),
299+
acp->state == AC_ON ?
300+
gettext("active") : gettext("inactive"));
301+
(void) fprintf(fp,
302+
gettext(" Net accounting file: %s\n"),
303+
acp->file);
304+
(void) fprintf(fp,
305+
gettext(" Tracked net resources: %s\n"),
306+
acp->tracked);
307+
(void) fprintf(fp,
308+
gettext(" Untracked net resources: %s\n"),
309+
acp->untracked);
310+
break;
282311
}
283312
}
284313

@@ -369,6 +398,8 @@ aconf_type2fmri(int type)
369398
return (FMRI_TASK_ACCT);
370399
case AC_FLOW:
371400
return (FMRI_FLOW_ACCT);
401+
case AC_NET:
402+
return (FMRI_NET_ACCT);
372403
default:
373404
die(gettext("invalid type %d\n"), type);
374405
}
@@ -385,6 +416,8 @@ aconf_fmri2type(const char *fmri)
385416
return (AC_TASK);
386417
else if (strcmp(fmri, FMRI_FLOW_ACCT) == 0)
387418
return (AC_FLOW);
419+
else if (strcmp(fmri, FMRI_NET_ACCT) == 0)
420+
return (AC_NET);
388421
else
389422
return (-1);
390423
}

usr/src/cmd/acctadm/extended-accounting.xml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
2424
CDDL HEADER END
2525
26-
ident "%Z%%M% %I% %E% SMI"
27-
2826
NOTE: This service manifest is not editable; its contents will
2927
be overwritten by package or patch operations, including
3028
operating system upgrade. Make customizations in a different
@@ -175,6 +173,43 @@
175173
</documentation>
176174
</template>
177175
</instance>
176+
177+
<instance name='net' enabled='false'>
178+
179+
<property_group name='general' type='framework'>
180+
<propval name='action_authorization' type='astring'
181+
value='solaris.smf.manage.extended-accounting.net' />
182+
<propval name='value_authorization' type='astring'
183+
value='solaris.smf.manage.extended-accounting.net' />
184+
</property_group>
185+
186+
<property_group name='config' type='application'>
187+
<propval name='value_authorization' type='astring'
188+
value='solaris.smf.value.extended-accounting.net' />
189+
<propval name='enabled' type='boolean'
190+
value='false' />
191+
<propval name='file' type='astring'
192+
value='none' />
193+
<propval name='tracked' type='astring'
194+
value='none' />
195+
<propval name='untracked' type='astring'
196+
value='extended' />
197+
</property_group>
198+
199+
<template>
200+
<common_name>
201+
<loctext xml:lang='C'>
202+
configure net extended accounting
203+
</loctext>
204+
</common_name>
205+
206+
<documentation>
207+
<manpage
208+
title='acctadm' section='1M'
209+
manpath='/usr/share/man' />
210+
</documentation>
211+
</template>
212+
</instance>
178213

179214
<stability value='Unstable' />
180215
</service>

0 commit comments

Comments
 (0)