From: Thomas Falcon <hidden> Date: 2018-03-09 19:24:04
This patch series contains fixes for VLAN and other backing hardware
errata. The VLAN fixes are mostly to account for the additional four
bytes VLAN header in TX descriptors and buffers, when applicable.
The other fixes for device errata are to pad small packets to avoid a
possible connection error that can occur when some devices attempt to
transmit small packets. The other fixes are GSO related. Some devices
cannot handle a smaller MSS or a packet with a single segment, so
disable GSO in those cases.
Thomas Falcon (4):
ibmvnic: Account for VLAN tag in L2 Header descriptor
ibmvnic: Account for VLAN header length in TX buffers
ibmvnic: Pad small packets to minimum MTU size
ibmvnic: Handle TSO backing device errata
drivers/net/ethernet/ibm/ibmvnic.c | 50 +++++++++++++++++++++++++++++++++++---
1 file changed, 46 insertions(+), 4 deletions(-)
--
2.12.3
From: Thomas Falcon <hidden> Date: 2018-03-09 19:24:05
If a VLAN tag is present in the Ethernet header, account
for that when providing the L2 header to firmware.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
From: Thomas Falcon <hidden> Date: 2018-03-09 19:24:08
The extra four bytes of a VLAN packet was throwing off
TX buffer entry values used by the driver. Account for those
bytes when in buffer size and buffer entry calculations
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Thomas Falcon <hidden> Date: 2018-03-09 19:24:10
Some backing devices cannot handle small packets well,
so pad any small packets to avoid that. It was recommended
that the VNIC driver should not send packets smaller than the
minimum MTU value provided by firmware, so pad small packets
to be at least that long.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
@@ -1345,6 +1345,20 @@ static void build_hdr_descs_arr(struct ibmvnic_tx_buff *txbuff,txbuff->indir_arr+1);}+staticintibmvnic_xmit_workarounds(structsk_buff*skb,+structnet_device*netdev)+{+/* For some backing devices, mishandling of small packets+*canresultinalossofconnectionorTXstall.Device+*architectsrecommendthatnopacketshouldbesmaller+*thantheminimumMTUvalueprovidedtothedriver,so+*padanypacketstothatlength+*/+if(skb->len<netdev->min_mtu){+returnskb_put_padto(skb,netdev->min_mtu);+}+}+staticintibmvnic_xmit(structsk_buff*skb,structnet_device*netdev){structibmvnic_adapter*adapter=netdev_priv(netdev);
From: Thomas Falcon <hidden> Date: 2018-03-09 19:24:12
TSO packets with one segment or with an MSS less than 224 can
cause errors on some backing devices, so disable GSO in those cases.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
@@ -2052,6 +2052,23 @@ static int ibmvnic_change_mtu(struct net_device *netdev, int new_mtu)returnwait_for_reset(adapter);}+staticnetdev_features_tibmvnic_features_check(structsk_buff*skb,+structnet_device*dev,+netdev_features_tfeatures)+{+/* Some backing hardware adapters can not+*handlepacketswithaMSSlessthan224+*orwithonlyonesegment.+*/+if(skb_is_gso(skb)){+if(skb_shinfo(skb)->gso_size<224||+skb_shinfo(skb)->gso_segs==1)+features&=~NETIF_F_GSO_MASK;+}++returnfeatures;+}+staticconststructnet_device_opsibmvnic_netdev_ops={.ndo_open=ibmvnic_open,.ndo_stop=ibmvnic_close,
From: David Miller <davem@davemloft.net> Date: 2018-03-12 02:56:17
From: Thomas Falcon <redacted>
Date: Fri, 9 Mar 2018 13:23:56 -0600
quoted hunk
+ /* For some backing devices, mishandling of small packets+ * can result in a loss of connection or TX stall. Device+ * architects recommend that no packet should be smaller+ * than the minimum MTU value provided to the driver, so+ * pad any packets to that length+ */+ if (skb->len < netdev->min_mtu) {+ return skb_put_padto(skb, netdev->min_mtu);+ }
Please do not use curly braces for a single statement
basic block.
Thank you.
From: Thomas Falcon <hidden> Date: 2018-03-12 15:24:58
On 03/11/2018 09:56 PM, David Miller wrote:
From: Thomas Falcon <redacted>
Date: Fri, 9 Mar 2018 13:23:56 -0600
quoted
+ /* For some backing devices, mishandling of small packets+ * can result in a loss of connection or TX stall. Device+ * architects recommend that no packet should be smaller+ * than the minimum MTU value provided to the driver, so+ * pad any packets to that length+ */+ if (skb->len < netdev->min_mtu) {+ return skb_put_padto(skb, netdev->min_mtu);+ }
Please do not use curly braces for a single statement
basic block.
Thank you.
Oops, sorry about that. I'll fix that and resend.
Thanks.