From patchwork Sun Jan 27 17:36:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AB851390 for ; Sun, 27 Jan 2019 17:36:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 693DB28A72 for ; Sun, 27 Jan 2019 17:36:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D53029F6C; Sun, 27 Jan 2019 17:36:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDF8C28A72 for ; Sun, 27 Jan 2019 17:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbfA0RgP (ORCPT ); Sun, 27 Jan 2019 12:36:15 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:35454 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726930AbfA0RgP (ORCPT ); Sun, 27 Jan 2019 12:36:15 -0500 Received: by mail-lf1-f68.google.com with SMTP id e26so10202499lfc.2 for ; Sun, 27 Jan 2019 09:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kd73bZ7AKCEuKOrg+1QczlJBtttkncjpF7aX0xEIksY=; b=oRvSGKEpCIGZEdD4P4pmcQGLbtQ3xFhykI2lWVi2VcUp2B5iRkCHPTEI7HtRhmk3VE dk2Y8nQmenfpntZUsoD6u3FaqkZSGQjIz/XmKuoQUKB1FaF4uYofIeL+RskrWqMIOk4i pC8r9oN+Pny9yC+iEqbiuXNSBjGbooJ4oBaz8pp12UxeUyxemgrP8Da1rtmKgKnDG/H7 h8QbFtVrsYYUBfTcDbxVabjReklifW1UalT9NzjrlF9SucNOPs3gHaiNWIGeKYvcmEgx 7i9kNPeQkXLrimYKN+vF+rMSTrOe0nipVnPGHyOXGw1PWbLLN112OUTq4SOqo395PLHu p1ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=kd73bZ7AKCEuKOrg+1QczlJBtttkncjpF7aX0xEIksY=; b=MRy4gnhXJgq9SzQOtw97W+xXpghkQmwmHCEXJO7/sOiCqobtPbeUOnCtbb8kg1BUXr byIK3geqUmIYQAdZvh14T1/2wKHLeqVXHgp/kdakie4XO5uaBWv5TLk9EhNUThi4ZaK/ EraMqdIAzwFDZDFglXM6ypAn+pHTn8ehHf7g4LyJJIuNc3IVvaafxOgJodBQhQTcKajw zky2tNBP/1U50VB4wndBX5/xIjhwK1u6YeZHvDFaC84t4zgj96rjDVG8LLbwaBK7Uh6/ oo1LQDpHJOqDf8+Ps6Db6J0pLBFTI1+0ezShTboF+QLP8jML6pPUr9GjlWZzf73VqRhz MpHA== X-Gm-Message-State: AJcUuke4sJgtknMXNrkG1Dfd5PAGbqA8gpk8tURAKlQOgzCTtiMxQBSz Cd9GvsUiKczOKVTPrZfvGLmUXWvojgA= X-Google-Smtp-Source: ALg8bN6wYAy6ZuoyqhdWTjkadRVlZRCC7C0HV7imTtJ533E5mUNGBOkMmYRKtSbopHfbwWKFM4IGeQ== X-Received: by 2002:a19:ced3:: with SMTP id e202mr15016133lfg.13.1548610572330; Sun, 27 Jan 2019 09:36:12 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id u65sm2678360lff.54.2019.01.27.09.36.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:36:11 -0800 (PST) Subject: [PATCH 1/7] sh_eth: rename sh_eth_cpu_data::hw_checksum From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: Date: Sun, 27 Jan 2019 20:36:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 62e04b7e0e3c ("sh_eth: rename 'sh_eth_cpu_data::hw_crc'") renamed the field to 'hw_checksum' for the Ether DMAC "intelligent checksum", however some Ether MACs implement a simpler checksumming scheme, so that name now seems misleading. Rename that filed to 'csmr' as the "intelligent checkmum" is always controlled by the CSMR register. Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven --- drivers/net/ethernet/renesas/sh_eth.c | 14 +++++++------- drivers/net/ethernet/renesas/sh_eth.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -555,7 +555,7 @@ static int sh_eth_soft_reset_gether(stru sh_eth_write(ndev, 0, RDFFR); /* Reset HW CRC register */ - if (mdp->cd->hw_checksum) + if (mdp->cd->csmr) sh_eth_write(ndev, 0, CSMR); /* Select MII mode */ @@ -619,7 +619,7 @@ static struct sh_eth_cpu_data r7s72100_d .no_trimd = 1, .no_ade = 1, .xdfar_rw = 1, - .hw_checksum = 1, + .csmr = 1, .tsu = 1, .no_tx_cntrs = 1, }; @@ -668,7 +668,7 @@ static struct sh_eth_cpu_data r8a7740_da .no_trimd = 1, .no_ade = 1, .xdfar_rw = 1, - .hw_checksum = 1, + .csmr = 1, .tsu = 1, .select_mii = 1, .magic = 1, @@ -793,7 +793,7 @@ static struct sh_eth_cpu_data r8a77980_d .no_trimd = 1, .no_ade = 1, .xdfar_rw = 1, - .hw_checksum = 1, + .csmr = 1, .select_mii = 1, .magic = 1, .cexcr = 1, @@ -1045,7 +1045,7 @@ static struct sh_eth_cpu_data sh7734_dat .no_ade = 1, .xdfar_rw = 1, .tsu = 1, - .hw_checksum = 1, + .csmr = 1, .select_mii = 1, .magic = 1, .cexcr = 1, @@ -1633,7 +1633,7 @@ static int sh_eth_rx(struct net_device * * the RFS bits are from bit 25 to bit 16. So, the * driver needs right shifting by 16. */ - if (mdp->cd->hw_checksum) + if (mdp->cd->csmr) desc_status >>= 16; skb = mdp->rx_skbuff[entry]; @@ -2173,7 +2173,7 @@ static size_t __sh_eth_get_regs(struct n add_reg(MAFCR); if (cd->rtrate) add_reg(RTRATE); - if (cd->hw_checksum) + if (cd->csmr) add_reg(CSMR); if (cd->select_mii) add_reg(RMII_MII); Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -499,7 +499,7 @@ struct sh_eth_cpu_data { unsigned no_ade:1; /* E-DMAC DOES NOT have ADE bit in EESR */ unsigned no_xdfar:1; /* E-DMAC DOES NOT have RDFAR/TDFAR */ unsigned xdfar_rw:1; /* E-DMAC has writeable RDFAR/TDFAR */ - unsigned hw_checksum:1; /* E-DMAC has CSMR */ + unsigned csmr:1; /* E-DMAC has CSMR */ unsigned select_mii:1; /* EtherC has RMII_MII (MII select register) */ unsigned rmiimode:1; /* EtherC has RMIIMODE register */ unsigned rtrate:1; /* EtherC has RTRATE register */ From patchwork Sun Jan 27 17:37:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 789166C2 for ; Sun, 27 Jan 2019 17:37:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EB62294CA for ; Sun, 27 Jan 2019 17:37:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 511C129FE7; Sun, 27 Jan 2019 17:37:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84DDD294CA for ; Sun, 27 Jan 2019 17:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbfA0Rhi (ORCPT ); Sun, 27 Jan 2019 12:37:38 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38279 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbfA0Rhi (ORCPT ); Sun, 27 Jan 2019 12:37:38 -0500 Received: by mail-lj1-f196.google.com with SMTP id c19-v6so12246719lja.5 for ; Sun, 27 Jan 2019 09:37:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+OPgEEmQMA4QDlmXE8Cj6PmumWTVij50Xc1NgEDFbGM=; b=U3bCyJWzoEI7vKkGAV1UH0v5e4HEvHWcZ2/v9U5uj9OO/xSZFlwMqcRO2DbsRl0o9/ mHVZaRbFRyR3RjE5vwhC52Pl5cs0hCQAyHvOMlf/IwiGWeLaV8o+sjivIAXuOfE/RdsA kyaM0NoQSGIKHNBQgRDQTTQfCcXmLT30cHTIcVg5JEM7HUlIpw21WSwIDCwTn53RJ5bd rX+ILWpDnE0oqo+BVg2HPEIDwS41Mke9nFN9I19tIezVDCTnokof6jWos1M4chq87Rei PK47QqYMp3TbYHrPChYcsMpu3Aw8b91AgMiReHOKfVJWkpjmmrTYkFfC/0WB4f1/Y1JZ yctA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=+OPgEEmQMA4QDlmXE8Cj6PmumWTVij50Xc1NgEDFbGM=; b=ONf/I+MJsFXo3HqRLWbq0RYNWj+WZHXWbratOUSbUaQhF6fEeID+/DZ8tfJo9Sfciy iFSqhXV8/iT9kPJjF6nYWl7LdLaehF/mwUjWaR0SVr3Kf3okjvq/Gz3LPfYlHjzfrKE/ t9umKNv8EtPpMFX5B0JN3l8gpEbgAt2cBLShxQIAaGnzezS+QXZMgE3lhYwFCOjYLpyw GSnxelEp4IWk1N1gtSWzOlFY0SBqPLhp3T2uUG9JfHlc9+7Gy+oUIkogbSilIp0PUiFm JevDBESCedJNGqkMU4pMLw2yGaB8PQQbRX0dsq49nLAlAc4Ah5jax05tZJ5cG7m0eTbo q4WQ== X-Gm-Message-State: AJcUukfzyoa1B5tY3jYrCkCCeq+V7ZyBs9QqIcbJ2IkSJN8SVvu9KyzW Be/1Wa5i2O16sNpSWmBtM9cSMqf8cvw= X-Google-Smtp-Source: ALg8bN471JG5RmZNUq0cII/vavj3lt4RL6/3y3ds1D+nyFGYnEskd+F9OL6fE925SaD81+weX8njSg== X-Received: by 2002:a2e:9ad0:: with SMTP id p16-v6mr15182695ljj.102.1548610654559; Sun, 27 Jan 2019 09:37:34 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id q23sm2497091lfm.82.2019.01.27.09.37.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:37:34 -0800 (PST) Subject: [PATCH 2/7] sh_eth: RX checksum offload support From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: <29cb4d33-37c3-43c0-3bce-fa01737c0fa4@cogentembedded.com> Date: Sun, 27 Jan 2019 20:37:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for the RX checksum offload. This is enabled by default and may be disabled and re-enabled using 'ethtool': # ethtool -K eth0 rx {on|off} Some Ether MACs provide a simple checksumming scheme which appears to be completely compatible with CHECKSUM_COMPLETE: sum of all packet data after the L2 header is appended to packet data; this may be trivially read by the driver and used to update the skb accordingly. The same checksumming scheme is implemented in the EtherAVB MACs and now supported by tha 'ravb' driver. In terms of performance, throughput is close to gigabit line rate with the RX checksum offload both enabled and disabled. The 'perf' output, however, appears to indicate that significantly less time is spent in do_csum() -- this is as expected. Test results with RX checksum offload enabled: ~/netperf-2.2pl4# perf record -a ./netperf -t TCP_MAERTS -H 192.168.2.4 TCP MAERTS TEST to 192.168.2.4 Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 131072 16384 16384 10.01 933.93 [ perf record: Woken up 8 times to write data ] [ perf record: Captured and wrote 1.955 MB perf.data (41940 samples) ] ~/netperf-2.2pl4# perf report Samples: 41K of event 'cycles:ppp', Event count (approx.): 9915302763 Overhead Command Shared Object Symbol 9.44% netperf [kernel.kallsyms] [k] __arch_copy_to_user 7.75% swapper [kernel.kallsyms] [k] _raw_spin_unlock_irq 6.31% swapper [kernel.kallsyms] [k] default_idle_call 5.89% swapper [kernel.kallsyms] [k] arch_cpu_idle 4.37% swapper [kernel.kallsyms] [k] tick_nohz_idle_exit 4.02% netperf [kernel.kallsyms] [k] _raw_spin_unlock_irq 2.52% netperf [kernel.kallsyms] [k] preempt_count_sub 1.81% netperf [kernel.kallsyms] [k] tcp_recvmsg 1.80% netperf [kernel.kallsyms] [k] _raw_spin_unlock_irqres 1.78% netperf [kernel.kallsyms] [k] preempt_count_add 1.36% netperf [kernel.kallsyms] [k] __tcp_transmit_skb 1.20% netperf [kernel.kallsyms] [k] __local_bh_enable_ip 1.10% netperf [kernel.kallsyms] [k] sh_eth_start_xmit Test results with RX checksum offload disabled: ~/netperf-2.2pl4# perf record -a ./netperf -t TCP_MAERTS -H 192.168.2.4 TCP MAERTS TEST to 192.168.2.4 Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 131072 16384 16384 10.01 932.04 [ perf record: Woken up 14 times to write data ] [ perf record: Captured and wrote 3.642 MB perf.data (78817 samples) ] ~/netperf-2.2pl4# perf report Samples: 78K of event 'cycles:ppp', Event count (approx.): 18091442796 Overhead Command Shared Object Symbol 7.00% swapper [kernel.kallsyms] [k] do_csum 3.94% swapper [kernel.kallsyms] [k] sh_eth_poll 3.83% ksoftirqd/0 [kernel.kallsyms] [k] do_csum 3.23% swapper [kernel.kallsyms] [k] _raw_spin_unlock_irq 2.87% netperf [kernel.kallsyms] [k] __arch_copy_to_user 2.86% swapper [kernel.kallsyms] [k] arch_cpu_idle 2.13% swapper [kernel.kallsyms] [k] default_idle_call 2.12% ksoftirqd/0 [kernel.kallsyms] [k] sh_eth_poll 2.02% swapper [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore 1.84% swapper [kernel.kallsyms] [k] __softirqentry_text_start 1.64% swapper [kernel.kallsyms] [k] tick_nohz_idle_exit 1.53% netperf [kernel.kallsyms] [k] _raw_spin_unlock_irq 1.32% netperf [kernel.kallsyms] [k] preempt_count_sub 1.27% swapper [kernel.kallsyms] [k] __pi___inval_dcache_area 1.22% swapper [kernel.kallsyms] [k] check_preemption_disabled 1.01% ksoftirqd/0 [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore The above results collected on the R-Car V3H Starter Kit board. Based on the commit 4d86d3818627 ("ravb: RX checksum offload")... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 60 ++++++++++++++++++++++++++++++++-- drivers/net/ethernet/renesas/sh_eth.h | 1 2 files changed, 59 insertions(+), 2 deletions(-) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1532,8 +1532,9 @@ static int sh_eth_dev_init(struct net_de mdp->irq_enabled = true; sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); - /* PAUSE Prohibition */ + /* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */ sh_eth_write(ndev, ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | + (ndev->features & NETIF_F_RXCSUM ? ECMR_RCSC : 0) | ECMR_TE | ECMR_RE, ECMR); if (mdp->cd->set_rate) @@ -1592,6 +1593,19 @@ static void sh_eth_dev_exit(struct net_d update_mac_address(ndev); } +static void sh_eth_rx_csum(struct sk_buff *skb) +{ + u8 *hw_csum; + + /* The hardware checksum is 2 bytes appended to packet data */ + if (unlikely(skb->len < sizeof(__sum16))) + return; + hw_csum = skb_tail_pointer(skb) - sizeof(__sum16); + skb->csum = csum_unfold((__force __sum16)get_unaligned_le16(hw_csum)); + skb->ip_summed = CHECKSUM_COMPLETE; + skb_trim(skb, skb->len - sizeof(__sum16)); +} + /* Packet receive function */ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota) { @@ -1666,6 +1680,8 @@ static int sh_eth_rx(struct net_device * DMA_FROM_DEVICE); skb_put(skb, pkt_len); skb->protocol = eth_type_trans(skb, ndev); + if (ndev->features & NETIF_F_RXCSUM) + sh_eth_rx_csum(skb); netif_receive_skb(skb); ndev->stats.rx_packets++; ndev->stats.rx_bytes += pkt_len; @@ -2921,6 +2937,39 @@ static void sh_eth_set_rx_mode(struct ne spin_unlock_irqrestore(&mdp->lock, flags); } +static void sh_eth_set_rx_csum(struct net_device *ndev, bool enable) +{ + struct sh_eth_private *mdp = netdev_priv(ndev); + unsigned long flags; + + spin_lock_irqsave(&mdp->lock, flags); + + /* Disable TX and RX */ + sh_eth_rcv_snd_disable(ndev); + + /* Modify RX Checksum setting */ + sh_eth_modify(ndev, ECMR, ECMR_RCSC, enable ? ECMR_RCSC : 0); + + /* Enable TX and RX */ + sh_eth_rcv_snd_enable(ndev); + + spin_unlock_irqrestore(&mdp->lock, flags); +} + +static int sh_eth_set_features(struct net_device *ndev, + netdev_features_t features) +{ + netdev_features_t changed = ndev->features ^ features; + struct sh_eth_private *mdp = netdev_priv(ndev); + + if (changed & NETIF_F_RXCSUM && mdp->cd->rx_csum) + sh_eth_set_rx_csum(ndev, features & NETIF_F_RXCSUM); + + ndev->features = features; + + return 0; +} + static int sh_eth_get_vtag_index(struct sh_eth_private *mdp) { if (!mdp->port) @@ -3102,6 +3151,7 @@ static const struct net_device_ops sh_et .ndo_change_mtu = sh_eth_change_mtu, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr, + .ndo_set_features = sh_eth_set_features, }; static const struct net_device_ops sh_eth_netdev_ops_tsu = { @@ -3117,6 +3167,7 @@ static const struct net_device_ops sh_et .ndo_change_mtu = sh_eth_change_mtu, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr, + .ndo_set_features = sh_eth_set_features, }; #ifdef CONFIG_OF @@ -3245,6 +3296,11 @@ static int sh_eth_drv_probe(struct platf ndev->max_mtu = 2000 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN); ndev->min_mtu = ETH_MIN_MTU; + if (mdp->cd->rx_csum) { + ndev->features = NETIF_F_RXCSUM; + ndev->hw_features = NETIF_F_RXCSUM; + } + /* set function */ if (mdp->cd->tsu) ndev->netdev_ops = &sh_eth_netdev_ops_tsu; @@ -3294,7 +3350,7 @@ static int sh_eth_drv_probe(struct platf goto out_release; } mdp->port = port; - ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER; + ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; /* Need to init only the first port of the two sharing a TSU */ if (port == 0) { Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -500,6 +500,7 @@ struct sh_eth_cpu_data { unsigned no_xdfar:1; /* E-DMAC DOES NOT have RDFAR/TDFAR */ unsigned xdfar_rw:1; /* E-DMAC has writeable RDFAR/TDFAR */ unsigned csmr:1; /* E-DMAC has CSMR */ + unsigned rx_csum:1; /* EtherC has ECMR.RCSC */ unsigned select_mii:1; /* EtherC has RMII_MII (MII select register) */ unsigned rmiimode:1; /* EtherC has RMIIMODE register */ unsigned rtrate:1; /* EtherC has RTRATE register */ From patchwork Sun Jan 27 17:38:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BD661390 for ; Sun, 27 Jan 2019 17:38:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C21D294CA for ; Sun, 27 Jan 2019 17:38:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 806EF29F6C; Sun, 27 Jan 2019 17:38:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EF65294CA for ; Sun, 27 Jan 2019 17:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726930AbfA0Rih (ORCPT ); Sun, 27 Jan 2019 12:38:37 -0500 Received: from mail-lj1-f173.google.com ([209.85.208.173]:36505 "EHLO mail-lj1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726967AbfA0Rih (ORCPT ); Sun, 27 Jan 2019 12:38:37 -0500 Received: by mail-lj1-f173.google.com with SMTP id g11-v6so12266562ljk.3 for ; Sun, 27 Jan 2019 09:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aHyVNCcWCeqcw7MfnB1A7u/ATcPWbzDNG8u18WnCJZo=; b=d8HNhCYqCTc5R7TZKUYzVXqFfPspdTkh0Py4OgB+IpxTbsvj7oGmbPaCN/Kacci31r OH7SbvPP3Rsj4Nr/ozz42HK9tL54iwbj1BItGLDY2cshGmk6A2SNFpu+4rFW/l4F6iJ1 dXQhucPj2PpyvdyPu0bHKXk8qHpwmKx1CMIdRTQLdhz00XP8bVEqcv7arA6j2Ucwbg7J Z4tgAQpC1G1X4QD6hGnWtegpVok5TrgQ63qeWzQAyx8+myU/KkfDQjG0d3deQO4RCnET EXQHNWSpsT8bNZmJMogK+xOvzpwv/A+jnVDZ2t5Vrnbexr2RkZjyMZcy0pFueNfLovZn FipA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=aHyVNCcWCeqcw7MfnB1A7u/ATcPWbzDNG8u18WnCJZo=; b=VUUid8+JFxZqDpdBtFVMuWBQ2yN855Xs1sy4ml/vqhWB210Fd4kMT8ceiorBc4N7aQ ohnOtznwMTSrcABJm/y4WzYi6AQArOHYwPBOCB6bdae6voaJYrTue69uhLlKmzrlU/7F Uqv/I9sNU+Xxh1tDq60LlSQNGDuISHcQtwodbo+sphEkxeeOp/k2WMP/V0tWFxW5q38m GqTys9r+Evs3vNopdBZuxZm4eU2RcVNsKV+SF40zc+me+G9DU3tykisn+vTbF9QtPYfw YzXejdlD3Z2NC/cP3AuP8lbvEPy8z6/sT0jVQ1PVpwAJf/sAD4yyo3/s/OJLwPH4Nz2d tbMw== X-Gm-Message-State: AJcUukd+JlEU+xseYKjJWUDKAtjfoaagO4N7vPu0V11ynwOiq29eL5bC ihHSTZkYkSyxMepp9yIuDb8GgmzGDDA= X-Google-Smtp-Source: ALg8bN7UOhxEoDtAnGFEpy4wwLXhcvd75ZOcttVkysG8aQ5hSuA5tSD/Ss70L5HzWdwpohNvUZo5DQ== X-Received: by 2002:a2e:131a:: with SMTP id 26-v6mr14279788ljt.107.1548610714576; Sun, 27 Jan 2019 09:38:34 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id j138sm2573355lfg.64.2019.01.27.09.38.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:38:33 -0800 (PST) Subject: [PATCH 3/7] sh_eth: offload RX checksum on R7S72100 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: <0476beba-ea1f-7675-aa08-573b74e84f4e@cogentembedded.com> Date: Sun, 27 Jan 2019 20:38:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The RZ/A1H (R7S721000) SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MACs... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -620,6 +620,7 @@ static struct sh_eth_cpu_data r7s72100_d .no_ade = 1, .xdfar_rw = 1, .csmr = 1, + .rx_csum = 1, .tsu = 1, .no_tx_cntrs = 1, }; From patchwork Sun Jan 27 17:39:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782953 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0F8B6C2 for ; Sun, 27 Jan 2019 17:39:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C16132A597 for ; Sun, 27 Jan 2019 17:39:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B52562A5A2; Sun, 27 Jan 2019 17:39:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73E3F2A597 for ; Sun, 27 Jan 2019 17:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbfA0Rja (ORCPT ); Sun, 27 Jan 2019 12:39:30 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42146 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726979AbfA0Rj3 (ORCPT ); Sun, 27 Jan 2019 12:39:29 -0500 Received: by mail-lf1-f68.google.com with SMTP id l10so10169556lfh.9 for ; Sun, 27 Jan 2019 09:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Z+qVVsyJBLplm6bGaJBQWS/1LQRYqWLc8ZoZXm/b/XU=; b=EEH5gCCt2TcI2CQgEUDUw2ErI3aKFzT9XdfWk5bSCzbVA4oe5H7maEIl2NL+44t2CV yRj5pgXEGMPWJP3ciFRSprsNum4QjhpawSoef4rGoWhFsK0WdrcePDzm9DyJJlouB0rG UvoOcLmS8oYqlq+ZRvEJIWQdBPx9fJ0hoSTFAoL8CioU2+5Rce0fFrPA+/BvhFt70/qf biUBnvrkrZ3Al4g8k0p9rCV0Iby3SdVd3YSl0NgLHHy86dcWb10qsxwIRTOtbTu0/n2w Acf0gVgzP6xMPgXoa/k7kKp2YeF4EbeJTwguS2lQRTeuPSdCJjLktpyZ/MkAWGDA0sq2 SI4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Z+qVVsyJBLplm6bGaJBQWS/1LQRYqWLc8ZoZXm/b/XU=; b=PNM7euAyuiuomYtu9Yld2hdHU+7I9ukS8qVKk/soLZyAD1KmdR0rORBFOma4iERkIc RsejueP4xQlH/U8IdLFkafQ3T2yf/21JLK8QC6p0b4ZWHuZUoIYJ2jPPgvPXHcf82ebX qssxNdXKBmK3Rxr6Vz3txqOvT3n2q/TnJZBZ00dcoNZULRdCKn96041Nm/VPi6n7ozmx H33jNJA0ZFZx5X7qBHd9LbTNG9qAePeGu+jtrfh2C7+NNneE2/wkVPpc7IyKRs4IqDK0 CpPmBIErwvJhNdvXDoPcAuu62uXkillkxnjhwALJDhxkSMx3u/yhzkRRd00Qt4EQfRYW YlEA== X-Gm-Message-State: AJcUukeuWk3p0JsbJnhS0c5u6E7gz+H7tbB1hm0ARAj6yU4bNVzWyBql oYD+xRx6GusWQnO8/yyKqIHEoWln160= X-Google-Smtp-Source: ALg8bN6IJz/2MCmb/nKHXnOrtHpbukN+QpG5KO0yRRPqIIuXRLlYsrwfShvVBjuUfUS8yxfYa9E2OA== X-Received: by 2002:a19:a9d2:: with SMTP id s201mr8866754lfe.154.1548610767030; Sun, 27 Jan 2019 09:39:27 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id z2-v6sm2670667ljk.50.2019.01.27.09.39.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:39:26 -0800 (PST) Subject: [PATCH 4/7] sh_eth: offload RX checksum on R8A7740 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: Date: Sun, 27 Jan 2019 20:39:25 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The R-Mobile A1 (R8A7740) SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MAC... Signed-off-by: Sergei Shtylyov Tested-by: Geert Uytterhoeven --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -670,6 +670,7 @@ static struct sh_eth_cpu_data r8a7740_da .no_ade = 1, .xdfar_rw = 1, .csmr = 1, + .rx_csum = 1, .tsu = 1, .select_mii = 1, .magic = 1, From patchwork Sun Jan 27 17:40:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E2881823 for ; Sun, 27 Jan 2019 17:40:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FE0B2A597 for ; Sun, 27 Jan 2019 17:40:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 242FB2A5A2; Sun, 27 Jan 2019 17:40:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABE8E2A59B for ; Sun, 27 Jan 2019 17:40:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbfA0Rk1 (ORCPT ); Sun, 27 Jan 2019 12:40:27 -0500 Received: from mail-lj1-f170.google.com ([209.85.208.170]:40252 "EHLO mail-lj1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbfA0Rk1 (ORCPT ); Sun, 27 Jan 2019 12:40:27 -0500 Received: by mail-lj1-f170.google.com with SMTP id n18-v6so12242152lji.7 for ; Sun, 27 Jan 2019 09:40:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ao08bhATJPPJEJ2i7oY65jvyZ15tEsZMfg8UyfvAdIY=; b=oG+nKj0HsX0LBaT6NjwIXuTKcRa0lZZiAWsLkezwPdrkh/GhcA1iz/ynLP5jz7n2Kt VC/oq0dO76T3V6+zc7U1mibqTfVOX6rA9qsHCPqWkTfCRi4IDX+tg46AfHiftpXUsBHb Gce2rcjg4mhHBC0dwHTqy9Kmn4X+p3aQfggsulYfmMIB87FYk3o1CPV3nU5KrFmbO7Vu 54WcfS25pRqlpCuj2NEARf32xgpHgUkkmVSg5PpLEx71oVRky1B6qaN53SBduPf/zrfu AjRNuGdaLHQovqv/1VRV0xDVKJsmlaxpDxI5tBpQI+zsgswiYXVlgJYm9Ua2Xg3oZK27 kGfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Ao08bhATJPPJEJ2i7oY65jvyZ15tEsZMfg8UyfvAdIY=; b=D0xBWV+t7vTUjDwbnRYbJWBeJibItBaaVMr/EPR2d/WVeZAho7mj7GcdR7M2vbchsi ZCNCo1VZ3WbzbDaagOl1orqwvRq5sxzSfhJsvgxoqnfzFzLJnHBOHSlfvkR5wQ0izLe7 RL1TXDUF8aUN3EpZF5mwf1opgFiHRj/HAkGVn0k7DPNtzC0H+1Z/cAreUx9Xci2yMLnq cEsIpsurRA1n2SYFkj4TStJXNlx0J6lPW10wadWwkdbK3Uq4WV8+GtJbNjUNW/g4M7qi 2pTYHGrc57R9ieTiBfhLZoR7YlyfMqTyU5wYfmnOCTsCuy+AzElvbq5XoFWIzBMTQMbM Izzg== X-Gm-Message-State: AHQUAuZqVRkqKc+5W2gKiw+BdxtbR41gJ9s6HZM+0VhubQ0lMMt524df 0Fd8YFUKCNxkwpOjqkGAlyo5c+ArtQ0= X-Google-Smtp-Source: AHgI3IYv0zscDvy1aCFtUh0oUE0KIWMXwWn1lL21OMQLdj+zinbt1Z/wvp31TySswr3UfJV9jGY5Kg== X-Received: by 2002:a2e:7c13:: with SMTP id x19-v6mr5162800ljc.83.1548610824968; Sun, 27 Jan 2019 09:40:24 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id s127sm2602874lfe.8.2019.01.27.09.40.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:40:24 -0800 (PST) Subject: [PATCH 5/7] sh_eth: offload RX checksum on R8A77980 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: <32f4bec9-35e6-6bbe-f9b6-a8996fc0793d@cogentembedded.com> Date: Sun, 27 Jan 2019 20:40:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The R-Car V3H (R8A77980) SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MAC... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -796,6 +796,7 @@ static struct sh_eth_cpu_data r8a77980_d .no_ade = 1, .xdfar_rw = 1, .csmr = 1, + .rx_csum = 1, .select_mii = 1, .magic = 1, .cexcr = 1, From patchwork Sun Jan 27 17:41:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 366191390 for ; Sun, 27 Jan 2019 17:41:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26A582A59B for ; Sun, 27 Jan 2019 17:41:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 182C92A5A4; Sun, 27 Jan 2019 17:41:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1E432A59B for ; Sun, 27 Jan 2019 17:41:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbfA0Rl2 (ORCPT ); Sun, 27 Jan 2019 12:41:28 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:44617 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbfA0Rl2 (ORCPT ); Sun, 27 Jan 2019 12:41:28 -0500 Received: by mail-lf1-f65.google.com with SMTP id z13so10180358lfe.11 for ; Sun, 27 Jan 2019 09:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=liwjm9ze8qxoGKXwexudNjirVwtaRClbT1XeBLQwbv8=; b=mmznrsRr8CY+RKYrzcfzIlkwsO8c+ADsv0+imGOyrCMQz1/LCiCHQKcopzT8hI9RaD Gq1yENHlsg0yE15AX/fOO4c6uQulsJYfciDFSaXw8I5SDJyUjNmPA1F6X8PNW09gJqvH 4rdlX5SNhceKTb6vryW68LEN9Ryci7wdUbRxqpi0iDlRskd1NWXuPAldutUZhHu2aHv0 w+pUsXkHN99AcgsnClzGtJbPfCmxQbjXbGEIXmG5UWpyGBcbFEHPX27k7oUC/gU3XzDL vOAHml2HDI7XQwNNz6OgGptYOhlx8eGLbT/8B0tD5kqZwPIqwyehKRoQPePbaqBFaeKN 5luw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=liwjm9ze8qxoGKXwexudNjirVwtaRClbT1XeBLQwbv8=; b=BzbBvqBq5T4Ptmoj4eCfphVcQMWOssBBbVcIMvWERI4P+2vSKCVbyJGehhiSnIicqp 8tgiKfw+imSCcaq5op8jkil0D6SHlcDxoawgOsuCwzcyvhbP4hcz5mMXPXLv2S7txWq+ efqAmjAhMiimCPOku53Y3in99vZt/nCOow6504sLDDBlUHfWHHm17+RBnPbF57QLu1Fp IW69c5ODhKb1v9qm/6PEy+8ib7Ubd6mWC7mQP2alLkwfB+cg6qzj1r2K6UVxw7Wq1Hlw +BHitU+H1ximpZ73YRyGaAg0NpI1ma9ITm4g30QxqYYrVh39bL/5rjL92bxwosPusygn M1Vw== X-Gm-Message-State: AJcUukdIDK6zSJ1DsOwOBKywRfiqe95H1Y+bj0runa5GwE0A88QTr1FL nxETlWNQKXZfRHouq71PsZ9KfKw68Ao= X-Google-Smtp-Source: ALg8bN6vuKKAzehf73W2AHTxZP850Lrjs6GOw/In9ngClJDX87BoWL7KWCN4phAPe87bfHk95M9tGA== X-Received: by 2002:a19:750a:: with SMTP id y10mr3771742lfe.43.1548610885827; Sun, 27 Jan 2019 09:41:25 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id j12-v6sm2619597ljh.66.2019.01.27.09.41.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:41:25 -0800 (PST) Subject: [PATCH 6/7] sh_eth: offload RX checksum on SH7734 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: Date: Sun, 27 Jan 2019 20:41:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SH7734 SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MACs... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1049,6 +1049,7 @@ static struct sh_eth_cpu_data sh7734_dat .xdfar_rw = 1, .tsu = 1, .csmr = 1, + .rx_csum = 1, .select_mii = 1, .magic = 1, .cexcr = 1, From patchwork Sun Jan 27 17:42:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10782965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 208871823 for ; Sun, 27 Jan 2019 17:42:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1290A2A59B for ; Sun, 27 Jan 2019 17:42:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06D112A5A4; Sun, 27 Jan 2019 17:42:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B107A2A59B for ; Sun, 27 Jan 2019 17:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbfA0RmQ (ORCPT ); Sun, 27 Jan 2019 12:42:16 -0500 Received: from mail-lj1-f179.google.com ([209.85.208.179]:45647 "EHLO mail-lj1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726630AbfA0RmQ (ORCPT ); Sun, 27 Jan 2019 12:42:16 -0500 Received: by mail-lj1-f179.google.com with SMTP id s5-v6so12216997ljd.12 for ; Sun, 27 Jan 2019 09:42:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BYbSDIH705JTQdZk8auJnmv7JIjM4wJP9hknZKvmNxQ=; b=DpNPCNWFp91Qx1x5CtrC0h2qKndmZsMEUQvG5dl4cDXSed9vnQLM0IvwiEbmGFbVbc NviCv7+uxPiXtZEDx4witWflks6u8vTlw3HAiqLuQ9aI0e66d8L5slwCUzMuEgYjdq2X qhbk4k8LX+y18dGJFgz14ROTvfXYdp/LCLQJ0X6CCb07o3lQKSZO8f5PCQvTTihzLnTA rwzWXWRYh0EyhMyWWaYfV66i84aNPbIv52YBiSzUa8crTYBGlmARxIiD5nGluRXsBPs0 VJY5pxpWuUYpVf6FGlFcgyfKZ3Yh+segdyocCZby8QinryvTn59X+P3frBdBg8sU5aG3 rnuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=BYbSDIH705JTQdZk8auJnmv7JIjM4wJP9hknZKvmNxQ=; b=RUo/W3qElBz4SlFSxsLjY82npiMJWZCC8Pjprf5xf7FD1KL0Rz+H3THm8zTDDNgYFE Q+gNQlF4NaQMtE5QWKDUSLXYH6Xx6hjcFNBeYUShqOfW8ts4XBwiTRoDqbzzs9z8bSjA TE2gG42Ze1E4PVt+mcSjBVlbSVRtM1zsfxctWhovfJBN//Hfnt+uyHHqMe/g3CNAYMtu 0JEiKnR2hWdFEp0+mz7miVamZg6c04VFaDPXFhCtldbE9lBQPn+HIncRk+sNyy0nosz2 SUrryhU4bkXmCB/hqTboSv9L7LS1eDfH9lyTf6n/niQjF6rLt6z7VoHTdD2a6NocLASC +AEQ== X-Gm-Message-State: AJcUukfelzEjBZGgzA0D4Gx+1cbI5fhVDpmkXSHX+dcCkYuk99N5iv1u 3KvgCNvxvvT7wDqhzj6ad4KXc8vB2os= X-Google-Smtp-Source: ALg8bN6elgr9PuZFYkjNP37T8EtrQfeF9EsxjQEpHQYhKClnQV+1SnPLUdWraYIRdgzwwRUUljdItw== X-Received: by 2002:a2e:20c3:: with SMTP id g64-v6mr15099809lji.101.1548610934326; Sun, 27 Jan 2019 09:42:14 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.84.150]) by smtp.gmail.com with ESMTPSA id b17sm2523107lfc.21.2019.01.27.09.42.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 09:42:13 -0800 (PST) Subject: [PATCH 7/7] sh_eth: offload RX checksum on SH7763 From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org References: Organization: Cogent Embedded Message-ID: Date: Sun, 27 Jan 2019 20:42:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-MW Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SH7763 SoC manual describes the Ether MAC's RX checksum offload the same way as it's implemented in the EtherAVB MACs... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 1 + 1 file changed, 1 insertion(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1092,6 +1092,7 @@ static struct sh_eth_cpu_data sh7763_dat .irq_flags = IRQF_SHARED, .magic = 1, .cexcr = 1, + .rx_csum = 1, .dual_port = 1, };