Signed-off-by: Xiao Jia <[email protected]>
---
 kern/drivers/net/mlx4/en_netdev.c | 2 +-
 kern/drivers/net/mlx4/en_tx.c     | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/kern/drivers/net/mlx4/en_netdev.c 
b/kern/drivers/net/mlx4/en_netdev.c
index e660376..94b3088 100644
--- a/kern/drivers/net/mlx4/en_netdev.c
+++ b/kern/drivers/net/mlx4/en_netdev.c
@@ -2995,7 +2995,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int 
port,
                        NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
                        NETIF_F_HW_VLAN_CTAG_FILTER;
 #else
-       dev->feat = NETIF_F_SG;
+       dev->feat = NETIF_F_SG | NETIF_F_IP_CSUM;
 #endif
        dev->hw_features |= NETIF_F_LOOPBACK |
                        NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
diff --git a/kern/drivers/net/mlx4/en_tx.c b/kern/drivers/net/mlx4/en_tx.c
index 3fa02a4..3f469e9 100644
--- a/kern/drivers/net/mlx4/en_tx.c
+++ b/kern/drivers/net/mlx4/en_tx.c
@@ -830,6 +830,12 @@ netdev_tx_t mlx4_send_packet(struct block *block, struct 
ether *dev)
 
        /* Prepare ctrl segement apart opcode+ownership */
        tx_desc->ctrl.srcrb_flags = priv->ctrl_flags;
+       if (likely(block->flag & BCKSUM_FLAGS)) {
+               if (block->flag & Bipck)
+                       tx_desc->ctrl.srcrb_flags |= 
cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM);
+               if (block->flag & (Budpck | Btcpck))
+                       tx_desc->ctrl.srcrb_flags |= 
cpu_to_be32(MLX4_WQE_CTRL_TCP_UDP_CSUM);
+       }
 
        if (priv->flags & MLX4_EN_FLAG_ENABLE_HW_LOOPBACK) {
                struct ethhdr *ethh;
-- 
2.6.0.rc2.230.g3dd15c0

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to