Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134417
b: refs/heads/master
c: 4b53b36
h: refs/heads/master
i:
  134415: 7b724ef
v: v3
  • Loading branch information
David S. Miller committed Feb 10, 2009
1 parent e2c66ee commit 1c4d5c3
Show file tree
Hide file tree
Showing 22 changed files with 171 additions and 53 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: 99e0fca6740b98aed1f604fc2e0acbdbc9e7578a
refs/heads/master: 4b53b361e0fbb2390f1d98ed9eede8e0c9a887b6
1 change: 1 addition & 0 deletions trunk/drivers/atm/solos-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
out_release_regions:
pci_release_regions(dev);
out:
kfree(card);
return err;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/isdn/hardware/mISDN/hfcmulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -4599,6 +4599,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
printk(KERN_ERR "%s: no memory for coeffs\n",
__func__);
ret = -ENOMEM;
kfree(bch);
goto free_chan;
}
bch->nr = ch;
Expand Down Expand Up @@ -4767,6 +4768,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
printk(KERN_ERR "%s: no memory for coeffs\n",
__func__);
ret = -ENOMEM;
kfree(bch);
goto free_chan;
}
bch->nr = ch + 1;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/enic/enic.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco 10G Ethernet Driver"
#define DRV_VERSION "1.0.0.648"
#define DRV_VERSION "1.0.0.933"
#define DRV_COPYRIGHT "Copyright 2008 Cisco Systems, Inc"
#define PFX DRV_NAME ": "

Expand Down Expand Up @@ -97,6 +97,7 @@ struct enic {
____cacheline_aligned struct vnic_rq rq[1];
unsigned int rq_count;
int (*rq_alloc_buf)(struct vnic_rq *rq);
u64 rq_bad_fcs;
struct napi_struct napi;
struct net_lro_mgr lro_mgr;
struct net_lro_desc lro_desc[ENIC_LRO_MAX_DESC];
Expand Down
68 changes: 37 additions & 31 deletions trunk/drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,13 @@ static irqreturn_t enic_isr_legacy(int irq, void *data)
return IRQ_NONE; /* not our interrupt */
}

if (ENIC_TEST_INTR(pba, ENIC_INTX_NOTIFY))
if (ENIC_TEST_INTR(pba, ENIC_INTX_NOTIFY)) {
vnic_intr_return_all_credits(&enic->intr[ENIC_INTX_NOTIFY]);
enic_notify_check(enic);
}

