Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255951
b: refs/heads/master
c: a65151b
h: refs/heads/master
i:
  255949: d918445
  255947: ab7fded
  255943: 6b49def
  255935: c6762d8
v: v3
  • Loading branch information
Alexander Duyck authored and Jeff Kirsher committed Jun 25, 2011
1 parent 9307916 commit d77ee66
Show file tree
Hide file tree
Showing 31 changed files with 702 additions and 653 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23efcb738ea51befe0674e0685fc6cfe353aa553
refs/heads/master: a65151ba201fe56ac146767e018674a84bfef1a6
42 changes: 21 additions & 21 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ module_param(num_vfs, uint, S_IRUGO);
MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data.");
MODULE_PARM_DESC(num_vfs, "Number of PCI VFs to initialize");

static bool multi_rxq = true;
module_param(multi_rxq, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(multi_rxq, "Multi Rx Queue support. Enabled by default");

static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
{ PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) },
{ PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID2) },
Expand Down Expand Up @@ -424,38 +428,33 @@ void netdev_stats_update(struct be_adapter *adapter)
struct net_device_stats *dev_stats = &adapter->netdev->stats;
struct be_rx_obj *rxo;
struct be_tx_obj *txo;
unsigned long pkts = 0, bytes = 0, mcast = 0, drops = 0;
int i;

memset(dev_stats, 0, sizeof(*dev_stats));
for_all_rx_queues(adapter, rxo, i) {
pkts += rx_stats(rxo)->rx_pkts;
bytes += rx_stats(rxo)->rx_bytes;
mcast += rx_stats(rxo)->rx_mcast_pkts;
dev_stats->rx_packets += rx_stats(rxo)->rx_pkts;
dev_stats->rx_bytes += rx_stats(rxo)->rx_bytes;
dev_stats->multicast += rx_stats(rxo)->rx_mcast_pkts;
/* no space in linux buffers: best possible approximation */
if (adapter->generation == BE_GEN3) {
if (!(lancer_chip(adapter))) {
struct be_erx_stats_v1 *erx =
struct be_erx_stats_v1 *erx_stats =
be_erx_stats_from_cmd(adapter);
drops += erx->rx_drops_no_fragments[rxo->q.id];
dev_stats->rx_dropped +=
erx_stats->rx_drops_no_fragments[rxo->q.id];
}
} else {
struct be_erx_stats_v0 *erx =
struct be_erx_stats_v0 *erx_stats =
be_erx_stats_from_cmd(adapter);
drops += erx->rx_drops_no_fragments[rxo->q.id];
dev_stats->rx_dropped +=
erx_stats->rx_drops_no_fragments[rxo->q.id];
}
}
dev_stats->rx_packets = pkts;
dev_stats->rx_bytes = bytes;
dev_stats->multicast = mcast;
dev_stats->rx_dropped = drops;

pkts = bytes = 0;
for_all_tx_queues(adapter, txo, i) {
pkts += tx_stats(txo)->be_tx_pkts;
bytes += tx_stats(txo)->be_tx_bytes;
dev_stats->tx_packets += tx_stats(txo)->be_tx_pkts;
dev_stats->tx_bytes += tx_stats(txo)->be_tx_bytes;
}
dev_stats->tx_packets = pkts;
dev_stats->tx_bytes = bytes;

/* bad pkts received */
dev_stats->rx_errors = drvs->rx_crc_errors +
Expand Down Expand Up @@ -1781,7 +1780,7 @@ static void be_rx_queues_destroy(struct be_adapter *adapter)

