Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291565
b: refs/heads/master
c: 3f2d1c0
h: refs/heads/master
i:
  291563: 466476c
v: v3
  • Loading branch information
Ben Greear authored and Jeff Kirsher committed Mar 17, 2012
1 parent 75db58e commit 3ec1924
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 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: f43f313eb7c5f189ff4e27da6cc96ad2e613e333
refs/heads/master: 3f2d1c0f57c6bfad7aacc249fca3514e98a94137
25 changes: 23 additions & 2 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,8 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
struct sk_buff *skb;
unsigned int total_rx_bytes = 0, total_rx_packets = 0;
const int current_node = numa_node_id();
#ifdef IXGBE_FCOE
struct ixgbe_adapter *adapter = q_vector->adapter;
#ifdef IXGBE_FCOE
int ddp_bytes = 0;
#endif /* IXGBE_FCOE */
u16 i;
Expand Down Expand Up @@ -1612,7 +1612,8 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,

/* ERR_MASK will only have valid bits if EOP set */
if (unlikely(ixgbe_test_staterr(rx_desc,
IXGBE_RXDADV_ERR_FRAME_ERR_MASK))) {
IXGBE_RXDADV_ERR_FRAME_ERR_MASK) &&
!(adapter->netdev->features & NETIF_F_RXALL))) {
dev_kfree_skb_any(skb);
goto next_desc;
}
Expand Down Expand Up @@ -3342,6 +3343,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);

/* set all bits that we expect to always be set */
fctrl &= ~IXGBE_FCTRL_SBP; /* disable store-bad-packets */
fctrl |= IXGBE_FCTRL_BAM;
fctrl |= IXGBE_FCTRL_DPF; /* discard pause frames when FC enabled */
fctrl |= IXGBE_FCTRL_PMCF;
Expand Down Expand Up @@ -3390,6 +3392,18 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
IXGBE_WRITE_REG(hw, IXGBE_VMOLR(adapter->num_vfs), vmolr);
}

/* 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 */
fctrl |= (IXGBE_FCTRL_SBP | /* Receive bad packets */
IXGBE_FCTRL_BAM | /* RX All Bcast Pkts */
IXGBE_FCTRL_PMCF); /* RX All MAC Ctrl Pkts */

fctrl &= ~(IXGBE_FCTRL_DPF);
/* NOTE: VLAN filtering is disabled by setting PROMISC */
}

IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);

if (netdev->features & NETIF_F_HW_VLAN_RX)
Expand Down Expand Up @@ -7459,6 +7473,7 @@ static int ixgbe_set_features(struct net_device *netdev,
netdev_features_t data)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
netdev_features_t changed = netdev->features ^ data;
bool need_reset = false;

/* Make sure RSC matches LRO, reset if change */
Expand Down Expand Up @@ -7495,6 +7510,10 @@ static int ixgbe_set_features(struct net_device *netdev,
need_reset = true;
}

if (changed & NETIF_F_RXALL)
need_reset = true;

netdev->features = data;
if (need_reset)
ixgbe_do_reset(netdev);

Expand Down Expand Up @@ -7773,6 +7792,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
break;
}

netdev->hw_features |= NETIF_F_RXALL;

netdev->vlan_features |= NETIF_F_TSO;
netdev->vlan_features |= NETIF_F_TSO6;
netdev->vlan_features |= NETIF_F_IP_CSUM;
Expand Down

0 comments on commit 3ec1924

Please sign in to comment.