if (ENIC_TEST_INTR(pba, ENIC_INTX_ERR)) {
vnic_intr_return_all_credits(&enic->intr[ENIC_INTX_ERR]);
enic_log_q_error(enic);
/* schedule recovery from WQ/RQ error */
schedule_work(&enic->reset);
Expand Down Expand Up @@ -476,6 +479,8 @@ static irqreturn_t enic_isr_msix_err(int irq, void *data)
{
struct enic *enic = data;

vnic_intr_return_all_credits(&enic->intr[ENIC_MSIX_ERR]);

enic_log_q_error(enic);

/* schedule recovery from WQ/RQ error */
Expand All @@ -488,8 +493,8 @@ static irqreturn_t enic_isr_msix_notify(int irq, void *data)
{
struct enic *enic = data;

vnic_intr_return_all_credits(&enic->intr[ENIC_MSIX_NOTIFY]);
enic_notify_check(enic);
vnic_intr_unmask(&enic->intr[ENIC_MSIX_NOTIFY]);

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -616,7 +621,7 @@ static inline void enic_queue_wq_skb(struct enic *enic,
vlan_tag_insert, vlan_tag);
}

/* netif_tx_lock held, process context with BHs disabled */
/* netif_tx_lock held, process context with BHs disabled, or BH */
static int enic_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev)
{
struct enic *enic = netdev_priv(netdev);
Expand Down Expand Up @@ -683,7 +688,7 @@ static struct net_device_stats *enic_get_stats(struct net_device *netdev)
net_stats->rx_bytes = stats->rx.rx_bytes_ok;
net_stats->rx_errors = stats->rx.rx_errors;
net_stats->multicast = stats->rx.rx_multicast_frames_ok;
net_stats->rx_crc_errors = stats->rx.rx_crc_errors;
net_stats->rx_crc_errors = enic->rq_bad_fcs;
net_stats->rx_dropped = stats->rx.rx_no_bufs;

return net_stats;
Expand Down Expand Up @@ -928,12 +933,8 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,

if (packet_error) {

if (bytes_written > 0 && !fcs_ok) {
if (net_ratelimit())
printk(KERN_ERR PFX
"%s: packet error: bad FCS\n",
netdev->name);
}
if (bytes_written > 0 && !fcs_ok)
enic->rq_bad_fcs++;

dev_kfree_skb_any(skb);

Expand Down Expand Up @@ -1069,7 +1070,7 @@ static int enic_poll(struct napi_struct *napi, int budget)
lro_flush_all(&enic->lro_mgr);

napi_complete(napi);
vnic_intr_unmask(&enic->intr[ENIC_MSIX_RQ]);
vnic_intr_unmask(&enic->intr[ENIC_INTX_WQ_RQ]);
}

return rq_work_done;
Expand All @@ -1095,9 +1096,9 @@ static int enic_poll_msix(struct napi_struct *napi, int budget)

vnic_rq_fill(&enic->rq[0], enic_rq_alloc_buf);

/* Accumulate intr event credits for this polling
/* Return intr event credits for this polling
* cycle. An intr event is the completion of a
* a WQ or RQ packet.
* RQ packet.
*/

vnic_intr_return_credits(&enic->intr[ENIC_MSIX_RQ],
Expand Down Expand Up @@ -1461,6 +1462,26 @@ static int enic_dev_soft_reset(struct enic *enic)
return err;
}

static int enic_set_niccfg(struct enic *enic)
{
const u8 rss_default_cpu = 0;
const u8 rss_hash_type = 0;
const u8 rss_hash_bits = 0;
const u8 rss_base_cpu = 0;
const u8 rss_enable = 0;
const u8 tso_ipid_split_en = 0;
const u8 ig_vlan_strip_en = 1;

/* Enable VLAN tag stripping. RSS not enabled (yet).
*/

return enic_set_nic_cfg(enic,
rss_default_cpu, rss_hash_type,
rss_hash_bits, rss_base_cpu,
rss_enable, tso_ipid_split_en,
ig_vlan_strip_en);
}

static void enic_reset(struct work_struct *work)
{
struct enic *enic = container_of(work, struct enic, reset);
Expand All @@ -1476,8 +1497,10 @@ static void enic_reset(struct work_struct *work)

enic_stop(enic->netdev);
enic_dev_soft_reset(enic);
vnic_dev_init(enic->vdev, 0);
enic_reset_mcaddrs(enic);
enic_init_vnic_resources(enic);
enic_set_niccfg(enic);
enic_open(enic->netdev);

rtnl_unlock();
Expand Down Expand Up @@ -1620,14 +1643,6 @@ static int __devinit enic_probe(struct pci_dev *pdev,
unsigned int i;
int err;

const u8 rss_default_cpu = 0;
const u8 rss_hash_type = 0;
const u8 rss_hash_bits = 0;
const u8 rss_base_cpu = 0;
const u8 rss_enable = 0;
const u8 tso_ipid_split_en = 0;
const u8 ig_vlan_strip_en = 1;

/* Allocate net device structure and initialize. Private
* instance data is initialized to zero.
*/
Expand Down Expand Up @@ -1793,14 +1808,7 @@ static int __devinit enic_probe(struct pci_dev *pdev,

enic_init_vnic_resources(enic);

/* Enable VLAN tag stripping. RSS not enabled (yet).
*/

err = enic_set_nic_cfg(enic,
rss_default_cpu, rss_hash_type,
rss_hash_bits, rss_base_cpu,
rss_enable, tso_ipid_split_en,
ig_vlan_strip_en);
err = enic_set_niccfg(enic);
if (err) {
printk(KERN_ERR PFX
"Failed to config nic, aborting.\n");
Expand Down Expand Up @@ -1858,7 +1866,6 @@ static int __devinit enic_probe(struct pci_dev *pdev,
if (using_dac)
netdev->features |= NETIF_F_HIGHDMA;


enic->csum_rx_enabled = ENIC_SETTING(enic, RXCSUM);

enic->lro_mgr.max_aggr = ENIC_LRO_MAX_AGGR;
Expand All @@ -1870,7 +1877,6 @@ static int __devinit enic_probe(struct pci_dev *pdev,
enic->lro_mgr.ip_summed = CHECKSUM_COMPLETE;
enic->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY;


err = register_netdev(netdev);
if (err) {
printk(KERN_ERR PFX
Expand Down
33 changes: 29 additions & 4 deletions trunk/drivers/net/enic/vnic_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ struct vnic_res {
unsigned int count;
};

#define VNIC_DEV_CAP_INIT 0x0001
#define VNIC_DEV_CAP_PERBI 0x0002

struct vnic_dev {
void *priv;
struct pci_dev *pdev;
Expand All @@ -50,6 +53,7 @@ struct vnic_dev {
dma_addr_t stats_pa;
struct vnic_devcmd_fw_info *fw_info;
dma_addr_t fw_info_pa;
u32 cap_flags;
};

#define VNIC_MAX_RES_HDR_SIZE \
Expand Down Expand Up @@ -575,9 +579,9 @@ int vnic_dev_init(struct vnic_dev *vdev, int arg)
{
u64 a0 = (u32)arg, a1 = 0;
int wait = 1000;
int r = 0;
int r = 0;

if (vnic_dev_capable(vdev, CMD_INIT))
if (vdev->cap_flags & VNIC_DEV_CAP_INIT)
r = vnic_dev_cmd(vdev, CMD_INIT, &a0, &a1, wait);
else {
vnic_dev_cmd(vdev, CMD_INIT_v1, &a0, &a1, wait);
Expand All @@ -587,8 +591,8 @@ int vnic_dev_init(struct vnic_dev *vdev, int arg)
vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a0, &a1, wait);
vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait);
}
}
return r;
}
return r;
}

int vnic_dev_link_status(struct vnic_dev *vdev)
Expand Down Expand Up @@ -626,6 +630,22 @@ u32 vnic_dev_mtu(struct vnic_dev *vdev)
return vdev->notify_copy.mtu;
}

u32 vnic_dev_link_down_cnt(struct vnic_dev *vdev)
{
if (!vnic_dev_notify_ready(vdev))
return 0;

return vdev->notify_copy.link_down_cnt;
}

u32 vnic_dev_notify_status(struct vnic_dev *vdev)
{
if (!vnic_dev_notify_ready(vdev))
return 0;

return vdev->notify_copy.status;
}

void vnic_dev_set_intr_mode(struct vnic_dev *vdev,
enum vnic_dev_intr_mode intr_mode)
{
Expand Down Expand Up @@ -682,6 +702,11 @@ struct vnic_dev *vnic_dev_register(struct vnic_dev *vdev,
if (!vdev->devcmd)
goto err_out;

vdev->cap_flags = 0;

if (vnic_dev_capable(vdev, CMD_INIT))
vdev->cap_flags |= VNIC_DEV_CAP_INIT;

return vdev;

err_out:
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/enic/vnic_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ int vnic_dev_link_status(struct vnic_dev *vdev);
u32 vnic_dev_port_speed(struct vnic_dev *vdev);
u32 vnic_dev_msg_lvl(struct vnic_dev *vdev);
u32 vnic_dev_mtu(struct vnic_dev *vdev);
u32 vnic_dev_link_down_cnt(struct vnic_dev *vdev);
u32 vnic_dev_notify_status(struct vnic_dev *vdev);
int vnic_dev_close(struct vnic_dev *vdev);
int vnic_dev_enable(struct vnic_dev *vdev);
int vnic_dev_disable(struct vnic_dev *vdev);
Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/net/enic/vnic_devcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ enum vnic_devcmd_cmd {
CMD_INIT_STATUS = _CMDC(_CMD_DIR_READ, _CMD_VTYPE_ALL, 31),

/* INT13 API: (u64)a0=paddr to vnic_int13_params struct
* (u8)a1=INT13_CMD_xxx */
* (u32)a1=INT13_CMD_xxx */
CMD_INT13 = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_FC, 32),

/* logical uplink enable/disable: (u64)a0: 0/1=disable/enable */
Expand All @@ -207,6 +207,11 @@ enum vnic_devcmd_cmd {
* in: (u32)a0=cmd
* out: (u32)a0=errno, 0:valid cmd, a1=supported VNIC_STF_* bits */
CMD_CAPABILITY = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_ALL, 36),

/* persistent binding info
* in: (u64)a0=paddr of arg
* (u32)a1=CMD_PERBI_XXX */
CMD_PERBI = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_FC, 37),
};

/* flags for CMD_OPEN */
Expand Down Expand Up @@ -259,6 +264,7 @@ struct vnic_devcmd_notify {
u32 status; /* status bits (see VNIC_STF_*) */
u32 error; /* error code (see ERR_*) for first ERR */
u32 link_down_cnt; /* running count of link down transitions */
u32 perbi_rebuild_cnt; /* running count of perbi rebuilds */
};
#define VNIC_STF_FATAL_ERR 0x0001 /* fatal fw error */
#define VNIC_STF_STD_PAUSE 0x0002 /* standard link-level pause on */
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/net/enic/vnic_intr.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ static inline void vnic_intr_return_credits(struct vnic_intr *intr,
iowrite32(int_credit_return, &intr->ctrl->int_credit_return);
}

static inline unsigned int vnic_intr_credits(struct vnic_intr *intr)
{
return ioread32(&intr->ctrl->int_credits);
}

static inline void vnic_intr_return_all_credits(struct vnic_intr *intr)
{
unsigned int credits = vnic_intr_credits(intr);
int unmask = 1;
int reset_timer = 1;

vnic_intr_return_credits(intr, credits, unmask, reset_timer);
}

static inline u32 vnic_intr_legacy_pba(u32 __iomem *legacy_pba)
{
/* read PBA without clearing */
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,12 @@ static void gfar_schedule_cleanup(struct net_device *dev)
if (napi_schedule_prep(&priv->napi)) {
gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED);
__napi_schedule(&priv->napi);
} else {
/*
* Clear IEVENT, so interrupts aren't called again
* because of the packets that have already arrived.
*/
gfar_write(&priv->regs->ievent, IEVENT_RTX_MASK);
}

spin_unlock(&priv->rxlock);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ typedef struct {
#define NETXEN_IS_MSI_FAMILY(adapter) \
((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED))

#define MSIX_ENTRIES_PER_ADAPTER 8
#define MSIX_ENTRIES_PER_ADAPTER 1
#define NETXEN_MSIX_TBL_SPACE 8192
#define NETXEN_PCI_REG_MSIX_TBL 0x44

Expand Down
Loading

0 comments on commit 1c4d5c3

Please sign in to comment.