From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Falcon Subject: Re: [PATCH net] ibmvnic: Fix IPv6 packet descriptors Date: Thu, 18 Jan 2018 19:15:10 -0600 Message-ID: <5c83b70a-162d-9bf2-0f5a-3dd9f63d88e6@linux.vnet.ibm.com> References: <1516323902-15852-1-git-send-email-tlfalcon@linux.vnet.ibm.com> <1516323902-15852-2-git-send-email-tlfalcon@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: jallen@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com To: netdev@vger.kernel.org Return-path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41264 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754090AbeASBPO (ORCPT ); Thu, 18 Jan 2018 20:15:14 -0500 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0J1EQ43128519 for ; Thu, 18 Jan 2018 20:15:14 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fk2xngdwn-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 18 Jan 2018 20:15:13 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 18 Jan 2018 20:15:13 -0500 In-Reply-To: <1516323902-15852-2-git-send-email-tlfalcon@linux.vnet.ibm.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/18/2018 07:05 PM, Thomas Falcon wrote: > Packet descriptor generation for IPv6 is broken. > Properly set L3 and L4 protocol flags for IPv6 descriptors. > > Signed-off-by: Thomas Falcon Sorry! Forgot to check for formatting. Please ignore this patch. > --- > drivers/net/ethernet/ibm/ibmvnic.c | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c > index 3700bfa..4bb41cd 100644 > --- a/drivers/net/ethernet/ibm/ibmvnic.c > +++ b/drivers/net/ethernet/ibm/ibmvnic.c > @@ -1281,6 +1281,7 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) > u64 *handle_array; > int index = 0; > int ret = 0; > + u8 proto = 0; > > if (adapter->resetting) { > if (!netif_subqueue_stopped(netdev, skb)) > @@ -1367,18 +1368,19 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) > tx_crq.v1.vlan_id = cpu_to_be16(skb->vlan_tci); > } > > - if (skb->protocol == htons(ETH_P_IP)) { > - if (ip_hdr(skb)->version == 4) > - tx_crq.v1.flags1 |= IBMVNIC_TX_PROT_IPV4; > - else if (ip_hdr(skb)->version == 6) > - tx_crq.v1.flags1 |= IBMVNIC_TX_PROT_IPV6; > - > - if (ip_hdr(skb)->protocol == IPPROTO_TCP) > - tx_crq.v1.flags1 |= IBMVNIC_TX_PROT_TCP; > - else if (ip_hdr(skb)->protocol != IPPROTO_TCP) > - tx_crq.v1.flags1 |= IBMVNIC_TX_PROT_UDP; > + if (skb->protocol == htons(ETH_P_IP)) { > + tx_crq.v1.flags1 |= IBMVNIC_TX_PROT_IPV4; > + proto = ip_hdr(skb)->protocol; > + } else if (skb->protocol == htons(ETH_P_IPV6)) { > + tx_crq.v1.flags1 |= IBMVNIC_TX_PROT_IPV6; > + proto = ipv6_hdr(skb)->nexthdr; > } > > + if (proto == IPPROTO_TCP) > + tx_crq.v1.flags1 |= IBMVNIC_TX_PROT_TCP; > + else if (proto == IPPROTO_UDP) > + tx_crq.v1.flags1 |= IBMVNIC_TX_PROT_UDP; > + > if (skb->ip_summed == CHECKSUM_PARTIAL) { > tx_crq.v1.flags1 |= IBMVNIC_TX_CHKSUM_OFFLOAD; > hdrs += 2;