On 03.12.2016 05:14, Daniele Di Proietto wrote:
> +/* Assign pmds to queues.  If 'pinned' is true, assign pmds to pinned
> + * queues and marks the pmds as isolated.  Otherwise, assign non isolated
> + * pmds to unpinned queues.
> + *
> + * The function doesn't touch the pmd threads, it just stores the assignment
> + * in the 'pmd' member of each rxq. */
> +static void
> +rxq_scheduling(struct dp_netdev *dp, bool pinned) 
> OVS_REQUIRES(dp->port_mutex)
> +{
> +    struct dp_netdev_port *port;
> +    struct rr_numa_list rr;
> +
> +    rr_numa_list_populate(dp, &rr);
> +
> +    HMAP_FOR_EACH(port, node, &dp->ports) {
> +        struct rr_numa *numa;
> +        int numa_id;
> +
> +        if (!netdev_is_pmd(port->netdev)) {
> +            continue;
> +        }
> +
> +        numa_id = netdev_get_numa_id(port->netdev);
> +        numa = rr_numa_list_lookup(&rr, numa_id);
> +
> +        for (int qid = 0; qid < port->n_rxq; qid++) {
> +            struct dp_netdev_rxq *q = &port->rxqs[qid];
> +
> +            if (pinned && q->core_id != RXQ_CORE_UNPINNED) {
> +                struct dp_netdev_pmd_thread *pmd;
> +
> +                pmd = dp_netdev_get_pmd(dp, q->core_id);
> +                if (!pmd) {
> +                    VLOG_WARN("There is no PMD thread on core %d. Queue "
> +                              "%d on port \'%s\' will not be polled.",
> +                              q->core_id, qid, 
> netdev_get_name(port->netdev));
> +                } else {
> +                    q->pmd = pmd;
> +                    pmd->isolated = true;
> +                    dp_netdev_pmd_unref(pmd);
> +                }
> +            } else if (!pinned && q->core_id == RXQ_CORE_UNPINNED) {
> +                if (!numa) {
> +                    VLOG_WARN("There's no available (non isolated) pmd 
> thread"
> +                              "on numa node %d. Queue %d on port \'%s\' will"
> +                              "not be polled.",

Spaces lost while splitting the string.

> +                              numa_id, qid, netdev_get_name(port->netdev));
> +                } else {
> +                    q->pmd = rr_numa_get_pmd(numa);
> +                }
> +            }
> +        }
> +    }
> +
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to