Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init arp ring related issues #7

Closed
alandtsang opened this issue May 15, 2017 · 1 comment
Closed

init arp ring related issues #7

alandtsang opened this issue May 15, 2017 · 1 comment

Comments

@alandtsang
Copy link

alandtsang commented May 15, 2017

/* Create ring according to ports actually being used. */
    nb_ports = ff_global_cfg.dpdk.nb_ports;
    for (i = 0; i < nb_ports; i++) {
        uint8_t port_id = ff_global_cfg.dpdk.port_cfgs[i].port_id;

        for(i = 0; i < nb_procs; ++i) {
            snprintf(name_buf, RTE_RING_NAMESIZE, "ring_%d_%d", i, port_id);
            if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
                arp_ring[i][port_id] = rte_ring_create(name_buf,
                    ARP_RING_SIZE, socketid,
                    RING_F_SC_DEQ);
            } else {
                arp_ring[i][port_id] = rte_ring_lookup(name_buf);
            }

            /* === Here ====*/
            if (arp_ring[i][port_id] == NULL)
                rte_panic("create kni ring::%s failed!\n", name_buf);

            /* === And here ====*/
            if (rte_ring_lookup(name_buf) != arp_ring[i][port_id])
                rte_panic("lookup kni ring:%s failed!\n", name_buf);

            printf("create arp ring:%s success, %u ring entries are now free!\n",
                name_buf, rte_ring_free_count(arp_ring[i][port_id]));
        }
    }

I can not understand how this code have to do with kni ring, is this a typo? Or I understand wrong. Thanks

@whl739
Copy link
Member

whl739 commented May 15, 2017

The below rte_ring_lookup should be called after rte_ring_create, i will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants