diff mbox

[PATCHv2,net,2/2] fm10k: Implement ndo_gso_check()

Message ID 1415921801-10452-2-git-send-email-joestringer@nicira.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Joe Stringer Nov. 13, 2014, 11:36 p.m. UTC
ndo_gso_check() was recently introduced to allow NICs to report the
offloading support that they have on a per-skb basis. Add an
implementation for this driver which checks for something that looks
like VXLAN.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
v2: Reuse fm10k_tx_encap_offload().
---
 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 |    8 ++++++++
 3 files changed, 10 insertions(+), 1 deletion(-)

Comments

Kirsher, Jeffrey T Nov. 13, 2014, 11:41 p.m. UTC | #1
On Thu, 2014-11-13 at 15:36 -0800, Joe Stringer wrote:
> ndo_gso_check() was recently introduced to allow NICs to report the
> offloading support that they have on a per-skb basis. Add an
> implementation for this driver which checks for something that looks
> like VXLAN.
> 
> Signed-off-by: Joe Stringer <joestringer@nicira.com>
> ---
> v2: Reuse fm10k_tx_encap_offload().
> ---
>  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 |    8 ++++++++
>  3 files changed, 10 insertions(+), 1 deletion(-)

Same with this one as well, thanks Joe.
Joe Stringer Nov. 13, 2014, 11:52 p.m. UTC | #2
On Thu, Nov 13, 2014 at 03:41:56PM -0800, Jeff Kirsher wrote:
> On Thu, 2014-11-13 at 15:36 -0800, Joe Stringer wrote:
> > ndo_gso_check() was recently introduced to allow NICs to report the
> > offloading support that they have on a per-skb basis. Add an
> > implementation for this driver which checks for something that looks
> > like VXLAN.
> > 
> > Signed-off-by: Joe Stringer <joestringer@nicira.com>
> > ---
> > v2: Reuse fm10k_tx_encap_offload().
> > ---
> >  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 |    8 ++++++++
> >  3 files changed, 10 insertions(+), 1 deletion(-)
> 
> Same with this one as well, thanks Joe.

Thanks Jeff.

Could you remind me, is the equivalent i40e patch on your queue or were
we still waiting on further feedback from Shannon/Jesse?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kirsher, Jeffrey T Nov. 14, 2014, 12:12 a.m. UTC | #3
On Thu, 2014-11-13 at 15:52 -0800, Joe Stringer wrote:
> On Thu, Nov 13, 2014 at 03:41:56PM -0800, Jeff Kirsher wrote:
> > On Thu, 2014-11-13 at 15:36 -0800, Joe Stringer wrote:
> > > ndo_gso_check() was recently introduced to allow NICs to report
> the
> > > offloading support that they have on a per-skb basis. Add an
> > > implementation for this driver which checks for something that
> looks
> > > like VXLAN.
> > > 
> > > Signed-off-by: Joe Stringer <joestringer@nicira.com>
> > > ---
> > > v2: Reuse fm10k_tx_encap_offload().
> > > ---
> > >  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 |    8 ++++++++
> > >  3 files changed, 10 insertions(+), 1 deletion(-)
> > 
> > Same with this one as well, thanks Joe.
> 
> Thanks Jeff.
> 
> Could you remind me, is the equivalent i40e patch on your queue or
> were
> we still waiting on further feedback from Shannon/Jesse?

Actually, looks like I dropped the patch due to community feedback and
was expecting a v2.  Was I incorrect in doing so?
Joe Stringer Nov. 14, 2014, 12:29 a.m. UTC | #4
On Thursday, November 13, 2014 16:12:39 Jeff Kirsher wrote:
> On Thu, 2014-11-13 at 15:52 -0800, Joe Stringer wrote:
> > On Thu, Nov 13, 2014 at 03:41:56PM -0800, Jeff Kirsher wrote:
> > > On Thu, 2014-11-13 at 15:36 -0800, Joe Stringer wrote:
> > > > ndo_gso_check() was recently introduced to allow NICs to report
> > 
> > the
> > 
> > > > offloading support that they have on a per-skb basis. Add an
> > > > implementation for this driver which checks for something that
> > 
> > looks
> > 
> > > > like VXLAN.
> > > > 
> > > > Signed-off-by: Joe Stringer <joestringer@nicira.com>
> > > > ---
> > > > v2: Reuse fm10k_tx_encap_offload().
> > > > ---
> > > > 
> > > >  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 |    8 ++++++++
> > > >  3 files changed, 10 insertions(+), 1 deletion(-)
> > > 
> > > Same with this one as well, thanks Joe.
> > 
> > Thanks Jeff.
> > 
> > Could you remind me, is the equivalent i40e patch on your queue or
> > were
> > we still waiting on further feedback from Shannon/Jesse?
> 
> Actually, looks like I dropped the patch due to community feedback and
> was expecting a v2.  Was I incorrect in doing so?

That's fine. There were some unresolved questions for what that version should 
look like, but I can repost to start the discussion again.

Cheers,
Joe
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h
index 42eb434..d38f088 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k.h
+++ b/drivers/net/ethernet/intel/fm10k/fm10k.h
@@ -443,6 +443,7 @@  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);
 bool fm10k_check_tx_hang(struct fm10k_ring *tx_ring);
+__be16 fm10k_tx_encap_offload(struct sk_buff *skb);
 void fm10k_alloc_rx_buffers(struct fm10k_ring *rx_ring, u16 cleaned_count);
 
 /* PCI */
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 3a85291..1144e14 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -727,7 +727,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)
 {
 	struct ethhdr *eth_hdr;
 	u8 l4_hdr = 0;
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index 8811364..6e8630a 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -1350,6 +1350,13 @@  static void fm10k_dfwd_del_station(struct net_device *dev, void *priv)
 	}
 }
 
+static bool fm10k_gso_check(struct sk_buff *skb, struct net_device *dev)
+{
+	return (!(skb_shinfo(skb)->gso_type &
+		  (SKB_GSO_UDP_TUNNEL | SKB_GSO_GRE)) ||
+		fm10k_tx_encap_offload(skb));
+}
+
 static const struct net_device_ops fm10k_netdev_ops = {
 	.ndo_open		= fm10k_open,
 	.ndo_stop		= fm10k_close,
@@ -1372,6 +1379,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_gso_check		= fm10k_gso_check,
 };
 
 #define DEFAULT_DEBUG_LEVEL_SHIFT 3