提交 5bf33dc6 编写于 作者: M Matthew Vick 提交者: Jeff Kirsher

fm10k: Implement ndo_features_check

The introduction of ndo_features_check allows drivers to report their
offload capabilities per-skb. Implement this in fm10k to take advantage
of this new functionality.
Reported-by: NJoe Stringer <joestringer@nicira.com>
Signed-off-by: NMatthew Vick <matthew.vick@intel.com>
Tested-by: NKrishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 8c1a90aa
...@@ -439,6 +439,7 @@ extern char fm10k_driver_name[]; ...@@ -439,6 +439,7 @@ extern char fm10k_driver_name[];
extern const char fm10k_driver_version[]; extern const char fm10k_driver_version[];
int fm10k_init_queueing_scheme(struct fm10k_intfc *interface); int fm10k_init_queueing_scheme(struct fm10k_intfc *interface);
void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface); void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface);
__be16 fm10k_tx_encap_offload(struct sk_buff *skb);
netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb, netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,
struct fm10k_ring *tx_ring); struct fm10k_ring *tx_ring);
void fm10k_tx_timeout_reset(struct fm10k_intfc *interface); void fm10k_tx_timeout_reset(struct fm10k_intfc *interface);
......
...@@ -718,7 +718,7 @@ static struct ethhdr *fm10k_gre_is_nvgre(struct sk_buff *skb) ...@@ -718,7 +718,7 @@ static struct ethhdr *fm10k_gre_is_nvgre(struct sk_buff *skb)
return (struct ethhdr *)(&nvgre_hdr->tni); return (struct ethhdr *)(&nvgre_hdr->tni);
} }
static __be16 fm10k_tx_encap_offload(struct sk_buff *skb) __be16 fm10k_tx_encap_offload(struct sk_buff *skb)
{ {
u8 l4_hdr = 0, inner_l4_hdr = 0, inner_l4_hlen; u8 l4_hdr = 0, inner_l4_hdr = 0, inner_l4_hlen;
struct ethhdr *eth_hdr; struct ethhdr *eth_hdr;
......
...@@ -1350,6 +1350,16 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv) ...@@ -1350,6 +1350,16 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv)
} }
} }
static netdev_features_t fm10k_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{
if (!skb->encapsulation || fm10k_tx_encap_offload(skb))
return features;
return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
}
static const struct net_device_ops fm10k_netdev_ops = { static const struct net_device_ops fm10k_netdev_ops = {
.ndo_open = fm10k_open, .ndo_open = fm10k_open,
.ndo_stop = fm10k_close, .ndo_stop = fm10k_close,
...@@ -1372,6 +1382,7 @@ static const struct net_device_ops fm10k_netdev_ops = { ...@@ -1372,6 +1382,7 @@ static const struct net_device_ops fm10k_netdev_ops = {
.ndo_do_ioctl = fm10k_ioctl, .ndo_do_ioctl = fm10k_ioctl,
.ndo_dfwd_add_station = fm10k_dfwd_add_station, .ndo_dfwd_add_station = fm10k_dfwd_add_station,
.ndo_dfwd_del_station = fm10k_dfwd_del_station, .ndo_dfwd_del_station = fm10k_dfwd_del_station,
.ndo_features_check = fm10k_features_check,
}; };
#define DEFAULT_DEBUG_LEVEL_SHIFT 3 #define DEFAULT_DEBUG_LEVEL_SHIFT 3
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册