static u32 be_num_rxqs_want(struct be_adapter *adapter)
{
if ((adapter->function_caps & BE_FUNCTION_CAPS_RSS) &&
if (multi_rxq && (adapter->function_caps & BE_FUNCTION_CAPS_RSS) &&
!adapter->sriov_enabled && !(adapter->function_mode & 0x400)) {
return 1 + MAX_RSS_QS; /* one default non-RSS queue */
} else {
Expand Down Expand Up @@ -2554,9 +2553,6 @@ static int be_setup(struct be_adapter *adapter)
if (status != 0)
goto tx_qs_destroy;

/* Allow all priorities by default. A GRP5 evt may modify this */
adapter->vlan_prio_bmap = 0xff;

status = be_mcc_queues_create(adapter);
if (status != 0)
goto rx_qs_destroy;
Expand Down Expand Up @@ -3422,6 +3418,10 @@ static int __devinit be_probe(struct pci_dev *pdev,
}

dev_info(&pdev->dev, "%s port %d\n", nic_name(pdev), adapter->port_num);
/* By default all priorities are enabled.
* Needed in case of no GRP5 evt support
*/
adapter->vlan_prio_bmap = 0xff;

schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
return 0;
Expand Down
18 changes: 7 additions & 11 deletions trunk/drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1880,8 +1880,7 @@ static void ixgbe_check_lsc(struct ixgbe_adapter *adapter)

static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
{
struct net_device *netdev = data;
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_adapter *adapter = data;
struct ixgbe_hw *hw = &adapter->hw;
u32 eicr;

Expand Down Expand Up @@ -2376,7 +2375,7 @@ static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)

sprintf(adapter->lsc_int_name, "%s:lsc", netdev->name);
err = request_irq(adapter->msix_entries[vector].vector,
ixgbe_msix_lsc, 0, adapter->lsc_int_name, netdev);
ixgbe_msix_lsc, 0, adapter->lsc_int_name, adapter);
if (err) {
e_err(probe, "request_irq for msix_lsc failed: %d\n", err);
goto free_queue_irqs;
Expand Down Expand Up @@ -2488,8 +2487,7 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues,
**/
static irqreturn_t ixgbe_intr(int irq, void *data)
{
struct net_device *netdev = data;
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_adapter *adapter = data;
struct ixgbe_hw *hw = &adapter->hw;
struct ixgbe_q_vector *q_vector = adapter->q_vector[0];
u32 eicr;
Expand Down Expand Up @@ -2586,10 +2584,10 @@ static int ixgbe_request_irq(struct ixgbe_adapter *adapter)
err = ixgbe_request_msix_irqs(adapter);
} else if (adapter->flags & IXGBE_FLAG_MSI_ENABLED) {
err = request_irq(adapter->pdev->irq, ixgbe_intr, 0,
netdev->name, netdev);
netdev->name, adapter);
} else {
err = request_irq(adapter->pdev->irq, ixgbe_intr, IRQF_SHARED,
netdev->name, netdev);
netdev->name, adapter);
}

if (err)
Expand All @@ -2600,15 +2598,13 @@ static int ixgbe_request_irq(struct ixgbe_adapter *adapter)

static void ixgbe_free_irq(struct ixgbe_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;

if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
int i, q_vectors;

q_vectors = adapter->num_msix_vectors;

i = q_vectors - 1;
free_irq(adapter->msix_entries[i].vector, netdev);
free_irq(adapter->msix_entries[i].vector, adapter);

i--;
for (; i >= 0; i--) {
Expand All @@ -2623,7 +2619,7 @@ static void ixgbe_free_irq(struct ixgbe_adapter *adapter)

ixgbe_reset_q_vectors(adapter);
} else {
free_irq(adapter->pdev->irq, netdev);
free_irq(adapter->pdev->irq, adapter);
}
}

Expand Down
30 changes: 15 additions & 15 deletions trunk/drivers/net/wan/c101.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* Moxa C101 User's Manual
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/capability.h>
Expand Down Expand Up @@ -315,44 +313,44 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
int result;

if (irq<3 || irq>15 || irq == 6) /* FIXME */ {
pr_err("invalid IRQ value\n");
printk(KERN_ERR "c101: invalid IRQ value\n");
return -ENODEV;
}

if (winbase < 0xC0000 || winbase > 0xDFFFF || (winbase & 0x3FFF) !=0) {
pr_err("invalid RAM value\n");
printk(KERN_ERR "c101: invalid RAM value\n");
return -ENODEV;
}

card = kzalloc(sizeof(card_t), GFP_KERNEL);
if (card == NULL) {
pr_err("unable to allocate memory\n");
printk(KERN_ERR "c101: unable to allocate memory\n");
return -ENOBUFS;
}

card->dev = alloc_hdlcdev(card);
if (!card->dev) {
pr_err("unable to allocate memory\n");
printk(KERN_ERR "c101: unable to allocate memory\n");
kfree(card);
return -ENOBUFS;
}

if (request_irq(irq, sca_intr, 0, devname, card)) {
pr_err("could not allocate IRQ\n");
printk(KERN_ERR "c101: could not allocate IRQ\n");
c101_destroy_card(card);
return -EBUSY;
}
card->irq = irq;

if (!request_mem_region(winbase, C101_MAPPED_RAM_SIZE, devname)) {
pr_err("could not request RAM window\n");
printk(KERN_ERR "c101: could not request RAM window\n");
c101_destroy_card(card);
return -EBUSY;
}
card->phy_winbase = winbase;
card->win0base = ioremap(winbase, C101_MAPPED_RAM_SIZE);
if (!card->win0base) {
pr_err("could not map I/O address\n");
printk(KERN_ERR "c101: could not map I/O address\n");
c101_destroy_card(card);
return -EFAULT;
}
Expand Down Expand Up @@ -383,16 +381,18 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)

result = register_hdlc_device(dev);
if (result) {
pr_warn("unable to register hdlc device\n");
printk(KERN_WARNING "c101: unable to register hdlc device\n");
c101_destroy_card(card);
return result;
}

sca_init_port(card); /* Set up C101 memory */
set_carrier(card);

netdev_info(dev, "Moxa C101 on IRQ%u, using %u TX + %u RX packets rings\n",
card->irq, card->tx_ring_buffers, card->rx_ring_buffers);
printk(KERN_INFO "%s: Moxa C101 on IRQ%u,"
" using %u TX + %u RX packets rings\n",
dev->name, card->irq,
card->tx_ring_buffers, card->rx_ring_buffers);

*new_card = card;
new_card = &card->next_card;
Expand All @@ -405,12 +405,12 @@ static int __init c101_init(void)
{
if (hw == NULL) {
#ifdef MODULE
pr_info("no card initialized\n");
printk(KERN_INFO "c101: no card initialized\n");
#endif
return -EINVAL; /* no parameters specified, abort */
}

pr_info("%s\n", version);
printk(KERN_INFO "%s\n", version);

do {
unsigned long irq, ram;
Expand All @@ -428,7 +428,7 @@ static int __init c101_init(void)
return first_card ? 0 : -EINVAL;
}while(*hw++ == ':');

pr_err("invalid hardware parameters\n");
printk(KERN_ERR "c101: invalid hardware parameters\n");
return first_card ? 0 : -EINVAL;
}

Expand Down
Loading

0 comments on commit d77ee66

Please sign in to comment.