All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] ibmvnic: Fix IP offload control buffer
@ 2018-01-19  1:05 Thomas Falcon
  2018-01-19  1:05 ` [PATCH net] ibmvnic: Fix IPv6 packet descriptors Thomas Falcon
  2018-01-19  2:19 ` [PATCH net] ibmvnic: Fix IP offload control buffer David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Falcon @ 2018-01-19  1:05 UTC (permalink / raw)
  To: netdev; +Cc: jallen, nfont, Thomas Falcon

Set some missing fields in the IP control offload buffer. This buffer is
used to enable checksum and TCP segmentation offload in the VNIC server.
The buffer length field and the checksum offloading bits were not set
properly, so fix that here.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index b676fa9..3700bfa 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -3351,7 +3351,11 @@ static void handle_query_ip_offload_rsp(struct ibmvnic_adapter *adapter)
 		return;
 	}
 
+	adapter->ip_offload_ctrl.len =
+	    cpu_to_be32(sizeof(adapter->ip_offload_ctrl));
 	adapter->ip_offload_ctrl.version = cpu_to_be32(INITIAL_VERSION_IOB);
+	adapter->ip_offload_ctrl.ipv4_chksum = buf->ipv4_chksum;
+	adapter->ip_offload_ctrl.ipv6_chksum = buf->ipv6_chksum;
 	adapter->ip_offload_ctrl.tcp_ipv4_chksum = buf->tcp_ipv4_chksum;
 	adapter->ip_offload_ctrl.udp_ipv4_chksum = buf->udp_ipv4_chksum;
 	adapter->ip_offload_ctrl.tcp_ipv6_chksum = buf->tcp_ipv6_chksum;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net] ibmvnic: Fix IPv6 packet descriptors
  2018-01-19  1:05 [PATCH net] ibmvnic: Fix IP offload control buffer Thomas Falcon
@ 2018-01-19  1:05 ` Thomas Falcon
  2018-01-19  1:15   ` Thomas Falcon
  2018-01-19  2:19 ` [PATCH net] ibmvnic: Fix IP offload control buffer David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Falcon @ 2018-01-19  1:05 UTC (permalink / raw)
  To: netdev; +Cc: jallen, nfont, Thomas Falcon

Packet descriptor generation for IPv6 is broken.
Properly set L3 and L4 protocol flags for IPv6 descriptors.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
---
 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;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] ibmvnic: Fix IPv6 packet descriptors
  2018-01-19  1:05 ` [PATCH net] ibmvnic: Fix IPv6 packet descriptors Thomas Falcon
@ 2018-01-19  1:15   ` Thomas Falcon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Falcon @ 2018-01-19  1:15 UTC (permalink / raw)
  To: netdev; +Cc: jallen, nfont

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 <tlfalcon@linux.vnet.ibm.com>

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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] ibmvnic: Fix IP offload control buffer
  2018-01-19  1:05 [PATCH net] ibmvnic: Fix IP offload control buffer Thomas Falcon
  2018-01-19  1:05 ` [PATCH net] ibmvnic: Fix IPv6 packet descriptors Thomas Falcon
@ 2018-01-19  2:19 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-01-19  2:19 UTC (permalink / raw)
  To: tlfalcon; +Cc: netdev, jallen, nfont

From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Thu, 18 Jan 2018 19:05:01 -0600

> Set some missing fields in the IP control offload buffer. This buffer is
> used to enable checksum and TCP segmentation offload in the VNIC server.
> The buffer length field and the checksum offloading bits were not set
> properly, so fix that here.
> 
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-19  2:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19  1:05 [PATCH net] ibmvnic: Fix IP offload control buffer Thomas Falcon
2018-01-19  1:05 ` [PATCH net] ibmvnic: Fix IPv6 packet descriptors Thomas Falcon
2018-01-19  1:15   ` Thomas Falcon
2018-01-19  2:19 ` [PATCH net] ibmvnic: Fix IP offload control buffer David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.