i40e: Implement ndo_features_check()
Subsystems (2)
PATCH v2 1/1 i40e: Implement ndo_features_check()
From: Joe Stringer <[email protected]>
i40e supports UDP tunnel headers up to 80 bytes in length, so this adds a check to ensure that it doesn't try to offload packets that exceed that.
---
v2: Move #define above function comment.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +20 -0
@@ -7653,6 +7653,25 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],return err; } +#define I40E_MAX_TUNNEL_HDR_LEN 80 +/** +* i40e_features_check - Validate encapsulated packet conforms to limits +* @skb: skb buff +* @netdev: This physical port's netdev +* @features: Offload features that the stack believes apply +**/ +static netdev_features_t i40e_features_check (struct sk_buff *skb, +struct net_device *dev, +netdev_features_t features) +{ +if (skb->encapsulation && + (skb_inner_mac_header (skb) -skb_transport_header (skb) > +I40E_MAX_TUNNEL_HDR_LEN )) +return features & ~(NETIF_F_ALL_CSUM |NETIF_F_GSO_MASK ); + +return features; +} +static const struct net_device_ops i40e_netdev_ops = { .ndo_open = i40e_open, .ndo_stop = i40e_close,
@@ -7687,6 +7706,7 @@ static const struct net_device_ops i40e_netdev_ops = {#endif .ndo_get_phys_port_id = i40e_get_phys_port_id, .ndo_fdb_add = i40e_ndo_fdb_add, + .ndo_features_check = i40e_features_check, };/**
Signature · 1 line
1.9.1
PATCH v2 1/1 i40e: Implement ndo_features_check()
Quoted 6 lines · Jesse Gross
From: Joe Stringer <[email protected]>
i40e supports UDP tunnel headers up to 80 bytes in length, so this adds a check to ensure that it doesn't try to offload packets that exceed that.
Quoted 7 lines
Signed-off-by Joe Stringer <[email protected]>Signed-off-by Jesse Gross <[email protected]>---
v2: Move #define above function comment.--- drivers/net/ethernet/intel/i40e/i40e_main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
Thanks Jesse and Joe, I have applied your patch to my queue.
--git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
dev-queue
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20150417/fcb5ae89/attachment.asc>
PATCH v2 1/1 i40e: Implement ndo_features_check()
Quoted 15 lines · On Fri, 17 Apr 2015 11:53:00 -0700 Jeff Kirsher <[email protected]>…
Quoted 6 lines · Jesse Gross
From: Joe Stringer <[email protected]>
i40e supports UDP tunnel headers up to 80 bytes in length, so this adds a check to ensure that it doesn't try to offload packets that exceed that.
Quoted 7 lines
Signed-off-by Joe Stringer <[email protected]>Signed-off-by Jesse Gross <[email protected]>---
v2: Move #define above function comment.--- drivers/net/ethernet/intel/i40e/i40e_main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
Quoted 5 lines
Thanks Jesse and Joe, I have applied your patch to my queue. --
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git
dev-queue