]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stream_interface: remove CAP_SPLTCP/CAP_SPLICE flags
authorWilly Tarreau <wtarreau@exceliance.fr>
Thu, 30 Aug 2012 19:23:53 +0000 (21:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 3 Sep 2012 18:47:34 +0000 (20:47 +0200)
These ones are implicitly handled by the connection's data layer, no need
to rely on them anymore and reaching them maintains undesired dependences
on stream-interface.

include/types/stream_interface.h
src/proto_tcp.c
src/session.c
src/stream_interface.c

index edc97d097b4b2e21bf960e6d155bac65b6960f11..8b069c8df64bcbe8d56659cf07d2b38751f53bc3 100644 (file)
@@ -69,7 +69,7 @@ enum {
        SI_FL_ERR        = 0x0002,  /* a non-recoverable error has occurred */
        SI_FL_WAIT_ROOM  = 0x0004,  /* waiting for space to store incoming data */
        SI_FL_WAIT_DATA  = 0x0008,  /* waiting for more data to send */
-       SI_FL_CAP_SPLTCP = 0x0010,  /* splicing possible from/to TCP */
+       /* unused          0x0010 */
        SI_FL_DONT_WAKE  = 0x0020,  /* resync in progress, don't wake up */
        SI_FL_INDEP_STR  = 0x0040,  /* independent streams = don't update rex on write */
        SI_FL_NOLINGER   = 0x0080,  /* may close without lingering. One-shot. */
@@ -77,8 +77,6 @@ enum {
        SI_FL_SRC_ADDR   = 0x1000,  /* get the source ip/port with getsockname */
 };
 
-#define SI_FL_CAP_SPLICE (SI_FL_CAP_SPLTCP)
-
 struct stream_interface;
 
 /* operations available on a stream-interface */
index b793df393b8e583916ff47bb053418ae61513214..7998f400fd70eecd801e95038e2af219cac499da 100644 (file)
@@ -473,8 +473,6 @@ int tcp_connect_server(struct stream_interface *si)
                conn_data_want_send(conn);  /* prepare to send data if any */
 
        si->state = SI_ST_CON;
-       if (conn->data->rcv_pipe && conn->data->snd_pipe)
-               si->flags |= SI_FL_CAP_SPLTCP; /* TCP supports splicing */
        si->exp = tick_add_ifset(now_ms, be->timeout.connect);
 
        return SN_ERR_NONE;  /* connection is OK */
index 07824191f454e3c9ad686c8e37b4a9b225d1e55c..774a8a319683d8a8fefe56d80acf84f7b359d892 100644 (file)
@@ -180,10 +180,6 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
        /* add the various callbacks */
        si_prepare_conn(&s->si[0], l->proto, l->data);
 
-       if ((s->si[0].conn.data->rcv_pipe && s->si[0].conn.data->snd_pipe) &&
-           (addr->ss_family == AF_INET || addr->ss_family == AF_INET6))
-               s->si[0].flags = SI_FL_CAP_SPLTCP; /* TCP/TCPv6 splicing possible */
-
        /* pre-initialize the other side's stream interface to an INIT state. The
         * callbacks will be initialized before attempting to connect.
         */
@@ -540,7 +536,6 @@ static int sess_update_st_con_tcp(struct session *s, struct stream_interface *si
        if (unlikely(si->flags & (SI_FL_EXP|SI_FL_ERR))) {
                si->exp   = TICK_ETERNITY;
                si->state = SI_ST_CER;
-               si->flags &= ~SI_FL_CAP_SPLICE;
                fd_delete(si_fd(si));
 
                conn_data_close(&si->conn);
@@ -567,7 +562,6 @@ static int sess_update_st_con_tcp(struct session *s, struct stream_interface *si
                si_shutw(si);
                si->err_type |= SI_ET_CONN_ABRT;
                si->err_loc  = target_srv(&s->target);
-               si->flags &= ~SI_FL_CAP_SPLICE;
                if (s->srv_error)
                        s->srv_error(s, si);
                return 1;
@@ -1867,7 +1861,8 @@ struct task *process_session(struct task *t)
        if (!(s->req->flags & (CF_KERN_SPLICING|CF_SHUTR)) &&
            s->req->to_forward &&
            (global.tune.options & GTUNE_USE_SPLICE) &&
-           (s->si[0].flags & s->si[1].flags & SI_FL_CAP_SPLICE) &&
+           (s->si[0].conn.data && s->si[0].conn.data->rcv_pipe && s->si[0].conn.data->snd_pipe) &&
+           (s->si[1].conn.data && s->si[1].conn.data->rcv_pipe && s->si[1].conn.data->snd_pipe) &&
            (pipes_used < global.maxpipes) &&
            (((s->fe->options2|s->be->options2) & PR_O2_SPLIC_REQ) ||
             (((s->fe->options2|s->be->options2) & PR_O2_SPLIC_AUT) &&
@@ -2012,7 +2007,8 @@ struct task *process_session(struct task *t)
        if (!(s->rep->flags & (CF_KERN_SPLICING|CF_SHUTR)) &&
            s->rep->to_forward &&
            (global.tune.options & GTUNE_USE_SPLICE) &&
-           (s->si[0].flags & s->si[1].flags & SI_FL_CAP_SPLICE) &&
+           (s->si[0].conn.data && s->si[0].conn.data->rcv_pipe && s->si[0].conn.data->snd_pipe) &&
+           (s->si[1].conn.data && s->si[1].conn.data->rcv_pipe && s->si[1].conn.data->snd_pipe) &&
            (pipes_used < global.maxpipes) &&
            (((s->fe->options2|s->be->options2) & PR_O2_SPLIC_RTR) ||
             (((s->fe->options2|s->be->options2) & PR_O2_SPLIC_AUT) &&
index cb33476ed0cbbcfdafcb1e50e619162c22203967..b26e800b1c76398b133bcb7911d030a8737303b4 100644 (file)
@@ -1019,7 +1019,6 @@ void si_conn_recv_cb(struct connection *conn)
                if (ret < 0) {
                        /* splice not supported on this end, let's disable it */
                        b->flags &= ~CF_KERN_SPLICING;
-                       si->flags &= ~SI_FL_CAP_SPLICE;
                        goto abort_splice;
                }