[Intel-wired-lan] [PATCH V2 1/2] ixgbe: Add support for UDP-encapsulated tx checksum offload

Rustad, Mark D mark.d.rustad at intel.com
Fri Jun 12 18:01:40 UTC 2015


> On Jun 11, 2015, at 6:56 PM, Jesse Gross <jesse at nicira.com> wrote:
> 
> On Thu, Jun 11, 2015 at 5:37 PM, Mark D Rustad <mark.d.rustad at intel.com> wrote:
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> index 3bf2f3cfd9f6..64e6bda05da9 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> [...]
>> +#define IXGBE_MAX_TUNNEL_HDR_LEN 80
>> +static netdev_features_t
>> +ixgbe_features_check(struct sk_buff *skb, struct net_device *dev,
>> +                    netdev_features_t features)
>> +{
>> +       if (!skb->encapsulation)
>> +               return features;
>> +
>> +       if (skb_inner_mac_header(skb) - skb_transport_header(skb) >
>> +           IXGBE_MAX_TUNNEL_HDR_LEN)
>> +               return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
>> +
>> +       return features & ~NETIF_F_ALL_TSO;
>> +}
> 
> Thanks, this looks nice. One suggestion - you shouldn't need to remove
> either NETIF_F_GSO_MASK or NETIF_F_ALL_TSO. Since neither of these
> were included in the original encapsulation flags we don't need to
> remove them at this point.

Yes, I was thinking too pedantically as I wrote this. Making that change will take instructions out of the encapsulation hot path, so I will certainly make that change. Maybe I should also put an unlikely around the offset check, since that should be very unlikely to be true.

Thank you so much for your reviews!

--
Mark Rustad, Networking Division, Intel Corporation

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20150612/e75eb40c/attachment.asc>


More information about the Intel-wired-lan mailing list