Skip to content

Commit 7593d76

Browse files
feat(linux): _K3-CPSW-common: Document TX Checksum offload
Add a section documenting the TX Checksum offload feature along with details on the changes to be made in the am65-cpsw-nuss.c driver for inverting a checksum of zero. Signed-off-by: Siddharth Vadapalli <[email protected]>
1 parent d5ee576 commit 7593d76

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

source/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/_K3-CPSW-common.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,39 @@ The Driver enables RX checksum offload by default. It can be disabled/enabled by
8383
8484
ethtool -K <dev> rx-checksum on|off
8585
86+
.. rubric:: TX checksum offload
87+
:name: k3-tx-csum-offload
88+
89+
The Driver enables TX checksum offload by default. It can be disabled/enabled by using ``ethtool -K`` command:
90+
91+
.. code-block:: console
92+
93+
# ethtool -k <dev>
94+
....
95+
tx-checksumming: on
96+
97+
.. code-block:: console
98+
99+
ethtool -K <dev> tx-checksum on|off
100+
101+
A zero checksum is **not** inverted. It is possible to invert a zero checksum for all packets by
102+
updating the :file:`am65-cpsw-nuss.c` driver with the following change:
103+
104+
.. code-block:: diff
105+
106+
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
107+
index 3d378920e65c..89329ddbb231 100644
108+
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
109+
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
110+
@@ -1745,7 +1745,8 @@ static netdev_tx_t am65_cpsw_nuss_ndo_slave_xmit(struct sk_buff *skb,
111+
cs_offset = cs_start + skb->csum_offset;
112+
/* HW numerates bytes starting from 1 */
113+
psdata[2] = ((cs_offset + 1) << 24) |
114+
- ((cs_start + 1) << 16) | (skb->len - cs_start);
115+
+ ((cs_start + 1) << 16) | (skb->len - cs_start)
116+
+ | BIT(15); // BIT(15) enables csum inversion for zero csum
117+
dev_dbg(dev, "%s tx psdata:%#x\n", __func__, psdata[2]);
118+
86119
.. ifconfig:: CONFIG_part_variant in ('AM65X')
87120

88121
.. note::

0 commit comments

Comments
 (0)