On 03/09/2012 09:41 AM, Wyborny, Carolyn wrote:
>
>
>> -----Original Message-----
>> From: Ben Greear [mailto:[email protected]]
>> Sent: Tuesday, February 21, 2012 4:30 PM
>> To: Wyborny, Carolyn
>> Cc: e1000-devel list
>> Subject: Re: [E1000-devel] Question on igb and rx-fcs.
>>
> [..}
>> But, though I receive packets just fine, I do NOT see the 4 bytes of FCS
>> on
>> the end.
>> [...]
>
> Ben, can you send me an ethregs output on the 82580 after the rx-fcs is 
> enabled but doesn't show up?  I haven't been able to get a system set up yet, 
> so thought it might be faster at this point, if you already have it.

Sent that privately since it's big.

Here is the patch I'm currently testing is below.  It should apply on
top of net-next with my previously sent igb patches applied, but I'm
actually testing this on a 3.3.0-rc6+ kernel with all of my patches
applied.

I also noticed something else strange:  It seems that I *do* get
the FCS when the FCS is corrupted.  That, or my logic that sends
bad FCS isn't actually working as I thought it was.

However, I still do not see any FCS on normal packets.  I'm
going to set up a test to get more info on the bad-fcs packets
thing to see if it's the xmit or the rx logic that is strange.


diff --git a/drivers/net/ethernet/intel/igb/igb_main.c 
b/drivers/net/ethernet/intel/igb/igb_main.c
index a5f6744..693b688 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1772,7 +1772,7 @@ static int igb_set_features(struct net_device *netdev,
         if (changed & NETIF_F_HW_VLAN_RX)
                 igb_vlan_mode(netdev, features);

-       if (!(changed & NETIF_F_RXALL))
+       if (!(changed & (NETIF_F_RXALL | NETIF_F_RXFCS)))
                 return 0;

         netdev->features = features;
@@ -1964,6 +1964,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
         /* copy netdev features into list of user selectable features */
         netdev->hw_features |= netdev->features;
         netdev->hw_features |= NETIF_F_RXALL;
+       netdev->hw_features |= NETIF_F_RXFCS;

         /* set this bit last since it cannot be part of hw_features */
         netdev->features |= NETIF_F_HW_VLAN_FILTER;
@@ -2978,6 +2979,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
  void igb_setup_rctl(struct igb_adapter *adapter)
  {
         struct e1000_hw *hw = &adapter->hw;
+       struct net_device *netdev = adapter->netdev;
         u32 rctl;

         rctl = rd32(E1000_RCTL);
@@ -2993,7 +2995,10 @@ void igb_setup_rctl(struct igb_adapter *adapter)
          * redirection as it did with e1000. Newer features require
          * that the HW strips the CRC.
          */
-       rctl |= E1000_RCTL_SECRC;
+       if (netdev->features & NETIF_F_RXFCS)
+               rctl &= ~E1000_RCTL_SECRC;
+       else
+               rctl |= E1000_RCTL_SECRC;

         /* disable store bad packets and clear size bits. */
         rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
@@ -6139,7 +6144,10 @@ static bool igb_clean_rx_irq(struct igb_q_vector 
*q_vector, int budget)
                 igb_rx_checksum(rx_ring, rx_desc, skb);
                 igb_rx_vlan(rx_ring, rx_desc, skb);

-               total_bytes += skb->len;
+               if (unlikely(rx_ring->netdev->features & NETIF_F_RXFCS))
+                       total_bytes += (skb->len - 4);
+               else
+                       total_bytes += skb->len;
                 total_packets++;

                 skb->protocol = eth_type_trans(skb, rx_ring->netdev);



-- 
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to