Skip to content

Commit

Permalink
Merge remote-tracking branch 'fastclick/main' into PRhirt
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Oct 1, 2024
2 parents 30cd637 + 9f0af7e commit f9fca54
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 27 deletions.
18 changes: 1 addition & 17 deletions elements/analysis/numberpacket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int NumberPacket::configure(Vector<String> &conf, ErrorHandler *errh) {
return 0;
}

inline Packet* NumberPacket::smaction(Packet *p) {
inline Packet* NumberPacket::simple_action(Packet *p) {
WritablePacket *wp = nullptr;
if (p->length() >= (unsigned)_offset + _size_of_number) {
wp = p->uniqueify();
Expand All @@ -67,22 +67,6 @@ inline Packet* NumberPacket::smaction(Packet *p) {
return wp;
}

Packet*
NumberPacket::simple_action(Packet *p) {
return smaction(p);
}

#if HAVE_BATCH
PacketBatch*
NumberPacket::simple_action_batch(PacketBatch *batch) {
FOR_EACH_PACKET_SAFE(batch,p) {
p = smaction(p);
}
return batch;
}
#endif


String
NumberPacket::read_handler(Element *e, void *thunk)
{
Expand Down
5 changes: 1 addition & 4 deletions elements/analysis/numberpacket.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ acounting for this format. Defaults to false.
RecordTimestamp, TimestampDiff */

class NumberPacket : public BatchElement {
class NumberPacket : public SimpleElement<NumberPacket> {
public:
NumberPacket() CLICK_COLD;
~NumberPacket() CLICK_COLD;
Expand All @@ -43,9 +43,6 @@ public:
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;

Packet *simple_action(Packet *) override;
#if HAVE_BATCH
PacketBatch *simple_action_batch(PacketBatch *) override;
#endif

static inline uint64_t read_number_of_packet(
const Packet *p, int offset, bool net_order = false) {
Expand Down
2 changes: 1 addition & 1 deletion elements/userlevel/fromdevice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <click/standard/scheduleinfo.hh>
#include <click/userutils.hh>
#include <netinet/if_ether.h>
#ifndef define
#ifndef _LINUX_IF_ETHER_H
# define _LINUX_IF_ETHER_H 1
#endif
#ifdef HAVE_LINUX_ETHTOOL_H
Expand Down
13 changes: 8 additions & 5 deletions lib/packet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,14 @@ Packet::clone(bool fast)
return duplicate(0,0);
}
# endif
Packet* p = reinterpret_cast<Packet *>(
rte_pktmbuf_clone(mb(), DPDKDevice::get_mpool(rte_socket_id())));
auto pool = DPDKDevice::get_mpool(rte_socket_id());
rte_mbuf* m = rte_pktmbuf_alloc(pool);
if (unlikely(!m))
return 0;
rte_pktmbuf_attach(m,mb());
m->nb_segs = 1;
m->pkt_len = mb()->pkt_len;
Packet* p = reinterpret_cast<Packet*>(m);
p->copy_annotations(this,true);
p->copy_headers(this);
return p;
Expand Down Expand Up @@ -1422,9 +1428,6 @@ Packet::expensive_push(uint32_t nbytes)
WritablePacket *
Packet::expensive_put(uint32_t nbytes)
{
#if CLICK_PACKET_USE_DPDK
assert(false);
#endif
static int chatter = 0;
if (tailroom() < nbytes && chatter < 5) {
click_chatter("expensive Packet::put; have %d wanted %d",
Expand Down

0 comments on commit f9fca54

Please sign in to comment.