lkml.org 
[lkml]   [2007]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 24/30] cpu alloc: Chelsio statistics conversion
    Signed-off-by: Christoph Lameter <clameter@sgi.com>
    ---
    drivers/net/chelsio/sge.c | 13 +++++++------
    1 file changed, 7 insertions(+), 6 deletions(-)

    Index: linux-2.6/drivers/net/chelsio/sge.c
    ===================================================================
    --- linux-2.6.orig/drivers/net/chelsio/sge.c 2007-11-15 21:17:23.927654318 -0800
    +++ linux-2.6/drivers/net/chelsio/sge.c 2007-11-15 21:25:37.015154316 -0800
    @@ -805,7 +805,7 @@ void t1_sge_destroy(struct sge *sge)
    int i;

    for_each_port(sge->adapter, i)
    - free_percpu(sge->port_stats[i]);
    + CPU_FREE(sge->port_stats[i]);

    kfree(sge->tx_sched);
    free_tx_resources(sge);
    @@ -984,7 +984,7 @@ void t1_sge_get_port_stats(const struct

    memset(ss, 0, sizeof(*ss));
    for_each_possible_cpu(cpu) {
    - struct sge_port_stats *st = per_cpu_ptr(sge->port_stats[port], cpu);
    + struct sge_port_stats *st = CPU_PTR(sge->port_stats[port], cpu);

    ss->rx_packets += st->rx_packets;
    ss->rx_cso_good += st->rx_cso_good;
    @@ -1379,7 +1379,7 @@ static void sge_rx(struct sge *sge, stru
    }
    __skb_pull(skb, sizeof(*p));

    - st = per_cpu_ptr(sge->port_stats[p->iff], smp_processor_id());
    + st = THIS_CPU(sge->port_stats[p->iff]);
    st->rx_packets++;

    skb->protocol = eth_type_trans(skb, adapter->port[p->iff].dev);
    @@ -1848,7 +1848,7 @@ int t1_start_xmit(struct sk_buff *skb, s
    {
    struct adapter *adapter = dev->priv;
    struct sge *sge = adapter->sge;
    - struct sge_port_stats *st = per_cpu_ptr(sge->port_stats[dev->if_port], smp_processor_id());
    + struct sge_port_stats *st = THIS_CPU(sge->port_stats[dev->if_port]);
    struct cpl_tx_pkt *cpl;
    struct sk_buff *orig_skb = skb;
    int ret;
    @@ -2165,7 +2165,8 @@ struct sge * __devinit t1_sge_create(str
    sge->jumbo_fl = t1_is_T1B(adapter) ? 1 : 0;

    for_each_port(adapter, i) {
    - sge->port_stats[i] = alloc_percpu(struct sge_port_stats);
    + sge->port_stats[i] = CPU_ALLOC(struct sge_port_stats,
    + GFP_KERNEL | __GFP_ZERO);
    if (!sge->port_stats[i])
    goto nomem_port;
    }
    @@ -2209,7 +2210,7 @@ struct sge * __devinit t1_sge_create(str
    return sge;
    nomem_port:
    while (i >= 0) {
    - free_percpu(sge->port_stats[i]);
    + CPU_FREE(sge->port_stats[i]);
    --i;
    }
    kfree(sge);
    --
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-11-17 00:25    [W:0.024 / U:59.160 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site