2 * Copyright (c) 2016-2017 Intel Corporation.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
19 #include <rte_spinlock.h>
21 #include <tle_dring.h>
24 #include "port_bitmap.h"
33 struct tle_pbm use; /* ports in use. */
34 struct tle_stream *streams[MAX_PORT_NUM]; /* port to stream. */
41 uint64_t ol_flags[TLE_VNUM];
42 rte_atomic32_t packet_id[TLE_VNUM];
44 /* used by FE & BE. */
47 struct tle_dev_param prm; /* copy of device parameters. */
48 struct tle_dport *dp[TLE_VNUM]; /* device L4 ports */
52 struct tle_ctx_param prm;
53 uint32_t cycles_ms_shift; /* to convert from cycles to ms */
56 uint32_t nb_free; /* number of free streams. */
57 STAILQ_HEAD(, tle_stream) free;
58 void *buf; /* space allocated for streams */
61 rte_spinlock_t dev_lock;
63 struct tle_pbm use[TLE_VNUM]; /* all ports in use. */
64 struct tle_dev dev[RTE_MAX_ETHPORTS];
68 int (*init_streams)(struct tle_ctx *);
69 void (*fini_streams)(struct tle_ctx *);
70 void (*free_drbs)(struct tle_stream *, struct tle_drb *[], uint32_t);
73 extern struct stream_ops tle_stream_ops[TLE_PROTO_NUM];
75 int stream_fill_ctx(struct tle_ctx *ctx, struct tle_stream *s,
76 const struct sockaddr *laddr, const struct sockaddr *raddr);
78 int stream_clear_ctx(struct tle_ctx *ctx, struct tle_stream *s);
84 #endif /* _UDP_IMPL_H_ */