2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

stream: Eliminate pstream_set_dscp().

This function is really of marginal utility.  This commit drops it and
makes the existing callers instead open a new pstream with the desired
dscp.

The ulterior motive here is that the set_dscp() function that actually sets
the DSCP on a socket really wants to know the address family (AF_INET vs.
AF_INET6).  We could plumb that down through the stream code, and that's
one reasonable option, but I thought that simply eliminating some calls
to set_dscp() where we don't already have the address family handy was
another reasonable way to go.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
This commit is contained in:
Ben Pfaff
2015-02-20 08:44:48 -08:00
parent ee5315b9f9
commit c2e3cbaf7b
10 changed files with 25 additions and 85 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1134,21 +1134,9 @@ jsonrpc_session_set_dscp(struct jsonrpc_session *s,
uint8_t dscp)
{
if (s->dscp != dscp) {
if (s->pstream) {
int error;
pstream_close(s->pstream);
s->pstream = NULL;
error = pstream_set_dscp(s->pstream, dscp);
if (error) {
VLOG_ERR("%s: failed set_dscp %s",
reconnect_get_name(s->reconnect),
ovs_strerror(error));
}
/*
* XXX race window between setting dscp to listening socket
* and accepting socket. accepted socket may have old dscp value.
* Ignore this race window for now.
*/
}
s->dscp = dscp;
jsonrpc_session_force_reconnect(s);
}