Skip to content

Commit

Permalink
Fix build with DPDK
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Jan 14, 2025
1 parent b914b72 commit 0ad3d92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/click/packet.hh
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ class Packet { public:
uint32_t length, uint32_t tailroom, bool clear = true) CLICK_WARN_UNUSED_RESULT;
static inline WritablePacket *make(const void *data, uint32_t length) CLICK_WARN_UNUSED_RESULT;
static inline WritablePacket *make(uint32_t length) CLICK_WARN_UNUSED_RESULT;
#if HAVE_DPDK
static WritablePacket *make_dpdk_packet(uint32_t headroom,
uint32_t length, uint32_t tailroom, bool clear) CLICK_WARN_UNUSED_RESULT;
#endif
static WritablePacket *make_similar(Packet* original, uint32_t length) CLICK_WARN_UNUSED_RESULT;
#if CLICK_LINUXMODULE
static Packet *make(struct sk_buff *skb) CLICK_WARN_UNUSED_RESULT;
Expand Down
2 changes: 2 additions & 0 deletions lib/fromfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ FromFile::get_string(size_t size, ErrorHandler *errh)
Packet *
FromFile::get_packet(size_t size, uint32_t sec, uint32_t subsec, ErrorHandler *errh)
{
#if HAVE_DPDK
if (_dpdk) {
WritablePacket *p = Packet::make_dpdk_packet(0, size, 0, 0);
//click_chatter("P %p, %d %d %d %d", p, p->length(), p->buffer_length(), p->headroom(), p->tailroom());
Expand All @@ -604,6 +605,7 @@ FromFile::get_packet(size_t size, uint32_t sec, uint32_t subsec, ErrorHandler *e
return p;
}
}
#endif
#if CLICK_PACKET_USE_DPDK
#else
if (_pos + size <= _len) {
Expand Down
4 changes: 2 additions & 2 deletions lib/packet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ void WritablePacket::pool_transfer(int from, int to) {
(void)to;
}


#if HAVE_DPK
/**
* @brief Make a Packet with a DPDK-backed buffer
*
Expand Down Expand Up @@ -881,7 +881,7 @@ Packet::make_dpdk_packet(uint32_t headroom, uint32_t length, uint32_t tailroom,
p->clear_annotations();
return p;
}

#endif


/** @brief Create and return a new packet.
Expand Down

0 comments on commit 0ad3d92

Please sign in to comment.