summaryrefslogtreecommitdiffstats
path: root/examples/l4fwd/common.h
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2017-03-03 18:40:23 +0000
committerKonstantin Ananyev <konstantin.ananyev@intel.com>2017-03-06 15:06:38 +0000
commit21e7392fca2c430018cf387bb3e368ea4c665446 (patch)
tree82109e1b1af7aa3303d1f9b04c1d063aa3b14873 /examples/l4fwd/common.h
parent9cbfd751b210f03fdb2fcbf8cafe59b9db516295 (diff)
Rewrite accept() code-path and make l4fwd not to close() on FIN immediatelly.
Changes in public API: - removes tle_tcp_stream_synreqs() and tle_tcp_reject() - adds tle_tcp_stream_update_cfg Allocates and fills new stream when final ACK for 3-way handshake is received. Changes in l4fwd sample application: prevents l4fwd to call close() on error event immediately: first try to recv/send remaining data. Change-Id: I8c5b9d365353084083731a4ce582197a8268688f Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'examples/l4fwd/common.h')
-rw-r--r--examples/l4fwd/common.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/l4fwd/common.h b/examples/l4fwd/common.h
index ff8ee7a..8d757f3 100644
--- a/examples/l4fwd/common.h
+++ b/examples/l4fwd/common.h
@@ -619,7 +619,7 @@ netbe_lcore(void)
}
}
-static inline void
+static inline int
netfe_rx_process(__rte_unused uint32_t lcore, struct netfe_stream *fes)
{
uint32_t k, n;
@@ -631,12 +631,12 @@ netfe_rx_process(__rte_unused uint32_t lcore, struct netfe_stream *fes)
if (k == 0) {
tle_event_idle(fes->rxev);
fes->stat.rxev[TLE_SEV_IDLE]++;
- return;
+ return 0;
}
n = tle_stream_recv(fes->s, fes->pbuf.pkt + n, k);
if (n == 0)
- return;
+ return 0;
NETFE_TRACE("%s(%u): tle_%s_stream_recv(%p, %u) returns %u\n",
__func__, lcore, proto_name[fes->proto], fes->s, k, n);
@@ -648,7 +648,7 @@ netfe_rx_process(__rte_unused uint32_t lcore, struct netfe_stream *fes)
if (fes->op == RXONLY)
fes->stat.rxb += pkt_buf_empty(&fes->pbuf);
/* mark stream as writable */
- else if (k == RTE_DIM(fes->pbuf.pkt)) {
+ else if (k == RTE_DIM(fes->pbuf.pkt)) {
if (fes->op == RXTX) {
tle_event_active(fes->txev, TLE_SEV_UP);
fes->stat.txev[TLE_SEV_UP]++;
@@ -657,6 +657,8 @@ netfe_rx_process(__rte_unused uint32_t lcore, struct netfe_stream *fes)
fes->stat.txev[TLE_SEV_UP]++;
}
}
+
+ return n;
}
#endif /* COMMON_H_ */