FYI non zero-copy does not have this limit
From: [email protected]
To: [email protected]
Date: Fri, 16 Oct 2015 06:50:32 +0000
Subject: [Ntop-misc] Failed to send packet total size greater than 64bytes
using code from the zsend example
pfring_zc_send_pkt() always return -1 when the message size (include the header
+ my application data) is greater than 64 bytes. Please help.
This is how I create the cluster
zc = pfring_zc_create_cluster(cluster_id,
asio::pf_ring::max_packet_len(device_name.c_str()), 0, NBUFF,
numa_node_of_cpu(bind_cpu), NULL /* auto hugetlb mountpoint */
);
if (zc == NULL)
{
fprintf(stderr, "pfring_zc_create_cluster error [%s] Please check
your hugetlb configuration\n", strerror(errno));
return -1;
}
zq = pfring_zc_open_device(zc, device_name.c_str(), tx_only, 0);
if (zq == NULL)
{
fprintf(stderr, "pfring_zc_open_device error [%s] Please check that
%s is up and not already used\n", strerror(errno),
device_name.c_str());
return -1;
}
fprintf(stderr, "Sending packets to %s\n", device_name.c_str());
for (int i = 0; i < NBUFF; i++)
{
buffers[i] = pfring_zc_get_packet_handle(zc);
if (buffers[i] == NULL)
{
fprintf(stderr, "pfring_zc_get_packet_handle error\n");
return -1;
}
}
This is how I send the packet
char a[23] = {0}; //23 + 42 = 65 return -1 from the send function,
resetting a to 22 it works
int tot_msg_size = forge_udp_packet(pfring_zc_pkt_buff_data(buffers[0],
zq), 1600, a, sizeof(a), parse_ip_v4_string(sender_ip.c_str()),
sender_port, parse_ip_v4_string(mcast_ip.c_str()),
mcast_port);
std::cout << "tot_msg_size:" << std::dec << tot_msg_size << std::endl;
buffers[0]->len = tot_msg_size;
std::cout << "buffers[0] : ";
for (int i = 0; i < buffers[0]->len; ++i)
{
std::cout << std::hex << (int) pfring_zc_pkt_buff_data(buffers[0],
zq)[i] << " ";
}
int rc = pfring_zc_send_pkt(zq, &buffers[0], 0);
B.R
Bryan
_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc
_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc