glob_arg
} glob_arg;
if (unlikely(batch >= glob_arg.batch)) {
int npipes = glob_arg.output_rings;
if (glob_arg.stdout_interval && sys_int % glob_arg.stdout_interval == 0)
if (glob_arg.syslog_interval && sys_int % glob_arg.syslog_interval == 0)
glob_arg.ifname,
struct port_des *rxport = &ports[glob_arg.output_rings];
for (i = 0; i < glob_arg.output_rings + 1; i++) {
for (i = 0; i < glob_arg.output_rings + 1; ++i) {
ND("spec %s num_groups %d", spec, glob_arg.num_groups);
if (max_groups < glob_arg.num_groups + 1) {
size_t size = sizeof(*g) * (glob_arg.num_groups + 1);
g = &groups[glob_arg.num_groups];
glob_arg.output_rings += g->nports;
glob_arg.num_groups++;
for (i = 0; i < glob_arg.num_groups; i++) {
strcpy(g->pipename, glob_arg.base_name);
for (j = 1; j < glob_arg.output_rings; j++) {
glob_arg.ifname[0] = '\0';
glob_arg.output_rings = 0;
glob_arg.batch = DEF_BATCH;
glob_arg.wait_link = DEF_WAIT_LINK;
glob_arg.busy_wait = false;
glob_arg.syslog_interval = 0;
glob_arg.stdout_interval = 0;
sprintf(glob_arg.ifname, "netmap:%s", optarg);
strcpy(glob_arg.ifname, optarg);
glob_arg.extra_bufs = atoi(optarg);
D("requested %d extra buffers", glob_arg.extra_bufs);
glob_arg.batch = atoi(optarg);
D("batch is %d", glob_arg.batch);
glob_arg.wait_link = atoi(optarg);
D("link wait for up time is %d", glob_arg.wait_link);
glob_arg.busy_wait = true;
glob_arg.stdout_interval = atoi(optarg);
glob_arg.syslog_interval = atoi(optarg);
if (glob_arg.ifname[0] == '\0') {
if (glob_arg.num_groups == 0)
if (glob_arg.syslog_interval) {
uint32_t npipes = glob_arg.output_rings;
rxport->nmd = nmport_prepare(glob_arg.ifname);
D("cannot parse %s", glob_arg.ifname);
strncpy(glob_arg.base_name, rxport->nmd->hdr.nr_name, MAX_IFNAMELEN);
rxport->nmd->reg.nr_extra_bufs = glob_arg.extra_bufs;
D("cannot open %s", glob_arg.ifname);
D("successfully opened %s", glob_arg.ifname);
if (!glob_arg.extra_bufs)
for (j = 0; j < glob_arg.num_groups; j++) {
if (glob_arg.extra_bufs && !extra_bufs) {
sleep(glob_arg.wait_link);
if (glob_arg.syslog_interval > 0 && glob_arg.syslog_interval < poll_timeout)
poll_timeout = glob_arg.syslog_interval;
if (glob_arg.stdout_interval > 0 && glob_arg.stdout_interval < poll_timeout)
poll_timeout = glob_arg.stdout_interval;
if (!glob_arg.busy_wait && !pending) {
for (i = glob_arg.num_groups - 1U; i > 0; i--) {
get_vnet_hdr_len(struct glob_arg *g)
set_vnet_hdr_len(struct glob_arg *g)
tx_output(struct glob_arg *g, struct my_ctrs *cur, double delta, const char *msg)
start_threads(struct glob_arg *g) {
main_thread(struct glob_arg *g)
struct glob_arg g;
struct glob_arg *g;
get_if_mtu(const struct glob_arg *g)
struct glob_arg *g = t->g;
struct glob_arg *g = t->g;