Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315732
b: refs/heads/master
c: 1bf91cd
h: refs/heads/master
v: v3
  • Loading branch information
Alexander Duyck authored and Jeff Kirsher committed Jul 20, 2012
1 parent 7a0d838 commit 523f30e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 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: d773d1310625be3b040b436178ad59a0af8888f1
refs/heads/master: 1bf91cdc1bba94ea062a9147d924815c13f029f2
30 changes: 15 additions & 15 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid)
udelay(100);
}
if (ddp->sgl)
pci_unmap_sg(adapter->pdev, ddp->sgl, ddp->sgc,
dma_unmap_sg(&adapter->pdev->dev, ddp->sgl, ddp->sgc,
DMA_FROM_DEVICE);
if (ddp->pool) {
pci_pool_free(ddp->pool, ddp->udl, ddp->udp);
dma_pool_free(ddp->pool, ddp->udl, ddp->udp);
ddp->pool = NULL;
}

Expand Down Expand Up @@ -144,7 +144,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid,
unsigned int thislen = 0;
u32 fcbuff, fcdmarw, fcfltrw, fcrxctl;
dma_addr_t addr = 0;
struct pci_pool *pool;
struct dma_pool *pool;
unsigned int cpu;

if (!netdev || !sgl)
Expand Down Expand Up @@ -176,7 +176,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid,
ixgbe_fcoe_clear_ddp(ddp);

/* setup dma from scsi command sgl */
dmacount = pci_map_sg(adapter->pdev, sgl, sgc, DMA_FROM_DEVICE);
dmacount = dma_map_sg(&adapter->pdev->dev, sgl, sgc, DMA_FROM_DEVICE);
if (dmacount == 0) {
e_err(drv, "xid 0x%x DMA map error\n", xid);
return 0;
Expand All @@ -185,7 +185,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid,
/* alloc the udl from per cpu ddp pool */
cpu = get_cpu();
pool = *per_cpu_ptr(fcoe->pool, cpu);
ddp->udl = pci_pool_alloc(pool, GFP_ATOMIC, &ddp->udp);
ddp->udl = dma_pool_alloc(pool, GFP_ATOMIC, &ddp->udp);
if (!ddp->udl) {
e_err(drv, "failed allocated ddp context\n");
goto out_noddp_unmap;
Expand Down Expand Up @@ -293,11 +293,11 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid,
return 1;

out_noddp_free:
pci_pool_free(pool, ddp->udl, ddp->udp);
dma_pool_free(pool, ddp->udl, ddp->udp);
ixgbe_fcoe_clear_ddp(ddp);

out_noddp_unmap:
pci_unmap_sg(adapter->pdev, sgl, sgc, DMA_FROM_DEVICE);
dma_unmap_sg(&adapter->pdev->dev, sgl, sgc, DMA_FROM_DEVICE);
put_cpu();
return 0;
}
Expand Down Expand Up @@ -409,7 +409,7 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter,
break;
/* unmap the sg list when FCPRSP is received */
case __constant_cpu_to_le32(IXGBE_RXDADV_STAT_FCSTAT_FCPRSP):
pci_unmap_sg(adapter->pdev, ddp->sgl,
dma_unmap_sg(&adapter->pdev->dev, ddp->sgl,
ddp->sgc, DMA_FROM_DEVICE);
ddp->err = ddp_err;
ddp->sgl = NULL;
Expand Down Expand Up @@ -566,12 +566,12 @@ int ixgbe_fso(struct ixgbe_ring *tx_ring,
static void ixgbe_fcoe_ddp_pools_free(struct ixgbe_fcoe *fcoe)
{
unsigned int cpu;
struct pci_pool **pool;
struct dma_pool **pool;

for_each_possible_cpu(cpu) {
pool = per_cpu_ptr(fcoe->pool, cpu);
if (*pool)
pci_pool_destroy(*pool);
dma_pool_destroy(*pool);
}
free_percpu(fcoe->pool);
fcoe->pool = NULL;
Expand All @@ -581,20 +581,20 @@ static void ixgbe_fcoe_ddp_pools_alloc(struct ixgbe_adapter *adapter)
{
struct ixgbe_fcoe *fcoe = &adapter->fcoe;
unsigned int cpu;
struct pci_pool **pool;
struct dma_pool **pool;
char pool_name[32];

fcoe->pool = alloc_percpu(struct pci_pool *);
fcoe->pool = alloc_percpu(struct dma_pool *);
if (!fcoe->pool)
return;

/* allocate pci pool for each cpu */
for_each_possible_cpu(cpu) {
snprintf(pool_name, 32, "ixgbe_fcoe_ddp_%d", cpu);
pool = per_cpu_ptr(fcoe->pool, cpu);
*pool = pci_pool_create(pool_name,
adapter->pdev, IXGBE_FCPTR_MAX,
IXGBE_FCPTR_ALIGN, PAGE_SIZE);
*pool = dma_pool_create(pool_name, &adapter->pdev->dev,
IXGBE_FCPTR_MAX, IXGBE_FCPTR_ALIGN,
PAGE_SIZE);
if (!*pool) {
e_err(drv, "failed to alloc DDP pool on cpu:%d\n", cpu);
ixgbe_fcoe_ddp_pools_free(fcoe);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ struct ixgbe_fcoe_ddp {
struct scatterlist *sgl;
dma_addr_t udp;
u64 *udl;
struct pci_pool *pool;
struct dma_pool *pool;
};

struct ixgbe_fcoe {
struct pci_pool **pool;
struct dma_pool **pool;
atomic_t refcnt;
spinlock_t lock;
struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
Expand Down

0 comments on commit 523f30e

Please sign in to comment.