Re: [net-next PATCH v1 08/11] net: rocker: add get flow API operation
From: John Fastabend <john.fastabend@gmail.com>
Date: 2015-01-02 21:15:54
On 01/02/2015 12:46 PM, Rami Rosen wrote:
Nice work!
בתאריך 31 בדצמ 2014
> +static int rocker_get_flows(struct sk_buff *skb, struct net_device *dev,
> + int table, int min, int max)
> +{
> + struct rocker_port *rocker_port = netdev_priv(dev);
> + struct net_flow_flow flow;
> + struct rocker_flow_tbl_entry *entry;
> + struct rocker_group_tbl_entry *group;
> + struct hlist_node *tmp;
> + unsigned long flags;
> + int bkt, err;
> +
> + spin_lock_irqsave(&rocker_port->rocker->flow_tbl_lock, flags);
> + hash_for_each_safe(rocker_port->rocker->flow_tbl,
> + bkt, tmp, entry, entry) {
> + struct rocker_flow_tbl_key *key = &entry->key;
> +
> + if (rocker_goto_value(table) != key->tbl_id)
> + continue;
> +
> + flow.table_id = table;
> + flow.uid = entry->cookie;
> + flow.priority = key->priority;
> +
> + switch (table) {
> + case ROCKER_FLOW_TABLE_ID_INGRESS_PORT:
> + err = rocker_ig_port_to_flow(key, &flow);
> + if (err)
> + return err;
> + break;
> + case ROCKER_FLOW_TABLE_ID_VLAN:
> + err = rocker_vlan_to_flow(key, &flow);
> + if (err)
> + return err;
> + break;
> + case ROCKER_FLOW_TABLE_ID_TERMINATION_MAC:
> + err = rocker_term_to_flow(key, &flow);
Shouldn't it be here (and in the following 3 case entries) also:Yes, thanks for catching this. I'll update it in v2. Along with the other fixes for dev_put misses. .John -- John Fastabend Intel Corporation