Re: [PATCH net-next 3/8] net: bcmgenet: use CHECKSUM_COMPLETE for NETIF_F_RXCSUM
From: Jakub Kicinski
Date: Tue Dec 17 2019 - 18:08:58 EST
On Tue, 17 Dec 2019 13:02:24 -0800, Doug Berger wrote:
> @@ -1793,6 +1792,10 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
>
> status = (struct status_64 *)skb->data;
> dma_length_status = status->length_status;
> + if (priv->desc_rxchk_en) {
> + skb->csum = ntohs(status->rx_csum & 0xffff);
This adds a new warning for a W=1 C=1 build:
../drivers/net/ethernet/broadcom/genet/bcmgenet.c:1796:45: warning: cast to res\
tricted __be16
../drivers/net/ethernet/broadcom/genet/bcmgenet.c:1796:45: warning: cast to res\
tricted __be16
../drivers/net/ethernet/broadcom/genet/bcmgenet.c:1796:45: warning: cast to res\
tricted __be16
../drivers/net/ethernet/broadcom/genet/bcmgenet.c:1796:45: warning: cast to res\
tricted __be16
../drivers/net/ethernet/broadcom/genet/bcmgenet.c:1796:43: warning: incorrect t\
ype in assignment (different base types)
../drivers/net/ethernet/broadcom/genet/bcmgenet.c:1796:43: expected restrict\
ed __wsum [usertype] csum
../drivers/net/ethernet/broadcom/genet/bcmgenet.c:1796:43: got int
Could you perhaps consider a __force cast or such?
> + skb->ip_summed = CHECKSUM_COMPLETE;
> + }
> }
>
> /* DMA flags and length are still valid no matter how