netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Vick, Matthew" <matthew.vick@intel.com>
To: Joe Stringer <joestringer@nicira.com>
Cc: "alexander.duyck@gmail.com" <alexander.duyck@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Dept-GELinuxNICDev@qlogic.com" <Dept-GELinuxNICDev@qlogic.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"sathya.perla@emulex.com" <sathya.perla@emulex.com>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	Linux NICS <Linux-nics@intel.com>,
	"amirv@mellanox.com" <amirv@mellanox.com>,
	"shahed.shaikh@qlogic.com" <shahed.shaikh@qlogic.com>,
	"therbert@google.com" <therbert@google.com>,
	"Or Gerlitz" <gerlitz.or@gmail.com>
Subject: Re: [PATCH net 3/5] fm10k: Implement ndo_gso_check()
Date: Fri, 7 Nov 2014 19:49:38 +0000	[thread overview]
Message-ID: <D0825758.5EC90%matthew.vick@intel.com> (raw)
In-Reply-To: <201411071805.18119.joestringer@nicira.com>

On 11/6/14, 9:05 PM, "Joe Stringer" <joestringer@nicira.com> wrote:

>Let's merge both discussions into one thread (pick here or there). We
>have 
>this suggestion or the one which simply checks for tunnels and
>inner+outer 
>header lengths. Do you have a preference between them?

Agreed with merging the thread--consider it merged!

Reflecting on this some more, I prefer the latter option (checking tunnels
and header lengths). I'm leaning towards pushing the header length check
into fm10k_tx_encap_offload and then making fm10k_gso_check call that with
the gso_type. So, it's really the most recent version of the patch you
proposed:

static bool fm10k_gso_check(struct sk_buff *skb, struct net_device *dev)
{
	if ((skb_shinfo(skb)->gso_type & (SKB_GSO_UDP_TUNNEL | SKB_GSO_GRE)) &&
	    !fm10k_tx_encap_offload(skb))
		return false;

	return true;
}


plus the header length being checked in fm10k_tx_encap_offload. The only
nit would be that I'd just return the conditional instead of having
"return true" or "return false" lines.

The tunnel length check really should be there in fm10k_tx_encap_offload
anyway, so I'll get a patch together for that one.

>We could introduce an "skb_is_gso_encap()" or similar for this purpose.
>Checking for SKB_GSO_UDP_TUNNEL or SKB_GSO_GRE is pretty closely tied to
>what 
>fm10k_tx_encap_offload() checks for though; it might not even make sense
>to call 
>it if some of the other SKB_GSO_* flags are raised.

A fair point. On the other hand, we have to check the header length both
in the GSO and non-GSO cases anyway, so only having the check in
fm10k_tx_encap_offload and calling it from fm10k_gso_check wouldn't be as
duplicative. What do you think about that approach?

As an aside: the more I think about this, the more I think Tom's right and
that each driver really should have it's own ndo_gso_check() for this.
With fm10k and i40e being different, we're already at 40% of the current
drivers being different. I'll leave it to Or to comment on whether the
other drivers could share the check in some manner.

Cheers,
Matthew

  reply	other threads:[~2014-11-07 19:49 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 21:56 [PATCH net 0/5] Implement ndo_gso_check() for vxlan nics Joe Stringer
2014-11-04 21:56 ` [PATCH net 1/5] be2net: Implement ndo_gso_check() Joe Stringer
2014-11-04 21:56 ` [PATCH net 2/5] i40e: " Joe Stringer
2014-11-04 23:45   ` Jesse Gross
2014-11-05 12:37     ` Jeff Kirsher
2014-11-20 19:16     ` Joe Stringer
2014-11-20 20:14       ` Jesse Gross
2014-11-05 12:35   ` Jeff Kirsher
2014-11-04 21:56 ` [PATCH net 3/5] fm10k: " Joe Stringer
2014-11-05 12:34   ` [linux-nics] " Jeff Kirsher
2014-11-05 12:44     ` Or Gerlitz
2014-11-05 12:47       ` Jeff Kirsher
     [not found]         ` <CANr6G5xBehKGVozOAM=m8CXY7Q8_kPu-s5zgwho4=npv=bQsrg@mail.gmail.com>
2014-11-05 19:36           ` Jeff Kirsher
     [not found]             ` <D0814A3F.5EA53%matthew.vick@intel.com>
2014-11-07  0:55               ` Joe Stringer
     [not found]                 ` <D0815B72.5EAF9%matthew.vick@intel.com>
2014-11-07  4:51                   ` Joe Stringer
2014-11-06  2:54   ` Alexander Duyck
2014-11-06 18:41     ` Joe Stringer
2014-11-06 21:15       ` Joe Stringer
2014-11-07  1:07         ` Vick, Matthew
2014-11-07  5:05           ` Joe Stringer
2014-11-07 19:49             ` Vick, Matthew [this message]
2014-11-07 22:35               ` Joe Stringer
2014-11-08  0:51                 ` Vick, Matthew
2014-11-04 21:56 ` [PATCH net 4/5] net/mlx4_en: " Joe Stringer
2014-11-05 12:41   ` Or Gerlitz
2014-11-04 21:56 ` [PATCH net 5/5] qlcnic: " Joe Stringer
2014-11-05  9:17   ` Shahed Shaikh
2014-11-05 12:38 ` [PATCH net 0/5] Implement ndo_gso_check() for vxlan nics Or Gerlitz
     [not found]   ` <CANr6G5xtNYenhd8KDWx+kRcnSZ0fahUdAL+6Wcz=5_dNvrQR6Q@mail.gmail.com>
2014-11-05 18:00     ` Tom Herbert
2014-11-05 21:32       ` Or Gerlitz
2014-11-05 21:38         ` David Miller
2014-11-06  1:06           ` Joe Stringer
2014-11-06  2:15             ` David Miller
2014-11-06  2:44               ` Tom Herbert
2014-11-06  8:23                 ` Or Gerlitz
     [not found]                 ` <CF9D1877D81D214CB0CA0669EFAE020C68CC79EF@CMEXMB1.ad.emulex.com>
2014-11-06 16:06                   ` Tom Herbert
2014-11-06 16:15                     ` Jesse Gross

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=D0825758.5EC90%matthew.vick@intel.com \
    --to=matthew.vick@intel.com \
    --cc=Dept-GELinuxNICDev@qlogic.com \
    --cc=Linux-nics@intel.com \
    --cc=alexander.duyck@gmail.com \
    --cc=amirv@mellanox.com \
    --cc=gerlitz.or@gmail.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=joestringer@nicira.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sathya.perla@emulex.com \
    --cc=shahed.shaikh@qlogic.com \
    --cc=therbert@google.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).