Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215426
b: refs/heads/master
c: 27ab760
h: refs/heads/master
v: v3
  • Loading branch information
Yi Zou authored and David S. Miller committed Oct 21, 2010
1 parent ab05831 commit c832ec9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: de1036b1cea147c5049c65f5bd26fb451f1624cd
refs/heads/master: 27ab76065c0c6734ea98ccc7080046a72d98455b
6 changes: 6 additions & 0 deletions trunk/drivers/net/ixgbe/ixgbe_fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,13 @@ int ixgbe_fcoe_enable(struct net_device *netdev)
{
int rc = -EINVAL;
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_fcoe *fcoe = &adapter->fcoe;


if (!(adapter->flags & IXGBE_FLAG_FCOE_CAPABLE))
goto out_enable;

atomic_inc(&fcoe->refcnt);
if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
goto out_enable;

Expand Down Expand Up @@ -648,13 +650,17 @@ int ixgbe_fcoe_disable(struct net_device *netdev)
{
int rc = -EINVAL;
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_fcoe *fcoe = &adapter->fcoe;

if (!(adapter->flags & IXGBE_FLAG_FCOE_CAPABLE))
goto out_disable;

if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))
goto out_disable;

if (!atomic_dec_and_test(&fcoe->refcnt))
goto out_disable;

e_info(drv, "Disabling FCoE offload features.\n");
netdev->features &= ~NETIF_F_FCOE_CRC;
netdev->features &= ~NETIF_F_FSO;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ixgbe/ixgbe_fcoe.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct ixgbe_fcoe {
u8 tc;
u8 up;
#endif
atomic_t refcnt;
spinlock_t lock;
struct pci_pool *pool;
struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
Expand Down

0 comments on commit c832ec9

Please sign in to comment.