aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRichard Scheffenegger <rscheff@FreeBSD.org>2020-10-24 21:07:13 +0000
committerRichard Scheffenegger <rscheff@FreeBSD.org>2020-10-24 21:07:13 +0000
commit4dfbcffbb90621d2cdc3ce15fd8709837d927aaf (patch)
tree887a3e818a08a84d26e773f4279c9825ef393956 /usr.bin
parent8b220f8915167866854ff59a106a926e8a84d824 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/iscsictl/iscsi.conf.57
-rw-r--r--usr.bin/iscsictl/iscsictl.c5
-rw-r--r--usr.bin/iscsictl/iscsictl.h1
-rw-r--r--usr.bin/iscsictl/parse.y25
-rw-r--r--usr.bin/iscsictl/token.l1
5 files changed, 39 insertions, 0 deletions
diff --git a/usr.bin/iscsictl/iscsi.conf.5 b/usr.bin/iscsictl/iscsi.conf.5
index f8b4bca4a4c9c..8b2c08cb47a00 100644
--- a/usr.bin/iscsictl/iscsi.conf.5
+++ b/usr.bin/iscsictl/iscsi.conf.5
@@ -155,6 +155,13 @@ and
codepoints.
Default is no specified dscp codepoint, which means the default
of the outgoing interface is used.
+.It Cm pcp
+The 802.1Q Priority CodePoint used for sending packets.
+The PCP can be set to a value in the range between
+.Qq Ar 0
+to
+.Qq Ar 7 .
+When omitted, the default for the outgoing interface is used.
.El
.Sh FILES
.Bl -tag -width indent
diff --git a/usr.bin/iscsictl/iscsictl.c b/usr.bin/iscsictl/iscsictl.c
index fa5754d3581f1..de7725401dcfc 100644
--- a/usr.bin/iscsictl/iscsictl.c
+++ b/usr.bin/iscsictl/iscsictl.c
@@ -88,6 +88,7 @@ target_new(struct conf *conf)
xo_err(1, "calloc");
targ->t_conf = conf;
targ->t_dscp = -1;
+ targ->t_pcp = -1;
TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next);
return (targ);
@@ -360,6 +361,7 @@ conf_from_target(struct iscsi_session_conf *conf,
else
conf->isc_data_digest = ISCSI_DIGEST_NONE;
conf->isc_dscp = targ->t_dscp;
+ conf->isc_pcp = targ->t_pcp;
}
static int
@@ -540,6 +542,9 @@ kernel_list(int iscsi_fd, const struct target *targ __unused,
if (conf->isc_dscp != -1)
xo_emit("{L:/%-26s}{V:dscp/0x%02x}\n",
"Target DSCP:", conf->isc_dscp);
+ if (conf->isc_pcp != -1)
+ xo_emit("{L:/%-26s}{V:pcp/0x%02x}\n",
+ "Target PCP:", conf->isc_pcp);
xo_close_container("target");
xo_open_container("auth");
diff --git a/usr.bin/iscsictl/iscsictl.h b/usr.bin/iscsictl/iscsictl.h
index d5e2fd25c218c..9718581c06d65 100644
--- a/usr.bin/iscsictl/iscsictl.h
+++ b/usr.bin/iscsictl/iscsictl.h
@@ -79,6 +79,7 @@ struct target {
int t_enable;
int t_protocol;
int t_dscp;
+ int t_pcp;
char *t_offload;
char *t_user;
char *t_secret;
diff --git a/usr.bin/iscsictl/parse.y b/usr.bin/iscsictl/parse.y
index 9e4a28b50fed2..e28c8e82a115c 100644
--- a/usr.bin/iscsictl/parse.y
+++ b/usr.bin/iscsictl/parse.y
@@ -133,6 +133,8 @@ target_entry:
ignored
|
dscp
+ |
+ pcp
;
target_name: TARGET_NAME EQUALS STR
@@ -306,6 +308,8 @@ dscp: DSCP EQUALS STR
{
uint64_t tmp;
+ if (target->t_dscp != -1)
+ xo_errx(1, "duplicated dscp at line %d", lineno);
if (strcmp($3, "0x") == 0) {
tmp = strtol($3 + 2, NULL, 16);
} else if (expand_number($3, &tmp) != 0) {
@@ -344,6 +348,27 @@ dscp: DSCP EQUALS STR
| DSCP EQUALS AF43 { target->t_dscp = IPTOS_DSCP_AF43 >> 2 ; }
;
+pcp: PCP EQUALS STR
+ {
+ uint64_t tmp;
+
+ if (target->t_pcp != -1)
+ xo_errx(1, "duplicated pcp at line %d", lineno);
+
+ if (expand_number($3, &tmp) != 0) {
+ yyerror("invalid numeric value");
+ free($3);
+ return(1);
+ }
+ if (!((tmp >=0) && (tmp <= 7))) {
+ yyerror("invalid pcp value");
+ return(1);
+ }
+
+ target->t_pcp = tmp;
+ }
+ ;
+
%%
void
diff --git a/usr.bin/iscsictl/token.l b/usr.bin/iscsictl/token.l
index 9f6a0d707fb0d..d3e5f25d21c14 100644
--- a/usr.bin/iscsictl/token.l
+++ b/usr.bin/iscsictl/token.l
@@ -69,6 +69,7 @@ protocol { return PROTOCOL; }
offload { return OFFLOAD; }
port { return IGNORED; }
dscp { return DSCP; }
+pcp { return PCP; }
MaxConnections { return IGNORED; }
TargetAlias { return IGNORED; }
TargetPortalGroupTag { return IGNORED; }