From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Matthew Vick <matthew.vick@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 02/18] fm10k: Implement ndo_features_check
Date: Sat, 28 Feb 2015 03:29:33 -0800 [thread overview]
Message-ID: <1425122989-354-3-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1425122989-354-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Matthew Vick <matthew.vick@intel.com>
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: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/fm10k/fm10k.h | 1 +
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 +-
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 11 +++++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h
index 42eb434..59edfd4 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k.h
+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h
@@ -439,6 +439,7 @@ extern char fm10k_driver_name[];
extern const char fm10k_driver_version[];
int fm10k_init_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,
struct fm10k_ring *tx_ring);
void fm10k_tx_timeout_reset(struct fm10k_intfc *interface);
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index a7d3798..0cb6971b 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -718,7 +718,7 @@ static struct ethhdr *fm10k_gre_is_nvgre(struct sk_buff *skb)
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;
struct ethhdr *eth_hdr;
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index cfde8ba..2a9b467 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -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 = {
.ndo_open = fm10k_open,
.ndo_stop = fm10k_close,
@@ -1372,6 +1382,7 @@ static const struct net_device_ops fm10k_netdev_ops = {
.ndo_do_ioctl = fm10k_ioctl,
.ndo_dfwd_add_station = fm10k_dfwd_add_station,
.ndo_dfwd_del_station = fm10k_dfwd_del_station,
+ .ndo_features_check = fm10k_features_check,
};
#define DEFAULT_DEBUG_LEVEL_SHIFT 3
--
1.9.3
next prev parent reply other threads:[~2015-02-28 11:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-28 11:29 [net-next 00/18][pull request] Intel Wired LAN Driver Updates 2015-02-28 Jeff Kirsher
2015-02-28 11:29 ` [net-next 01/18] fm10k: Modify tunnel length header check when offloading Jeff Kirsher
2015-02-28 11:29 ` Jeff Kirsher [this message]
2015-02-28 11:29 ` [net-next 03/18] fm10k: Resolve various spelling errors and checkpatch warnings Jeff Kirsher
2015-02-28 11:29 ` [net-next 04/18] i40e: Skip the priority tagging if DCB is not enabled Jeff Kirsher
2015-02-28 11:29 ` [net-next 05/18] i40e/i40evf: print FW build number in version string Jeff Kirsher
2015-02-28 11:29 ` [net-next 06/18] i40e: Add safety net for switch calling Jeff Kirsher
2015-02-28 11:29 ` [net-next 07/18] i40e: don't disable PF LB when disabling VFs Jeff Kirsher
2015-02-28 11:29 ` [net-next 08/18] i40e: Enable more than 64 qps for the Main VSI Jeff Kirsher
2015-02-28 11:29 ` [net-next 09/18] i40e/i40evf: Add capability to gather VEB per TC stats Jeff Kirsher
2015-03-01 4:30 ` David Miller
2015-03-03 1:34 ` Jeff Kirsher
2015-02-28 11:29 ` [net-next 10/18] i40e: Add FW check to disable DCB and wrap autoneg workaround with FW check Jeff Kirsher
2015-02-28 11:29 ` [net-next 11/18] i40e: Fix issue with removal of apps from DBCNL app table Jeff Kirsher
2015-02-28 11:29 ` [net-next 12/18] i40e/i40evf: Add missing packet types for VXLAN encapsulated packet types Jeff Kirsher
2015-02-28 11:29 ` [net-next 13/18] i40e: Move RSS table size for VSIs to the VSI struct Jeff Kirsher
2015-02-28 11:29 ` [net-next 14/18] i40e: Fix RSS size at init since default num queue calculation has changed Jeff Kirsher
2015-02-28 11:29 ` [net-next 15/18] i40evf: ethtool RSS fixes Jeff Kirsher
2015-02-28 11:29 ` [net-next 16/18] i40e: Register DCBNL ops in MFP mode Jeff Kirsher
2015-02-28 11:29 ` [net-next 17/18] i40e: Only enable TC0 for NIC partition type Jeff Kirsher
2015-02-28 11:29 ` [net-next 18/18] i40e/i40evf: Bump versions Jeff Kirsher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425122989-354-3-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=matthew.vick@intel.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).