Skip to content

Commit 3a1f6f4

Browse files
committed
Merge branch 'net-xilinx-axienet-partial-checksum-offload-improvements'
Sean Anderson says: ==================== net: xilinx: axienet: Partial checksum offload improvements Partial checksum offload is not always used when it could be. Enable it in more cases. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents d59239f + 736f0c7 commit 3a1f6f4

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

drivers/net/ethernet/xilinx/xilinx_axienet.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,6 @@ struct skbuf_dma_descriptor {
529529
* supported, the maximum frame size would be 9k. Else it is
530530
* 1522 bytes (assuming support for basic VLAN)
531531
* @rxmem: Stores rx memory size for jumbo frame handling.
532-
* @csum_offload_on_tx_path: Stores the checksum selection on TX side.
533-
* @csum_offload_on_rx_path: Stores the checksum selection on RX side.
534532
* @coalesce_count_rx: Store the irq coalesce on RX side.
535533
* @coalesce_usec_rx: IRQ coalesce delay for RX
536534
* @coalesce_count_tx: Store the irq coalesce on TX side.
@@ -609,9 +607,6 @@ struct axienet_local {
609607
u32 max_frm_size;
610608
u32 rxmem;
611609

612-
int csum_offload_on_tx_path;
613-
int csum_offload_on_rx_path;
614-
615610
u32 coalesce_count_rx;
616611
u32 coalesce_usec_rx;
617612
u32 coalesce_count_tx;

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,9 +1188,7 @@ static int axienet_rx_poll(struct napi_struct *napi, int budget)
11881188
csumstatus == XAE_IP_UDP_CSUM_VALIDATED) {
11891189
skb->ip_summed = CHECKSUM_UNNECESSARY;
11901190
}
1191-
} else if ((lp->features & XAE_FEATURE_PARTIAL_RX_CSUM) != 0 &&
1192-
skb->protocol == htons(ETH_P_IP) &&
1193-
skb->len > 64) {
1191+
} else if (lp->features & XAE_FEATURE_PARTIAL_RX_CSUM) {
11941192
skb->csum = be32_to_cpu(cur_p->app3 & 0xFFFF);
11951193
skb->ip_summed = CHECKSUM_COMPLETE;
11961194
}
@@ -2639,38 +2637,28 @@ static int axienet_probe(struct platform_device *pdev)
26392637
if (!ret) {
26402638
switch (value) {
26412639
case 1:
2642-
lp->csum_offload_on_tx_path =
2643-
XAE_FEATURE_PARTIAL_TX_CSUM;
26442640
lp->features |= XAE_FEATURE_PARTIAL_TX_CSUM;
2645-
/* Can checksum TCP/UDP over IPv4. */
2646-
ndev->features |= NETIF_F_IP_CSUM;
2641+
/* Can checksum any contiguous range */
2642+
ndev->features |= NETIF_F_HW_CSUM;
26472643
break;
26482644
case 2:
2649-
lp->csum_offload_on_tx_path =
2650-
XAE_FEATURE_FULL_TX_CSUM;
26512645
lp->features |= XAE_FEATURE_FULL_TX_CSUM;
26522646
/* Can checksum TCP/UDP over IPv4. */
26532647
ndev->features |= NETIF_F_IP_CSUM;
26542648
break;
2655-
default:
2656-
lp->csum_offload_on_tx_path = XAE_NO_CSUM_OFFLOAD;
26572649
}
26582650
}
26592651
ret = of_property_read_u32(pdev->dev.of_node, "xlnx,rxcsum", &value);
26602652
if (!ret) {
26612653
switch (value) {
26622654
case 1:
2663-
lp->csum_offload_on_rx_path =
2664-
XAE_FEATURE_PARTIAL_RX_CSUM;
26652655
lp->features |= XAE_FEATURE_PARTIAL_RX_CSUM;
2656+
ndev->features |= NETIF_F_RXCSUM;
26662657
break;
26672658
case 2:
2668-
lp->csum_offload_on_rx_path =
2669-
XAE_FEATURE_FULL_RX_CSUM;
26702659
lp->features |= XAE_FEATURE_FULL_RX_CSUM;
2660+
ndev->features |= NETIF_F_RXCSUM;
26712661
break;
2672-
default:
2673-
lp->csum_offload_on_rx_path = XAE_NO_CSUM_OFFLOAD;
26742662
}
26752663
}
26762664
/* For supporting jumbo frames, the Axi Ethernet hardware must have

0 commit comments

Comments
 (0)