Re: [PATCH 2/3] net-next/hinic:performance improvement for HiNIC

From: David Miller
Date: Sat Nov 17 2018 - 15:22:20 EST


From: Xue Chaojing <xuechaojing@xxxxxxxxxx>
Date: Thu, 15 Nov 2018 20:05:47 +0000

> In order to improve performance, this patch adds rx checksum offload
> for the HiNIC driver and optimizes the code. Performance test(Iperf)
> shows more than 95% improvement in TCP streams.
>
> Signed-off-by: Xue Chaojing <xuechaojing@xxxxxxxxxx>

What kind of "optimizes the code" is being done here? Be explicit.

And such unrelated changes to supporting checksum offload should be
split into another patch.

> + csum_err = HINIC_RQ_CQE_STATUS_GET(status, CSUM_ERR);
> +
> + if (!(netdev->features & NETIF_F_RXCSUM))
> + return;
> +
> + if (!csum_err)
> + skb->ip_summed = CHECKSUM_UNNECESSARY;
> + else
> + skb->ip_summed = CHECKSUM_NONE;

Does the CQE status word provide more information? Like the checksum
computed over the packet? That's more useful than a binary "csum correct"
state.

> +#define BIT(nr) (1UL << (nr))

This is unnecessary, please include linux/bits.h and use the definition from
there.