Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300457
b: refs/heads/master
c: e825b73
h: refs/heads/master
i:
  300455: 7984830
v: v3
  • Loading branch information
Ben Greear authored and Jeff Kirsher committed Apr 4, 2012
1 parent e8c8743 commit b970c33
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 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: 68df25d6c556c4df4dad32a0585317eab356e325
refs/heads/master: e825b73182fefe063e887378a75dedbab2656981
26 changes: 25 additions & 1 deletion trunk/drivers/net/ethernet/intel/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,9 +827,10 @@ static int e1000_set_features(struct net_device *netdev,
if (changed & NETIF_F_HW_VLAN_RX)
e1000_vlan_mode(netdev, features);

if (!(changed & NETIF_F_RXCSUM))
if (!(changed & (NETIF_F_RXCSUM | NETIF_F_RXALL)))
return 0;

netdev->features = features;
adapter->rx_csum = !!(features & NETIF_F_RXCSUM);

if (netif_running(netdev))
Expand Down Expand Up @@ -1074,6 +1075,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,

netdev->features |= netdev->hw_features;
netdev->hw_features |= NETIF_F_RXCSUM;
netdev->hw_features |= NETIF_F_RXALL;
netdev->hw_features |= NETIF_F_RXFCS;

if (pci_using_dac) {
Expand Down Expand Up @@ -1841,6 +1843,22 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
break;
}

/* This is useful for sniffing bad packets. */
if (adapter->netdev->features & NETIF_F_RXALL) {
/* UPE and MPE will be handled by normal PROMISC logic
* in e1000e_set_rx_mode */
rctl |= (E1000_RCTL_SBP | /* Receive bad packets */
E1000_RCTL_BAM | /* RX All Bcast Pkts */
E1000_RCTL_PMCF); /* RX All MAC Ctrl Pkts */

rctl &= ~(E1000_RCTL_VFE | /* Disable VLAN filter */
E1000_RCTL_DPF | /* Allow filtered pause */
E1000_RCTL_CFIEN); /* Dis VLAN CFIEN Filter */
/* Do not mess with E1000_CTRL_VME, it affects transmit as well,
* and that breaks VLANs.
*/
}

ew32(RCTL, rctl);
}

Expand Down Expand Up @@ -4057,6 +4075,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
irq_flags);
length--;
} else {
if (netdev->features & NETIF_F_RXALL)
goto process_skb;
/* recycle both page and skb */
buffer_info->skb = skb;
/* an error means any chain goes out the window
Expand All @@ -4069,6 +4089,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
}

#define rxtop rx_ring->rx_skb_top
process_skb:
if (!(status & E1000_RXD_STAT_EOP)) {
/* this descriptor is only the beginning (or middle) */
if (!rxtop) {
Expand Down Expand Up @@ -4276,12 +4297,15 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
flags);
length--;
} else {
if (netdev->features & NETIF_F_RXALL)
goto process_skb;
/* recycle */
buffer_info->skb = skb;
goto next_desc;
}
}

process_skb:
total_rx_bytes += (length - 4); /* don't count FCS */
total_rx_packets++;

Expand Down

0 comments on commit b970c33

Please sign in to comment.