projects
/
cascardo
/
ovs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement Vacancy Events for OFPMP_TABLE_DESC.
[cascardo/ovs.git]
/
ofproto
/
pktbuf.c
diff --git
a/ofproto/pktbuf.c
b/ofproto/pktbuf.c
index
38ec348
..
def0c92
100644
(file)
--- a/
ofproto/pktbuf.c
+++ b/
ofproto/pktbuf.c
@@
-20,11
+20,11
@@
#include <stdlib.h>
#include "coverage.h"
#include "ofp-util.h"
#include <stdlib.h>
#include "coverage.h"
#include "ofp-util.h"
-#include "
ofpbuf
.h"
+#include "
dp-packet
.h"
#include "timeval.h"
#include "util.h"
#include "timeval.h"
#include "util.h"
-#include "vconn.h"
-#include "vlog.h"
+#include "
openvswitch/
vconn.h"
+#include "
openvswitch/
vlog.h"
VLOG_DEFINE_THIS_MODULE(pktbuf);
VLOG_DEFINE_THIS_MODULE(pktbuf);
@@
-48,7
+48,7
@@
COVERAGE_DEFINE(pktbuf_reuse_error);
#define OVERWRITE_MSECS 5000
struct packet {
#define OVERWRITE_MSECS 5000
struct packet {
- struct
ofpbuf
*buffer;
+ struct
dp_packet
*buffer;
uint32_t cookie;
long long int timeout;
ofp_port_t in_port;
uint32_t cookie;
long long int timeout;
ofp_port_t in_port;
@@
-79,7
+79,7
@@
pktbuf_destroy(struct pktbuf *pb)
size_t i;
for (i = 0; i < PKTBUF_CNT; i++) {
size_t i;
for (i = 0; i < PKTBUF_CNT; i++) {
-
ofpbuf
_delete(pb->packets[i].buffer);
+
dp_packet
_delete(pb->packets[i].buffer);
}
free(pb);
}
}
free(pb);
}
@@
-112,7
+112,7
@@
pktbuf_save(struct pktbuf *pb, const void *buffer, size_t buffer_size,
if (time_msec() < p->timeout) {
return UINT32_MAX;
}
if (time_msec() < p->timeout) {
return UINT32_MAX;
}
-
ofpbuf
_delete(p->buffer);
+
dp_packet
_delete(p->buffer);
}
/* Don't use maximum cookie value since all-1-bits ID is special. */
}
/* Don't use maximum cookie value since all-1-bits ID is special. */
@@
-121,7
+121,7
@@
pktbuf_save(struct pktbuf *pb, const void *buffer, size_t buffer_size,
}
/* Use 2 bytes of headroom to 32-bit align the L3 header. */
}
/* Use 2 bytes of headroom to 32-bit align the L3 header. */
- p->buffer =
ofpbuf
_clone_data_with_headroom(buffer, buffer_size, 2);
+ p->buffer =
dp_packet
_clone_data_with_headroom(buffer, buffer_size, 2);
p->timeout = time_msec() + OVERWRITE_MSECS;
p->in_port = in_port;
p->timeout = time_msec() + OVERWRITE_MSECS;
p->in_port = in_port;
@@
-169,7
+169,7
@@
pktbuf_get_null(void)
*
* On failure, stores NULL in in '*bufferp' and UINT16_MAX in '*in_port'. */
enum ofperr
*
* On failure, stores NULL in in '*bufferp' and UINT16_MAX in '*in_port'. */
enum ofperr
-pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct
ofpbuf
**bufferp,
+pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct
dp_packet
**bufferp,
ofp_port_t *in_port)
{
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 20);
ofp_port_t *in_port)
{
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 20);
@@
-184,12
+184,13
@@
pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct ofpbuf **bufferp,
if (!pb) {
VLOG_WARN_RL(&rl, "attempt to send buffered packet via connection "
"without buffers");
if (!pb) {
VLOG_WARN_RL(&rl, "attempt to send buffered packet via connection "
"without buffers");
- return OFPERR_OFPBRC_BUFFER_UNKNOWN;
+ error = OFPERR_OFPBRC_BUFFER_UNKNOWN;
+ goto error;
}
p = &pb->packets[id & PKTBUF_MASK];
if (p->cookie == id >> PKTBUF_BITS) {
}
p = &pb->packets[id & PKTBUF_MASK];
if (p->cookie == id >> PKTBUF_BITS) {
- struct
ofpbuf
*buffer = p->buffer;
+ struct
dp_packet
*buffer = p->buffer;
if (buffer) {
*bufferp = buffer;
if (in_port) {
if (buffer) {
*bufferp = buffer;
if (in_port) {
@@
-227,7
+228,7
@@
pktbuf_discard(struct pktbuf *pb, uint32_t id)
{
struct packet *p = &pb->packets[id & PKTBUF_MASK];
if (p->cookie == id >> PKTBUF_BITS) {
{
struct packet *p = &pb->packets[id & PKTBUF_MASK];
if (p->cookie == id >> PKTBUF_BITS) {
-
ofpbuf
_delete(p->buffer);
+
dp_packet
_delete(p->buffer);
p->buffer = NULL;
}
}
p->buffer = NULL;
}
}