RE: [PATCH V6 3/8] net: sxgbe: add TSO support for Samsung sxgbe
flat view
From: Byungho An <bh74.an@samsung.com>
Date: 2014-03-19 18:29:40
Also in:
linux-devicetree, linux-samsung-soc
Rayagond Kokatanur [off-list ref] wrote:
On Wed, Mar 19, 2014 at 11:02 AM, Byungho An [off-list ref] wrote:
[snip]
quoted
/* save the skb address */ tqueue->tx_skbuff[entry] = skb; if (!is_jumbo) { - tx_desc->tdes01 = dma_map_single(priv->device, skb->data, - no_pagedlen,
DMA_TO_DEVICE);
quoted
- if (dma_mapping_error(priv->device, tx_desc->tdes01)) - pr_err("%s: TX dma mapping failed!!\n", __func__); - - priv->hw->desc->prepare_tx_desc(tx_desc, 1, no_pagedlen, - no_pagedlen); + if (likely(skb_is_gso(skb))) { + /* TSO support */ + mss = skb_shinfo(skb)->gso_size; + + priv->hw->desc->tx_ctxt_desc_set_mss(ctxt_desc, mss);No need to issue context descriptor for every TSO packets. Program context
descriptor only if MSS value is value is changed compared
to previous TSO packet MSS value. By this way we can reduce the one extra
descriptor fetch by device and improve the performance. OK. This will be applied in the next post. [snip]
quoted
@@ -1893,7 +1943,9 @@ struct sxgbe_priv_data *sxgbe_dvr_probe(structdevice *device, ndev->netdev_ops = &sxgbe_netdev_ops; - ndev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM; + ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM |
quoted
+ NETIF_F_RXCSUM | NETIF_F_TSO | NETIF_F_TSO6 | + NETIF_F_GRO;Enable TSO only if HW supports, hence we have to check for HW
feature/capability registers here also. OK. Thanks
quoted
ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; ndev->watchdog_timeo = msecs_to_jiffies(TX_TIMEO);@@ -1905,6 +1957,13 @@ struct sxgbe_priv_data *sxgbe_dvr_probe(struct
device *device,
quoted
if (flow_ctrl) priv->flow_ctrl = SXGBE_FLOW_AUTO; /* RX/TX pause on
*/
quoted
+ /* Enable TCP segmentation offload for all DMA channels */ + if (priv->hw_cap.tcpseg_offload) { + SXGBE_FOR_EACH_QUEUE(SXGBE_TX_QUEUES, queue_num) { + priv->hw->dma->enable_tso(priv->ioaddr,
queue_num);
quoted
+ } + } + /* Rx Watchdog is available, enable depend on platform data */ if (!priv->plat->riwt_off) { priv->use_riwt = 1; -- 1.7.10.4 -- 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-- 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