Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247727
b: refs/heads/master
c: 0da0606
h: refs/heads/master
i:
  247725: 11f1f10
  247723: d363c34
  247719: 7e2e758
  247711: d4e7c25
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed May 19, 2011
1 parent 34b43be commit 14d43f3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 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: dabc5c670d3f86d15ee4f42ab38ec5bd2682487d
refs/heads/master: 0da0606f493c5cdab74bdcc96b12f4305ad94085
51 changes: 24 additions & 27 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -13602,19 +13602,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
tg3_flag(tp, 5750_PLUS))
tg3_flag_set(tp, 5705_PLUS);

/* 5700 B0 chips do not support checksumming correctly due
* to hardware bugs.
*/
if (tp->pci_chip_rev_id != CHIPREV_ID_5700_B0) {
u32 features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM;

if (tg3_flag(tp, 5755_PLUS))
features |= NETIF_F_IPV6_CSUM;
tp->dev->features |= features;
tp->dev->hw_features |= features;
tp->dev->vlan_features |= features;
}

/* Determine TSO capabilities */
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
; /* Do nothing. HW bug. */
Expand Down Expand Up @@ -14922,7 +14909,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
u32 sndmbx, rcvmbx, intmbx;
char str[40];
u64 dma_mask, persist_dma_mask;
u32 hw_features = 0;
u32 features = 0;

printk_once(KERN_INFO "%s\n", version);

Expand Down Expand Up @@ -14958,8 +14945,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,

SET_NETDEV_DEV(dev, &pdev->dev);

dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;

tp = netdev_priv(dev);
tp->pdev = pdev;
tp->dev = dev;
Expand Down Expand Up @@ -15039,7 +15024,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
if (dma_mask > DMA_BIT_MASK(32)) {
err = pci_set_dma_mask(pdev, dma_mask);
if (!err) {
dev->features |= NETIF_F_HIGHDMA;
features |= NETIF_F_HIGHDMA;
err = pci_set_consistent_dma_mask(pdev,
persist_dma_mask);
if (err < 0) {
Expand All @@ -15060,31 +15045,39 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,

tg3_init_bufmgr_config(tp);

features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;

/* 5700 B0 chips do not support checksumming correctly due
* to hardware bugs.
*/
if (tp->pci_chip_rev_id != CHIPREV_ID_5700_B0) {
features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM;

if (tg3_flag(tp, 5755_PLUS))
features |= NETIF_F_IPV6_CSUM;
}

/* TSO is on by default on chips that support hardware TSO.
* Firmware TSO on older chips gives lower performance, so it
* is off by default, but can be enabled using ethtool.
*/
if ((tg3_flag(tp, HW_TSO_1) ||
tg3_flag(tp, HW_TSO_2) ||
tg3_flag(tp, HW_TSO_3)) &&
(dev->features & NETIF_F_IP_CSUM))
hw_features |= NETIF_F_TSO;
(features & NETIF_F_IP_CSUM))
features |= NETIF_F_TSO;
if (tg3_flag(tp, HW_TSO_2) || tg3_flag(tp, HW_TSO_3)) {
if (dev->features & NETIF_F_IPV6_CSUM)
hw_features |= NETIF_F_TSO6;
if (features & NETIF_F_IPV6_CSUM)
features |= NETIF_F_TSO6;
if (tg3_flag(tp, HW_TSO_3) ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
hw_features |= NETIF_F_TSO_ECN;
features |= NETIF_F_TSO_ECN;
}

dev->hw_features |= hw_features;
dev->features |= hw_features;
dev->vlan_features |= hw_features;

/*
* Add loopback capability only for a subset of devices that support
* MAC-LOOPBACK. Eventually this need to be enhanced to allow INT-PHY
Expand All @@ -15093,7 +15086,11 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5780 &&
!tg3_flag(tp, CPMU_PRESENT))
/* Add the loopback capability */
dev->hw_features |= NETIF_F_LOOPBACK;
features |= NETIF_F_LOOPBACK;

dev->features |= features;
dev->hw_features |= features;
dev->vlan_features |= features;

if (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 &&
!tg3_flag(tp, TSO_CAPABLE) &&
Expand Down

0 comments on commit 14d43f3

Please sign in to comment.