~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to drivers/net/ethernet/sfc/rx.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
/* This is the percentage fill level below which new RX descriptors
77
77
 * will be added to the RX descriptor ring.
78
78
 */
79
 
static unsigned int rx_refill_threshold = 90;
80
 
 
81
 
/* This is the percentage fill level to which an RX queue will be refilled
82
 
 * when the "RX refill threshold" is reached.
83
 
 */
84
 
static unsigned int rx_refill_limit = 95;
 
79
static unsigned int rx_refill_threshold;
85
80
 
86
81
/*
87
82
 * RX maximum head room required.
342
337
 * efx_fast_push_rx_descriptors - push new RX descriptors quickly
343
338
 * @rx_queue:           RX descriptor queue
344
339
 * This will aim to fill the RX descriptor queue up to
345
 
 * @rx_queue->@fast_fill_limit. If there is insufficient atomic
 
340
 * @rx_queue->@max_fill. If there is insufficient atomic
346
341
 * memory to do so, a slow fill will be scheduled.
347
342
 *
348
343
 * The caller must provide serialisation (none is used here). In practise,
367
362
                        rx_queue->min_fill = fill_level;
368
363
        }
369
364
 
370
 
        space = rx_queue->fast_fill_limit - fill_level;
371
 
        if (space < EFX_RX_BATCH)
372
 
                goto out;
 
365
        space = rx_queue->max_fill - fill_level;
 
366
        EFX_BUG_ON_PARANOID(space < EFX_RX_BATCH);
373
367
 
374
368
        netif_vdbg(rx_queue->efx, rx_status, rx_queue->efx->net_dev,
375
369
                   "RX queue %d fast-filling descriptor ring from"
376
370
                   " level %d to level %d using %s allocation\n",
377
371
                   efx_rx_queue_index(rx_queue), fill_level,
378
 
                   rx_queue->fast_fill_limit,
 
372
                   rx_queue->max_fill,
379
373
                   channel->rx_alloc_push_pages ? "page" : "skb");
380
374
 
381
375
        do {
681
675
void efx_init_rx_queue(struct efx_rx_queue *rx_queue)
682
676
{
683
677
        struct efx_nic *efx = rx_queue->efx;
684
 
        unsigned int max_fill, trigger, limit;
 
678
        unsigned int max_fill, trigger, max_trigger;
685
679
 
686
680
        netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev,
687
681
                  "initialising RX queue %d\n", efx_rx_queue_index(rx_queue));
694
688
 
695
689
        /* Initialise limit fields */
696
690
        max_fill = efx->rxq_entries - EFX_RXD_HEAD_ROOM;
697
 
        trigger = max_fill * min(rx_refill_threshold, 100U) / 100U;
698
 
        limit = max_fill * min(rx_refill_limit, 100U) / 100U;
 
691
        max_trigger = max_fill - EFX_RX_BATCH;
 
692
        if (rx_refill_threshold != 0) {
 
693
                trigger = max_fill * min(rx_refill_threshold, 100U) / 100U;
 
694
                if (trigger > max_trigger)
 
695
                        trigger = max_trigger;
 
696
        } else {
 
697
                trigger = max_trigger;
 
698
        }
699
699
 
700
700
        rx_queue->max_fill = max_fill;
701
701
        rx_queue->fast_fill_trigger = trigger;
702
 
        rx_queue->fast_fill_limit = limit;
703
702
 
704
703
        /* Set up RX descriptor ring */
705
704
        rx_queue->enabled = true;
746
745
 
747
746
module_param(rx_refill_threshold, uint, 0444);
748
747
MODULE_PARM_DESC(rx_refill_threshold,
749
 
                 "RX descriptor ring fast/slow fill threshold (%)");
 
748
                 "RX descriptor ring refill threshold (%)");
750
749