diff mbox

[2/2] qlcnic: set gso_type

Message ID f262d9330d22447ed8fd487ad7b28d668efbf333.1360191528.git.mst@redhat.com
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Michael S. Tsirkin Feb. 6, 2013, 11:02 p.m. UTC
qlcnic set gso_size but not gso type. This leads to crashes
in macvtap.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
This one I only compiled - don't have qlogic hardware.

 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Eric Dumazet Feb. 7, 2013, 3:20 a.m. UTC | #1
On Thu, 2013-02-07 at 01:02 +0200, Michael S. Tsirkin wrote:
> qlcnic set gso_size but not gso type. This leads to crashes
> in macvtap.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> This one I only compiled - don't have qlogic hardware.
> 
>  drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
> index bb4311e..370049c 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
> @@ -1043,8 +1043,13 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
>  	th->seq = htonl(seq_number);
>  	length = skb->len;
>  
> -	if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP)
> +	if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP) {
>  		skb_shinfo(skb)->gso_size = qlcnic_get_lro_sts_mss(sts_data1);
> +		if (skb->protocol == ETH_P_IPV6)

Are you sure its not skb->protocol == htons(ETH_P_IPV6) ?

> +			skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
> +		else
> +			skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
> +	}
>  
>  	if (vid != 0xffff)
>  		__vlan_hwaccel_put_tag(skb, vid);


--
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
Michael S. Tsirkin Feb. 7, 2013, 8:16 a.m. UTC | #2
On Wed, Feb 06, 2013 at 07:20:37PM -0800, Eric Dumazet wrote:
> On Thu, 2013-02-07 at 01:02 +0200, Michael S. Tsirkin wrote:
> > qlcnic set gso_size but not gso type. This leads to crashes
> > in macvtap.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > This one I only compiled - don't have qlogic hardware.
> > 
> >  drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
> > index bb4311e..370049c 100644
> > --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
> > +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
> > @@ -1043,8 +1043,13 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
> >  	th->seq = htonl(seq_number);
> >  	length = skb->len;
> >  
> > -	if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP)
> > +	if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP) {
> >  		skb_shinfo(skb)->gso_size = qlcnic_get_lro_sts_mss(sts_data1);
> > +		if (skb->protocol == ETH_P_IPV6)
> 
> Are you sure its not skb->protocol == htons(ETH_P_IPV6) ?

Um, so it is. It just happens to work correctly for ipv4 :)
I'll respin.

> > +			skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
> > +		else
> > +			skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
> > +	}
> >  
> >  	if (vid != 0xffff)
> >  		__vlan_hwaccel_put_tag(skb, vid);
> 
--
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/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index bb4311e..370049c 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -1043,8 +1043,13 @@  qlcnic_process_lro(struct qlcnic_adapter *adapter,
 	th->seq = htonl(seq_number);
 	length = skb->len;
 
-	if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP)
+	if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP) {
 		skb_shinfo(skb)->gso_size = qlcnic_get_lro_sts_mss(sts_data1);
+		if (skb->protocol == ETH_P_IPV6)
+			skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
+		else
+			skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
+	}
 
 	if (vid != 0xffff)
 		__vlan_hwaccel_put_tag(skb, vid);