* Re: [PATCH net-next 0/3] cls_flower: Offload unmasked key
From: David Miller @ 2020-06-19 20:12 UTC (permalink / raw)
To: satish.d
Cc: jhs, xiyou.wangcong, jiri, kuba, netdev, simon.horman, kesavac,
prathibha.nagooru, intiyaz.basha, jai.rana
In-Reply-To: <20200619094156.31184-1-satish.d@oneconvergence.com>
You are giving no context on what hardware and with what driver
your changes make a difference for.
This kind of context and information is required in order for
anyone to understand your changes.
We're not accepting these changes until you explain all of this.
Thank you.
^ permalink raw reply
* Re: [PATCH 1/1] net: ethernet: oki-semi: pch_gbe: fix spelling mistake
From: David Miller @ 2020-06-19 20:09 UTC (permalink / raw)
To: f.suligoi; +Cc: kuba, netdev, linux-kernel
In-Reply-To: <20200619091811.28651-1-f.suligoi@asem.it>
From: Flavio Suligoi <f.suligoi@asem.it>
Date: Fri, 19 Jun 2020 11:18:11 +0200
> Fix typo: "Triger" --> "Trigger"
>
> Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1] net: ethernet: neterion: vxge: fix spelling mistake
From: David Miller @ 2020-06-19 20:09 UTC (permalink / raw)
To: f.suligoi
Cc: jdmason, kuba, ast, daniel, hawk, john.fastabend, wei.zheng,
netdev, linux-kernel, bpf
In-Reply-To: <20200619090204.27503-1-f.suligoi@asem.it>
From: Flavio Suligoi <f.suligoi@asem.it>
Date: Fri, 19 Jun 2020 11:02:04 +0200
> Fix typo: "trigered" --> "triggered"
>
> Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
Applied.
^ permalink raw reply
* Re: pull request (net): ipsec 2020-06-19
From: David Miller @ 2020-06-19 20:04 UTC (permalink / raw)
To: steffen.klassert; +Cc: herbert, netdev
In-Reply-To: <20200619074342.14095-1-steffen.klassert@secunet.com>
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Fri, 19 Jun 2020 09:43:37 +0200
> 1) Fix double ESP trailer insertion in IPsec crypto offload if
> netif_xmit_frozen_or_stopped is true. From Huy Nguyen.
>
> 2) Merge fixup for "remove output_finish indirection from
> xfrm_state_afinfo". From Stephen Rothwell.
>
> 3) Select CRYPTO_SEQIV for ESP as this is needed for GCM and several
> other encryption algorithms. Also modernize the crypto algorithm
> selections for ESP and AH, remove those that are maked as "MUST NOT"
> and add those that are marked as "MUST" be implemented in RFC 8221.
> From Eric Biggers.
>
> Please note the merge conflict between commit:
>
> a7f7f6248d97 ("treewide: replace '---help---' in Kconfig files with 'help'")
>
> from Linus' tree and commits:
>
> 7d4e39195925 ("esp, ah: consolidate the crypto algorithm selections")
> be01369859b8 ("esp, ah: modernize the crypto algorithm selections")
>
> from the ipsec tree.
>
> Please pull or let me know if there are problems.
Pulled, thanks a lot.
^ permalink raw reply
* Re: [PATCH 1/2] docs: net: ieee802154: change link to new project URL
From: David Miller @ 2020-06-19 19:56 UTC (permalink / raw)
To: stefan; +Cc: netdev, linux-wpan, alex.aring
In-Reply-To: <c8631876-8aea-c56d-105e-6866c74964ce@datenfreihafen.org>
From: Stefan Schmidt <stefan@datenfreihafen.org>
Date: Fri, 19 Jun 2020 09:14:22 +0200
> I see you marked both patches here as awaiting upstream in
> patchwork. I am not really sure what to do best now. Am I supposed to
> pick them up myself and send them in my usual ieee802154 pull request?
>
> Before you had been picking up docs and MAINTAINERS patches
> directly. I am fine with either way. Just want to check what you
> expect.
Please put it into a pull request, thank you.
^ permalink raw reply
* Re: [net 0/4][pull request] Intel Wired LAN Driver Updates 2020-06-18
From: David Miller @ 2020-06-19 19:55 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann
In-Reply-To: <20200619062210.3159291-1-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 18 Jun 2020 23:22:06 -0700
> This series contains fixes to ixgbe, i40e and ice driver.
>
> Ciara fixes up the ixgbe, i40e and ice drivers to protect access when
> allocating and freeing the rings. In addition, made use of READ_ONCE
> when reading the rings prior to accessing the statistics pointer.
>
> Björn fixes a crash where the receive descriptor ring allocation was
> moved to a different function, which broke the ethtool set_ringparam()
> hook.
>
> The following are changes since commit 0ad6f6e767ec2f613418cbc7ebe5ec4c35af540c:
> net: increment xmit_recursion level in dev_direct_xmit()
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue 40GbE
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [v2,net-next] net: qos offload add flow status with dropped count
From: David Miller @ 2020-06-19 19:54 UTC (permalink / raw)
To: po.liu
Cc: linux-kernel, netdev, jiri, vinicius.gomes, vlad, claudiu.manoil,
vladimir.oltean, alexandru.marginean, michael.chan, vishal,
saeedm, leon, jiri, idosch, alexandre.belloni, UNGLinuxDriver,
kuba, jhs, xiyou.wangcong, simon.horman, pablo, moshe,
m-karicheri2, andre.guedes, stephen
In-Reply-To: <20200619060107.6325-1-po.liu@nxp.com>
From: Po Liu <po.liu@nxp.com>
Date: Fri, 19 Jun 2020 14:01:07 +0800
> From: Po Liu <Po.Liu@nxp.com>
>
> This patch adds a drop frames counter to tc flower offloading.
> Reporting h/w dropped frames is necessary for some actions.
> Some actions like police action and the coming introduced stream gate
> action would produce dropped frames which is necessary for user. Status
> update shows how many filtered packets increasing and how many dropped
> in those packets.
>
> v2: Changes
> - Update commit comments suggest by Jiri Pirko.
>
> Signed-off-by: Po Liu <Po.Liu@nxp.com>
Applied, thank you.
^ permalink raw reply
* Re: [Patch net] cgroup: fix cgroup_sk_alloc() for sk_clone_lock()
From: Cong Wang @ 2020-06-19 19:51 UTC (permalink / raw)
To: Zefan Li
Cc: Roman Gushchin, Linux Kernel Network Developers,
Cameron Berkenpas, Peter Geis, Lu Fengqi, Daniël Sonck,
Daniel Borkmann, Tejun Heo
In-Reply-To: <4f17229e-1843-5bfc-ea2f-67ebaa9056da@huawei.com>
On Thu, Jun 18, 2020 at 11:40 PM Zefan Li <lizefan@huawei.com> wrote:
>
> On 2020/6/19 5:09, Cong Wang wrote:
> > On Thu, Jun 18, 2020 at 12:36 PM Roman Gushchin <guro@fb.com> wrote:
> >>
> >> On Thu, Jun 18, 2020 at 12:19:13PM -0700, Cong Wang wrote:
> >>> On Wed, Jun 17, 2020 at 6:44 PM Zefan Li <lizefan@huawei.com> wrote:
> >>>>
> >>>> Cc: Roman Gushchin <guro@fb.com>
> >>>>
> >>>> Thanks for fixing this.
> >>>>
> >>>> On 2020/6/17 2:03, Cong Wang wrote:
> >>>>> When we clone a socket in sk_clone_lock(), its sk_cgrp_data is
> >>>>> copied, so the cgroup refcnt must be taken too. And, unlike the
> >>>>> sk_alloc() path, sock_update_netprioidx() is not called here.
> >>>>> Therefore, it is safe and necessary to grab the cgroup refcnt
> >>>>> even when cgroup_sk_alloc is disabled.
> >>>>>
> >>>>> sk_clone_lock() is in BH context anyway, the in_interrupt()
> >>>>> would terminate this function if called there. And for sk_alloc()
> >>>>> skcd->val is always zero. So it's safe to factor out the code
> >>>>> to make it more readable.
> >>>>>
> >>>>> Fixes: 090e28b229af92dc5b ("netprio_cgroup: Fix unlimited memory leak of v2 cgroups")
> >>>>
> >>>> but I don't think the bug was introduced by this commit, because there
> >>>> are already calls to cgroup_sk_alloc_disable() in write_priomap() and
> >>>> write_classid(), which can be triggered by writing to ifpriomap or
> >>>> classid in cgroupfs. This commit just made it much easier to happen
> >>>> with systemd invovled.
> >>>>
> >>>> I think it's 4bfc0bb2c60e2f4c ("bpf: decouple the lifetime of cgroup_bpf from cgroup itself"),
> >>>> which added cgroup_bpf_get() in cgroup_sk_alloc().
> >>>
> >>> Good point.
> >>>
> >>> I take a deeper look, it looks like commit d979a39d7242e06
> >>> is the one to blame, because it is the first commit that began to
> >>> hold cgroup refcnt in cgroup_sk_alloc().
> >>
> >> I agree, ut seems that the issue is not related to bpf and probably
> >> can be reproduced without CONFIG_CGROUP_BPF. d979a39d7242e06 indeed
> >> seems closer to the origin.
> >
> > Yeah, I will update the Fixes tag and send V2.
> >
>
> Commit d979a39d7242e06 looks innocent to me. With this commit when cgroup_sk_alloc
> is disabled and then a socket is cloned the cgroup refcnt will not be incremented,
> but this is fine, because when the socket is to be freed:
>
> sk_prot_free()
> cgroup_sk_free()
> cgroup_put(sock_cgroup_ptr(skcd)) == cgroup_put(&cgrp_dfl_root.cgrp)
>
> cgroup_put() does nothing for the default root cgroup, so nothing bad will happen.
But skcd->val can be a pointer to a non-root cgroup:
static inline struct cgroup *sock_cgroup_ptr(struct sock_cgroup_data *skcd)
{
#if defined(CONFIG_CGROUP_NET_PRIO) || defined(CONFIG_CGROUP_NET_CLASSID)
unsigned long v;
/*
* @skcd->val is 64bit but the following is safe on 32bit too as we
* just need the lower ulong to be written and read atomically.
*/
v = READ_ONCE(skcd->val);
if (v & 1)
return &cgrp_dfl_root.cgrp;
return (struct cgroup *)(unsigned long)v ?: &cgrp_dfl_root.cgrp;
#else
return (struct cgroup *)(unsigned long)skcd->val;
#endif
}
^ permalink raw reply
* Re: [PATCH][next] net: dsa: sja1105: Use struct_size() in kzalloc()
From: Vladimir Oltean @ 2020-06-19 19:38 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
Jakub Kicinski, lkml, netdev, Gustavo A. R. Silva
In-Reply-To: <20200619181007.GA32353@embeddedor>
Hi Gustavo,
On Fri, 19 Jun 2020 at 21:04, Gustavo A. R. Silva <gustavoars@kernel.org> wrote:
>
> Make use of the struct_size() helper instead of an open-coded version
> in order to avoid any potential type mistakes.
>
> This code was detected with the help of Coccinelle and, audited and
> fixed manually.
>
> Addresses-KSPP-ID: https://github.com/KSPP/linux/issues/83
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> drivers/net/dsa/sja1105/sja1105_tas.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/dsa/sja1105/sja1105_tas.c b/drivers/net/dsa/sja1105/sja1105_tas.c
> index 3aa1a8b5f766..31d8acff1f01 100644
> --- a/drivers/net/dsa/sja1105/sja1105_tas.c
> +++ b/drivers/net/dsa/sja1105/sja1105_tas.c
> @@ -475,8 +475,7 @@ bool sja1105_gating_check_conflicts(struct sja1105_private *priv, int port,
> if (list_empty(&gating_cfg->entries))
> return false;
>
> - dummy = kzalloc(sizeof(struct tc_taprio_sched_entry) * num_entries +
> - sizeof(struct tc_taprio_qopt_offload), GFP_KERNEL);
> + dummy = kzalloc(struct_size(dummy, entries, num_entries), GFP_KERNEL);
Before, I could read this line and I knew what it did. Now, I have to
look it up.
But if it's in the interest of kernel coding style, what can I say.
Acked-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> if (!dummy) {
> NL_SET_ERR_MSG_MOD(extack, "Failed to allocate memory");
> return true;
> --
> 2.27.0
>
^ permalink raw reply
* [PATCH] [net/sched] Remove redundant skb null check
From: Gaurav Singh @ 2020-06-19 19:24 UTC (permalink / raw)
To: gaurav1086, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
David S. Miller, Jakub Kicinski, open list:TC subsystem,
open list
In-Reply-To: <20200618014328.28668-1-gaurav1086@gmail.com>
Remove the redundant null check for skb.
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
---
net/sched/act_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 8ac7eb0a8309..90be8fe9128c 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -1475,7 +1475,7 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n,
{
struct net *net = sock_net(skb->sk);
struct nlattr *tca[TCA_ROOT_MAX + 1];
- u32 portid = skb ? NETLINK_CB(skb).portid : 0;
+ u32 portid = NETLINK_CB(skb).portid;
int ret = 0, ovr = 0;
if ((n->nlmsg_type != RTM_GETACTION) &&
--
2.17.1
^ permalink raw reply related
* [PATCH/RFC 2/5] ravb: Split delay handling in parsing and applying
From: Geert Uytterhoeven @ 2020-06-19 19:15 UTC (permalink / raw)
To: Sergei Shtylyov, David S . Miller, Jakub Kicinski, Rob Herring
Cc: Andrew Lunn, Oleksij Rempel, Philippe Schenker, Florian Fainelli,
Heiner Kallweit, Kazuya Mizuguchi, Wolfram Sang, netdev,
devicetree, linux-renesas-soc, Geert Uytterhoeven
In-Reply-To: <20200619191554.24942-1-geert+renesas@glider.be>
Currently, full delay handling is done in both the probe and resume
paths. Split it in two parts, so the resume path doesn't have to redo
the parsing part over and over again.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/net/ethernet/renesas/ravb.h | 4 +++-
drivers/net/ethernet/renesas/ravb_main.c | 21 ++++++++++++++++-----
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h
index 9f88b5db4f89843a..e5ca12ce93c730a9 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -1036,7 +1036,9 @@ struct ravb_private {
unsigned no_avb_link:1;
unsigned avb_link_active_low:1;
unsigned wol_enabled:1;
- int num_tx_desc; /* TX descriptors per packet */
+ unsigned rxcidm:1; /* RX Clock Internal Delay Mode */
+ unsigned txcidm:1; /* TX Clock Internal Delay Mode */
+ int num_tx_desc; /* TX descriptors per packet */
};
static inline u32 ravb_read(struct net_device *ndev, enum ravb_reg reg)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index a442bcf64b9cd875..f326234d1940f43e 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1967,23 +1967,32 @@ static const struct soc_device_attribute ravb_delay_mode_quirk_match[] = {
};
/* Set tx and rx clock internal delay modes */
-static void ravb_set_delay_mode(struct net_device *ndev)
+static void ravb_parse_delay_mode(struct net_device *ndev)
{
struct ravb_private *priv = netdev_priv(ndev);
- int set = 0;
if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
priv->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID)
- set |= APSR_DM_RDM;
+ priv->rxcidm = true;
if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
priv->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) {
if (!WARN(soc_device_match(ravb_delay_mode_quirk_match),
"phy-mode %s requires TX clock internal delay mode which is not supported by this hardware revision. Please update device tree",
phy_modes(priv->phy_interface)))
- set |= APSR_DM_TDM;
+ priv->txcidm = true;
}
+}
+static void ravb_set_delay_mode(struct net_device *ndev)
+{
+ struct ravb_private *priv = netdev_priv(ndev);
+ u32 set = 0;
+
+ if (priv->rxcidm)
+ set |= APSR_DM_RDM;
+ if (priv->txcidm)
+ set |= APSR_DM_TDM;
ravb_modify(ndev, APSR, APSR_DM, set);
}
@@ -2116,8 +2125,10 @@ static int ravb_probe(struct platform_device *pdev)
/* Request GTI loading */
ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI);
- if (priv->chip_id != RCAR_GEN2)
+ if (priv->chip_id != RCAR_GEN2) {
+ ravb_parse_delay_mode(ndev);
ravb_set_delay_mode(ndev);
+ }
/* Allocate descriptor base address table */
priv->desc_bat_size = sizeof(struct ravb_desc) * DBAT_ENTRY_NUM;
--
2.17.1
^ permalink raw reply related
* [PATCH/RFC 4/5] arm64: dts: renesas: rcar-gen3: Convert EtherAVB to explicit delay handling
From: Geert Uytterhoeven @ 2020-06-19 19:15 UTC (permalink / raw)
To: Sergei Shtylyov, David S . Miller, Jakub Kicinski, Rob Herring
Cc: Andrew Lunn, Oleksij Rempel, Philippe Schenker, Florian Fainelli,
Heiner Kallweit, Kazuya Mizuguchi, Wolfram Sang, netdev,
devicetree, linux-renesas-soc, Geert Uytterhoeven
In-Reply-To: <20200619191554.24942-1-geert+renesas@glider.be>
Some EtherAVB variants support internal clock delay configuration, which
can add larger delays than the delays that are typically supported by
the PHY (using an "rgmii-*id" PHY mode, and/or "[rt]xc-skew-ps"
properties).
Historically, the EtherAVB driver configured these delays based on the
"rgmii-*id" PHY mode. This was wrong, as these are meant solely for the
PHY, not for the MAC. Hence properties were introduced for explicit
configuration of these delays.
Convert the R-Car Gen3 DTS files from the old to the new scheme:
- Add default "renesas,rxc-delay-ps" and "renesas,txc-delay-ps"
properties to the SoC .dtsi files, to be overridden by board files
where needed,
- Convert board files from "rgmii-*id" PHY modes to "rgmii", adding
the appropriate "renesas,rxc-delay-ps" and/or "renesas,txc-delay-ps"
overrides.
Notes:
- R-Car E3 and D3 do not support TX internal delay handling,
- On R-Car D3, TX internal delay handling must always be enabled,
hence this fixes a bug on Draak,
- On R-Car V3H, RX internal delay handling must always be enabled.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "[PATCH/RFC 3/5] ravb: Add support for explicit internal
clock delay configuration" and must not be applied before that
dependency has hit upstream.
---
arch/arm64/boot/dts/renesas/r8a77951.dtsi | 2 ++
arch/arm64/boot/dts/renesas/r8a77960.dtsi | 2 ++
arch/arm64/boot/dts/renesas/r8a77961.dtsi | 2 ++
arch/arm64/boot/dts/renesas/r8a77965.dtsi | 2 ++
arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 3 ++-
arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts | 3 ++-
arch/arm64/boot/dts/renesas/r8a77970.dtsi | 2 ++
arch/arm64/boot/dts/renesas/r8a77980.dtsi | 2 ++
arch/arm64/boot/dts/renesas/r8a77990.dtsi | 1 +
arch/arm64/boot/dts/renesas/r8a77995.dtsi | 1 +
arch/arm64/boot/dts/renesas/salvator-common.dtsi | 2 +-
arch/arm64/boot/dts/renesas/ulcb.dtsi | 2 +-
12 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/renesas/r8a77951.dtsi b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
index 61d67d9714ab9531..c303bab0d6125351 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77951.dtsi
@@ -1250,6 +1250,8 @@
power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <0>;
iommus = <&ipmmu_ds0 16>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77960.dtsi b/arch/arm64/boot/dts/renesas/r8a77960.dtsi
index 33bf62acffbb73d2..cabe38bb74dde7b9 100644
--- a/arch/arm64/boot/dts/renesas/r8a77960.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77960.dtsi
@@ -1126,6 +1126,8 @@
power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <0>;
iommus = <&ipmmu_ds0 16>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77961.dtsi b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
index 760e738b75b3da9a..1fd6412e7c2b0fce 100644
--- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
@@ -923,6 +923,8 @@
power-domains = <&sysc R8A77961_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <0>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
diff --git a/arch/arm64/boot/dts/renesas/r8a77965.dtsi b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
index 6f7ab39fd2824b46..bed63cbed490ce2d 100644
--- a/arch/arm64/boot/dts/renesas/r8a77965.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
@@ -988,6 +988,8 @@
power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <0>;
iommus = <&ipmmu_ds0 16>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
index ac2156ab3e626174..88b3a78c796295fd 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
@@ -81,7 +81,8 @@
renesas,no-ether-link;
phy-handle = <&phy0>;
- phy-mode = "rgmii-id";
+ renesas,rxc-delay-ps = <1800>;
+ renesas,txc-delay-ps = <2000>;
status = "okay";
phy0: ethernet-phy@0 {
diff --git a/arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts b/arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts
index 01c4ba0f7be1caff..548e2b02f327ba45 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77970-v3msk.dts
@@ -102,7 +102,8 @@
renesas,no-ether-link;
phy-handle = <&phy0>;
- phy-mode = "rgmii-id";
+ renesas,rxc-delay-ps = <1800>;
+ renesas,txc-delay-ps = <2000>;
status = "okay";
phy0: ethernet-phy@0 {
diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
index bd95ecb1b40d8f4d..c759396ffbe7e446 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
@@ -615,6 +615,8 @@
power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <0>;
iommus = <&ipmmu_rt 3>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77980.dtsi b/arch/arm64/boot/dts/renesas/r8a77980.dtsi
index 387e6d99f2f365f0..54bd6cbd30ee30e8 100644
--- a/arch/arm64/boot/dts/renesas/r8a77980.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77980.dtsi
@@ -667,6 +667,8 @@
power-domains = <&sysc R8A77980_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <2000>;
iommus = <&ipmmu_ds1 33>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77990.dtsi b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
index 1932d79509ecc86c..9f969653af88f1e6 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
@@ -938,6 +938,7 @@
power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
iommus = <&ipmmu_ds0 16>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/r8a77995.dtsi b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
index e5617ec0f49cb6de..d2d480514909ce02 100644
--- a/arch/arm64/boot/dts/renesas/r8a77995.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77995.dtsi
@@ -628,6 +628,7 @@
power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <1800>;
iommus = <&ipmmu_ds0 16>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
index 1b170ebcea87ef76..454c5c9d84723c13 100644
--- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
@@ -330,7 +330,7 @@
pinctrl-0 = <&avb_pins>;
pinctrl-names = "default";
phy-handle = <&phy0>;
- phy-mode = "rgmii-txid";
+ renesas,txc-delay-ps = <2000>;
status = "okay";
phy0: ethernet-phy@0 {
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index ff88af8e39d3fa10..1fcc0bf1870ecbde 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -144,7 +144,7 @@
pinctrl-0 = <&avb_pins>;
pinctrl-names = "default";
phy-handle = <&phy0>;
- phy-mode = "rgmii-txid";
+ renesas,txc-delay-ps = <2000>;
status = "okay";
phy0: ethernet-phy@0 {
--
2.17.1
^ permalink raw reply related
* [PATCH/RFC 5/5] arm64: dts: renesas: rzg2: Convert EtherAVB to explicit delay handling
From: Geert Uytterhoeven @ 2020-06-19 19:15 UTC (permalink / raw)
To: Sergei Shtylyov, David S . Miller, Jakub Kicinski, Rob Herring
Cc: Andrew Lunn, Oleksij Rempel, Philippe Schenker, Florian Fainelli,
Heiner Kallweit, Kazuya Mizuguchi, Wolfram Sang, netdev,
devicetree, linux-renesas-soc, Geert Uytterhoeven
In-Reply-To: <20200619191554.24942-1-geert+renesas@glider.be>
Some EtherAVB variants support internal clock delay configuration, which
can add larger delays than the delays that are typically supported by
the PHY (using an "rgmii-*id" PHY mode, and/or "[rt]xc-skew-ps"
properties).
Historically, the EtherAVB driver configured these delays based on the
"rgmii-*id" PHY mode. This was wrong, as these are meant solely for the
PHY, not for the MAC. Hence properties were introduced for explicit
configuration of these delays.
Convert the RZ/G2 DTS files from the old to the new scheme:
- Add default "renesas,rxc-delay-ps" and "renesas,txc-delay-ps"
properties to the SoC .dtsi files, to be overridden by board files
where needed,
- Convert board files from "rgmii-*id" PHY modes to "rgmii", adding
the appropriate "renesas,rxc-delay-ps" and/or "renesas,txc-delay-ps"
overrides.
Notes:
- RZ/G2E does not support TX internal delay handling.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "[PATCH/RFC 3/5] ravb: Add support for explicit internal
clock delay configuration" and must not be applied before that
dependency has hit upstream.
---
arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi | 2 +-
arch/arm64/boot/dts/renesas/r8a774a1.dtsi | 2 ++
arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 2 ++
arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 1 +
4 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi b/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi
index acfcfd050a6cb2d5..c2ce2aaea6e6d64b 100644
--- a/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi
+++ b/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi
@@ -19,7 +19,7 @@
pinctrl-0 = <&avb_pins>;
pinctrl-names = "default";
phy-handle = <&phy0>;
- phy-mode = "rgmii-txid";
+ renesas,txc-delay-ps = <2000>;
status = "okay";
phy0: ethernet-phy@0 {
diff --git a/arch/arm64/boot/dts/renesas/r8a774a1.dtsi b/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
index 51a572898fd68a7d..192900c716990860 100644
--- a/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
@@ -1115,6 +1115,8 @@
power-domains = <&sysc R8A774A1_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <0>;
iommus = <&ipmmu_ds0 16>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/r8a774b1.dtsi b/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
index b221f2575e6328f9..3e50541750e93f88 100644
--- a/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774b1.dtsi
@@ -989,6 +989,8 @@
power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <0>;
iommus = <&ipmmu_ds0 16>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
index 5c72a7efbb035d02..a478450090f20e0b 100644
--- a/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a774c0.dtsi
@@ -960,6 +960,7 @@
power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>;
resets = <&cpg 812>;
phy-mode = "rgmii";
+ renesas,rxc-delay-ps = <0>;
iommus = <&ipmmu_ds0 16>;
#address-cells = <1>;
#size-cells = <0>;
--
2.17.1
^ permalink raw reply related
* [PATCH/RFC 1/5] dt-bindings: net: renesas,ravb: Document internal clock delay properties
From: Geert Uytterhoeven @ 2020-06-19 19:15 UTC (permalink / raw)
To: Sergei Shtylyov, David S . Miller, Jakub Kicinski, Rob Herring
Cc: Andrew Lunn, Oleksij Rempel, Philippe Schenker, Florian Fainelli,
Heiner Kallweit, Kazuya Mizuguchi, Wolfram Sang, netdev,
devicetree, linux-renesas-soc, Geert Uytterhoeven
In-Reply-To: <20200619191554.24942-1-geert+renesas@glider.be>
Some EtherAVB variants support internal clock delay configuration, which
can add larger delays than the delays that are typically supported by
the PHY (using an "rgmii-*id" PHY mode, and/or "[rt]xc-skew-ps"
properties).
Add properties for configuring the internal MAC delays.
These properties are mandatory, even when specified as zero, to
distinguish between old and new DTBs.
Update the example accordingly.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
.../devicetree/bindings/net/renesas,ravb.txt | 29 ++++++++++---------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/renesas,ravb.txt b/Documentation/devicetree/bindings/net/renesas,ravb.txt
index 032b76f14f4fdb38..488ada78b6169b8e 100644
--- a/Documentation/devicetree/bindings/net/renesas,ravb.txt
+++ b/Documentation/devicetree/bindings/net/renesas,ravb.txt
@@ -64,6 +64,18 @@ Optional properties:
AVB_LINK signal.
- renesas,ether-link-active-low: boolean, specify when the AVB_LINK signal is
active-low instead of normal active-high.
+- renesas,rxc-delay-ps: Internal RX clock delay.
+ This property is mandatory and valid only on R-Car Gen3
+ and RZ/G2 SoCs.
+ Valid values are 0 and 1800.
+ A non-zero value is allowed only if phy-mode = "rgmii".
+ Zero is not supported on R-Car D3.
+- renesas,txc-delay-ps: Internal TX clock delay.
+ This property is mandatory and valid only on R-Car H3,
+ M3-W, M3-W+, M3-N, V3M, and V3H, and RZ/G2M and RZ/G2N.
+ Valid values are 0 and 2000.
+ A non-zero value is allowed only if phy-mode = "rgmii".
+ Zero is not supported on R-Car V3H.
Example:
@@ -105,8 +117,10 @@ Example:
"ch24";
clocks = <&cpg CPG_MOD 812>;
power-domains = <&cpg>;
- phy-mode = "rgmii-id";
+ phy-mode = "rgmii";
phy-handle = <&phy0>;
+ renesas,rxc-delay-ps = <0>;
+ renesas,txc-delay-ps = <2000>;
pinctrl-0 = <ðer_pins>;
pinctrl-names = "default";
@@ -115,18 +129,7 @@ Example:
#size-cells = <0>;
phy0: ethernet-phy@0 {
- rxc-skew-ps = <900>;
- rxdv-skew-ps = <0>;
- rxd0-skew-ps = <0>;
- rxd1-skew-ps = <0>;
- rxd2-skew-ps = <0>;
- rxd3-skew-ps = <0>;
- txc-skew-ps = <900>;
- txen-skew-ps = <0>;
- txd0-skew-ps = <0>;
- txd1-skew-ps = <0>;
- txd2-skew-ps = <0>;
- txd3-skew-ps = <0>;
+ rxc-skew-ps = <1500>;
reg = <0>;
interrupt-parent = <&gpio2>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
--
2.17.1
^ permalink raw reply related
* [PATCH/RFC 3/5] ravb: Add support for explicit internal clock delay configuration
From: Geert Uytterhoeven @ 2020-06-19 19:15 UTC (permalink / raw)
To: Sergei Shtylyov, David S . Miller, Jakub Kicinski, Rob Herring
Cc: Andrew Lunn, Oleksij Rempel, Philippe Schenker, Florian Fainelli,
Heiner Kallweit, Kazuya Mizuguchi, Wolfram Sang, netdev,
devicetree, linux-renesas-soc, Geert Uytterhoeven
In-Reply-To: <20200619191554.24942-1-geert+renesas@glider.be>
Some EtherAVB variants support internal clock delay configuration, which
can add larger delays than the delays that are typically supported by
the PHY (using an "rgmii-*id" PHY mode, and/or "[rt]xc-skew-ps"
properties).
Historically, the EtherAVB driver configured these delays based on the
"rgmii-*id" PHY mode. This caused issues with PHY drivers that
implement PHY internal delays properly[1]. Hence a backwards-compatible
workaround was added by masking the PHY mode[2].
Add proper support for explicit configuration of the MAC internal clock
delays using the new "renesas,[rt]xc-delay-ps" properties.
Fall back to the old handling if none of these properties is present.
[1] Commit bcf3440c6dd78bfe ("net: phy: micrel: add phy-mode support for
the KSZ9031 PHY")
[2] Commit 9b23203c32ee02cd ("ravb: Mask PHY mode to avoid inserting
delays twice").
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/net/ethernet/renesas/ravb.h | 1 +
drivers/net/ethernet/renesas/ravb_main.c | 35 ++++++++++++++++++------
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h
index e5ca12ce93c730a9..7453b17a37a2c8d0 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -1038,6 +1038,7 @@ struct ravb_private {
unsigned wol_enabled:1;
unsigned rxcidm:1; /* RX Clock Internal Delay Mode */
unsigned txcidm:1; /* TX Clock Internal Delay Mode */
+ unsigned rgmii_override:1; /* Deprecated rgmii-*id behavior */
int num_tx_desc; /* TX descriptors per packet */
};
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index f326234d1940f43e..0582846bec7726b6 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1034,11 +1034,7 @@ static int ravb_phy_init(struct net_device *ndev)
pn = of_node_get(np);
}
- iface = priv->phy_interface;
- if (priv->chip_id != RCAR_GEN2 && phy_interface_mode_is_rgmii(iface)) {
- /* ravb_set_delay_mode() takes care of internal delay mode */
- iface = PHY_INTERFACE_MODE_RGMII;
- }
+ iface = priv->rgmii_override ? PHY_INTERFACE_MODE_RGMII : priv->phy_interface;
phydev = of_phy_connect(ndev, pn, ravb_adjust_link, 0, iface);
of_node_put(pn);
if (!phydev) {
@@ -1967,20 +1963,41 @@ static const struct soc_device_attribute ravb_delay_mode_quirk_match[] = {
};
/* Set tx and rx clock internal delay modes */
-static void ravb_parse_delay_mode(struct net_device *ndev)
+static void ravb_parse_delay_mode(struct device_node *np, struct net_device *ndev)
{
struct ravb_private *priv = netdev_priv(ndev);
+ bool explicit_delay = false;
+ u32 delay;
+
+ if (!of_property_read_u32(np, "renesas,rxc-delay-ps", &delay)) {
+ /* Valid values are 0 and 1800, according to DT bindings */
+ priv->rxcidm = !!delay;
+ explicit_delay = true;
+ }
+ if (!of_property_read_u32(np, "renesas,txc-delay-ps", &delay)) {
+ /* Valid values are 0 and 2000, according to DT bindings */
+ priv->txcidm = !!delay;
+ explicit_delay = true;
+ }
+ if (explicit_delay)
+ return;
+
+ /* Fall back to legacy rgmii-*id behavior */
if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
- priv->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID)
+ priv->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) {
priv->rxcidm = true;
+ priv->rgmii_override = true;
+ }
if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
priv->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) {
if (!WARN(soc_device_match(ravb_delay_mode_quirk_match),
"phy-mode %s requires TX clock internal delay mode which is not supported by this hardware revision. Please update device tree",
- phy_modes(priv->phy_interface)))
+ phy_modes(priv->phy_interface))) {
priv->txcidm = true;
+ priv->rgmii_override = true;
+ }
}
}
@@ -2126,7 +2143,7 @@ static int ravb_probe(struct platform_device *pdev)
ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI);
if (priv->chip_id != RCAR_GEN2) {
- ravb_parse_delay_mode(ndev);
+ ravb_parse_delay_mode(np, ndev);
ravb_set_delay_mode(ndev);
}
--
2.17.1
^ permalink raw reply related
* [PATCH/RFC 0/5] ravb: Add support for explicit internal clock delay configuration
From: Geert Uytterhoeven @ 2020-06-19 19:15 UTC (permalink / raw)
To: Sergei Shtylyov, David S . Miller, Jakub Kicinski, Rob Herring
Cc: Andrew Lunn, Oleksij Rempel, Philippe Schenker, Florian Fainelli,
Heiner Kallweit, Kazuya Mizuguchi, Wolfram Sang, netdev,
devicetree, linux-renesas-soc, Geert Uytterhoeven
Hi all,
Some Renesas EtherAVB variants support internal clock delay
configuration, which can add larger delays than the delays that are
typically supported by the PHY (using an "rgmii-*id" PHY mode, and/or
"[rt]xc-skew-ps" properties).
Historically, the EtherAVB driver configured these delays based on the
"rgmii-*id" PHY mode. This caused issues with PHY drivers that
implement PHY internal delays properly[1]. Hence a backwards-compatible
workaround was added by masking the PHY mode[2].
This RFC patch series implements the next step of the plan outlined in
[3], and adds proper support for explicit configuration of the MAC
internal clock delays using new "renesas,[rt]xc-delay-ps" properties.
If none of these properties is present, the driver falls back to the old
handling.
The series consists of 4 parts:
1. DT binding update documenting the new properties,
2. A preparatory improvement,
3. Driver update implementing support for the new properties,
4. DT updates, one for R-Car Gen3 and RZ/G2 SoC families each.
Note that patches 4 and 5 depend on patch 3, and must not be applied
before that dependency has hit upstream.
Impacted, tested:
- Salvator-X(S) with R-Car H3 ES1.0 and ES2.0, M3-W, and M3-N.
Not impacted, tested:
- Ebisu with R-Car E3.
Impacted, not tested:
- Salvator-X(S) with other SoC variants,
- ULCB with R-Car H3/M3-W/M3-N variants,
- V3MSK and Eagle with R-Car V3M,
- Draak with R-Car V3H,
- HiHope RZ/G2[MN] with RZ/G2M or RZ/G2N.
Thanks for your comments!
References:
[1] Commit bcf3440c6dd78bfe ("net: phy: micrel: add phy-mode support
for the KSZ9031 PHY")
[2] Commit 9b23203c32ee02cd ("ravb: Mask PHY mode to avoid inserting
delays twice").
https://lore.kernel.org/r/20200529122540.31368-1-geert+renesas@glider.be/
[3] https://lore.kernel.org/r/CAMuHMdU+MR-2tr3-pH55G0GqPG9HwH3XUd=8HZxprFDMGQeWUw@mail.gmail.com/
Geert Uytterhoeven (5):
dt-bindings: net: renesas,ravb: Document internal clock delay
properties
ravb: Split delay handling in parsing and applying
ravb: Add support for explicit internal clock delay configuration
arm64: dts: renesas: rcar-gen3: Convert EtherAVB to explicit delay
handling
arm64: dts: renesas: rzg2: Convert EtherAVB to explicit delay handling
.../devicetree/bindings/net/renesas,ravb.txt | 29 ++++++-----
.../boot/dts/renesas/hihope-rzg2-ex.dtsi | 2 +-
arch/arm64/boot/dts/renesas/r8a774a1.dtsi | 2 +
arch/arm64/boot/dts/renesas/r8a774b1.dtsi | 2 +
arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 1 +
arch/arm64/boot/dts/renesas/r8a77951.dtsi | 2 +
arch/arm64/boot/dts/renesas/r8a77960.dtsi | 2 +
arch/arm64/boot/dts/renesas/r8a77961.dtsi | 2 +
arch/arm64/boot/dts/renesas/r8a77965.dtsi | 2 +
.../arm64/boot/dts/renesas/r8a77970-eagle.dts | 3 +-
.../arm64/boot/dts/renesas/r8a77970-v3msk.dts | 3 +-
arch/arm64/boot/dts/renesas/r8a77970.dtsi | 2 +
arch/arm64/boot/dts/renesas/r8a77980.dtsi | 2 +
arch/arm64/boot/dts/renesas/r8a77990.dtsi | 1 +
arch/arm64/boot/dts/renesas/r8a77995.dtsi | 1 +
.../boot/dts/renesas/salvator-common.dtsi | 2 +-
arch/arm64/boot/dts/renesas/ulcb.dtsi | 2 +-
drivers/net/ethernet/renesas/ravb.h | 5 +-
drivers/net/ethernet/renesas/ravb_main.c | 52 ++++++++++++++-----
19 files changed, 86 insertions(+), 31 deletions(-)
--
2.17.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH net-next 1/2] tcp: remove indirect calls for icsk->icsk_af_ops->queue_xmit
From: Eric Dumazet @ 2020-06-19 19:12 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Jakub Kicinski
In-Reply-To: <20200619191235.199506-1-edumazet@google.com>
Mitigate RETPOLINE costs in __tcp_transmit_skb()
by using INDIRECT_CALL_INET() wrapper.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/ip.h | 6 +-----
include/net/tcp.h | 1 +
net/ipv4/ip_output.c | 6 ++++++
net/ipv4/tcp_output.c | 7 ++++++-
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/include/net/ip.h b/include/net/ip.h
index 04ebe7bf54c6a8b21cf7894691b36e564ef1aef1..862c9545833a95e25fdcddafcfc84cd07421835d 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -231,11 +231,7 @@ struct sk_buff *ip_make_skb(struct sock *sk, struct flowi4 *fl4,
struct ipcm_cookie *ipc, struct rtable **rtp,
struct inet_cork *cork, unsigned int flags);
-static inline int ip_queue_xmit(struct sock *sk, struct sk_buff *skb,
- struct flowi *fl)
-{
- return __ip_queue_xmit(sk, skb, fl, inet_sk(sk)->tos);
-}
+int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl);
static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4)
{
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4de9485f73d97d0b44f1e423bcbc8a3598749adc..e5d7e0b099245cf245a5f1c994d164a9fff66124 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -25,6 +25,7 @@
#include <linux/skbuff.h>
#include <linux/kref.h>
#include <linux/ktime.h>
+#include <linux/indirect_call_wrapper.h>
#include <net/inet_connection_sock.h>
#include <net/inet_timewait_sock.h>
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 090d3097ee15baa87695c530278761fb26534ad5..d946356187eddfb0f81a2f632ee863fafad5f89c 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -539,6 +539,12 @@ int __ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
}
EXPORT_SYMBOL(__ip_queue_xmit);
+int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl)
+{
+ return __ip_queue_xmit(sk, skb, fl, inet_sk(sk)->tos);
+}
+EXPORT_SYMBOL(ip_queue_xmit);
+
static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from)
{
to->pkt_type = from->pkt_type;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index a50e1990a845a258d4cc6a2a989d09068ea3a973..be1bd37185d82e5827dfc5105ae74cd815ba1877 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1064,6 +1064,9 @@ static void tcp_update_skb_after_send(struct sock *sk, struct sk_buff *skb,
list_move_tail(&skb->tcp_tsorted_anchor, &tp->tsorted_sent_queue);
}
+INDIRECT_CALLABLE_DECLARE(int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl));
+INDIRECT_CALLABLE_DECLARE(int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl));
+
/* This routine actually transmits TCP packets queued in by
* tcp_do_sendmsg(). This is used by both the initial
* transmission and possible later retransmissions.
@@ -1235,7 +1238,9 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
tcp_add_tx_delay(skb, tp);
- err = icsk->icsk_af_ops->queue_xmit(sk, skb, &inet->cork.fl);
+ err = INDIRECT_CALL_INET(icsk->icsk_af_ops->queue_xmit,
+ inet6_csk_xmit, ip_queue_xmit,
+ sk, skb, &inet->cork.fl);
if (unlikely(err > 0)) {
tcp_enter_cwr(sk);
--
2.27.0.111.gc72c7da667-goog
^ permalink raw reply related
* [PATCH net-next 2/2] tcp: remove indirect calls for icsk->icsk_af_ops->send_check
From: Eric Dumazet @ 2020-06-19 19:12 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Jakub Kicinski
In-Reply-To: <20200619191235.199506-1-edumazet@google.com>
Mitigate RETPOLINE costs in __tcp_transmit_skb()
by using INDIRECT_CALL_INET() wrapper.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/net/ip6_checksum.h | 9 ---------
include/net/tcp.h | 3 +++
net/ipv4/tcp_output.c | 5 ++++-
net/ipv6/tcp_ipv6.c | 7 +++++++
4 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index 27ec612cd4a4598dc01e4984e61bc42c6ee5e77b..b3f4eaa88672a2e64ec3fbb3e77a60fe383e59d9 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -85,15 +85,6 @@ static inline void tcp_v6_gso_csum_prep(struct sk_buff *skb)
th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0);
}
-#if IS_ENABLED(CONFIG_IPV6)
-static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
-{
- struct ipv6_pinfo *np = inet6_sk(sk);
-
- __tcp_v6_send_check(skb, &np->saddr, &sk->sk_v6_daddr);
-}
-#endif
-
static inline __sum16 udp_v6_check(int len,
const struct in6_addr *saddr,
const struct in6_addr *daddr,
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e5d7e0b099245cf245a5f1c994d164a9fff66124..cd9cc348dbf9c62efa30d909f23a0ed1b39e4492 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -932,6 +932,9 @@ static inline int tcp_v6_sdif(const struct sk_buff *skb)
#endif
return 0;
}
+
+INDIRECT_CALLABLE_DECLARE(void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb));
+
#endif
static inline bool inet_exact_dif_match(struct net *net, struct sk_buff *skb)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index be1bd37185d82e5827dfc5105ae74cd815ba1877..04b70fe31fa2cdad739ca49447cf4dd7e9d90cce 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1066,6 +1066,7 @@ static void tcp_update_skb_after_send(struct sock *sk, struct sk_buff *skb,
INDIRECT_CALLABLE_DECLARE(int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl));
INDIRECT_CALLABLE_DECLARE(int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl));
+INDIRECT_CALLABLE_DECLARE(void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb));
/* This routine actually transmits TCP packets queued in by
* tcp_do_sendmsg(). This is used by both the initial
@@ -1210,7 +1211,9 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
}
#endif
- icsk->icsk_af_ops->send_check(sk, skb);
+ INDIRECT_CALL_INET(icsk->icsk_af_ops->send_check,
+ tcp_v6_send_check, tcp_v4_send_check,
+ sk, skb);
if (likely(tcb->tcp_flags & TCPHDR_ACK))
tcp_event_ack_sent(sk, tcp_skb_pcount(skb), rcv_nxt);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index f67d45ff00b468f8c50053f6d2e430a1f5247db5..4502db706f75349b49672a859492a036a8722bb6 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1811,6 +1811,13 @@ static struct timewait_sock_ops tcp6_timewait_sock_ops = {
.twsk_destructor = tcp_twsk_destructor,
};
+INDIRECT_CALLABLE_SCOPE void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
+{
+ struct ipv6_pinfo *np = inet6_sk(sk);
+
+ __tcp_v6_send_check(skb, &np->saddr, &sk->sk_v6_daddr);
+}
+
const struct inet_connection_sock_af_ops ipv6_specific = {
.queue_xmit = inet6_csk_xmit,
.send_check = tcp_v6_send_check,
--
2.27.0.111.gc72c7da667-goog
^ permalink raw reply related
* [PATCH net-next 0/2] tcp: remove two indirect calls from xmit path
From: Eric Dumazet @ 2020-06-19 19:12 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Jakub Kicinski
__tcp_transmit_skb() does two indirect calls per packet, lets get rid
of them.
Eric Dumazet (2):
tcp: remove indirect calls for icsk->icsk_af_ops->queue_xmit
tcp: remove indirect calls for icsk->icsk_af_ops->send_check
include/net/ip.h | 6 +-----
include/net/ip6_checksum.h | 9 ---------
include/net/tcp.h | 4 ++++
net/ipv4/ip_output.c | 6 ++++++
net/ipv4/tcp_output.c | 12 ++++++++++--
net/ipv6/tcp_ipv6.c | 7 +++++++
6 files changed, 28 insertions(+), 16 deletions(-)
--
2.27.0.111.gc72c7da667-goog
^ permalink raw reply
* [PATCH v2 net-next] ipv6: icmp6: avoid indirect call for icmpv6_send()
From: Eric Dumazet @ 2020-06-19 19:02 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, Jakub Kicinski
If IPv6 is builtin, we do not need an expensive indirect call
to reach cmp6_send().
v2: put inline keyword before the type to avoid sparse warnings.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/linux/icmpv6.h | 22 +++++++++++++++++++++-
net/ipv6/icmp.c | 5 +++--
net/ipv6/ip6_icmp.c | 10 +++++-----
3 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index 33d37960231441d63a1d7a3d611da916734fc2cd..1b3371ae819362466c88fad6fe4ee7c9907390c7 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -13,12 +13,32 @@ static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
#include <linux/netdevice.h>
#if IS_ENABLED(CONFIG_IPV6)
-extern void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info);
typedef void ip6_icmp_send_t(struct sk_buff *skb, u8 type, u8 code, __u32 info,
const struct in6_addr *force_saddr);
+#if IS_BUILTIN(CONFIG_IPV6)
+void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
+ const struct in6_addr *force_saddr);
+static inline void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
+{
+ icmp6_send(skb, type, code, info, NULL);
+}
+static inline int inet6_register_icmp_sender(ip6_icmp_send_t *fn)
+{
+ BUILD_BUG_ON(fn != icmp6_send);
+ return 0;
+}
+static inline int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn)
+{
+ BUILD_BUG_ON(fn != icmp6_send);
+ return 0;
+}
+#else
+extern void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info);
extern int inet6_register_icmp_sender(ip6_icmp_send_t *fn);
extern int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn);
+#endif
+
int ip6_err_gen_icmpv6_unreach(struct sk_buff *skb, int nhs, int type,
unsigned int data_len);
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index fc5000370030d67094ba11f15aaaaaa7ba519cde..91e0f2fd2523e6fb7d47c5a92e997c90ad53b9fc 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -439,8 +439,8 @@ static int icmp6_iif(const struct sk_buff *skb)
/*
* Send an ICMP message in response to a packet in error
*/
-static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
- const struct in6_addr *force_saddr)
+void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
+ const struct in6_addr *force_saddr)
{
struct inet6_dev *idev = NULL;
struct ipv6hdr *hdr = ipv6_hdr(skb);
@@ -625,6 +625,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
out_bh_enable:
local_bh_enable();
}
+EXPORT_SYMBOL(icmp6_send);
/* Slightly more convenient version of icmp6_send.
*/
diff --git a/net/ipv6/ip6_icmp.c b/net/ipv6/ip6_icmp.c
index e0086758b6ee3c3e91568e59028838c770fac795..70c8c2f36c980cd95db10380a1702a6d08e8c223 100644
--- a/net/ipv6/ip6_icmp.c
+++ b/net/ipv6/ip6_icmp.c
@@ -9,6 +9,8 @@
#if IS_ENABLED(CONFIG_IPV6)
+#if !IS_BUILTIN(CONFIG_IPV6)
+
static ip6_icmp_send_t __rcu *ip6_icmp_send;
int inet6_register_icmp_sender(ip6_icmp_send_t *fn)
@@ -37,14 +39,12 @@ void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
rcu_read_lock();
send = rcu_dereference(ip6_icmp_send);
-
- if (!send)
- goto out;
- send(skb, type, code, info, NULL);
-out:
+ if (send)
+ send(skb, type, code, info, NULL);
rcu_read_unlock();
}
EXPORT_SYMBOL(icmpv6_send);
+#endif
#if IS_ENABLED(CONFIG_NF_NAT)
#include <net/netfilter/nf_conntrack.h>
--
2.27.0.111.gc72c7da667-goog
^ permalink raw reply related
* Re: [PATCH] bpf: Allow small structs to be type of function argument
From: Yonghong Song @ 2020-06-19 18:56 UTC (permalink / raw)
To: John Fastabend, Alexei Starovoitov
Cc: Andrii Nakryiko, Jiri Olsa, Andrii Nakryiko, Jiri Olsa,
Alexei Starovoitov, Daniel Borkmann, Networking, bpf,
Martin KaFai Lau, Jakub Kicinski, David Miller,
Jesper Dangaard Brouer, KP Singh, Masanori Misono
In-Reply-To: <5eecf98ba643c_137b2ad09f64a5c458@john-XPS-13-9370.notmuch>
On 6/19/20 10:44 AM, John Fastabend wrote:
> Yonghong Song wrote:
>>
>>
>> On 6/18/20 7:04 PM, Alexei Starovoitov wrote:
>>> On Thu, Jun 18, 2020 at 5:26 PM John Fastabend <john.fastabend@gmail.com> wrote:
>>>>
>>>> foo(int a, __int128 b)
>>>>
>>>> would put a in r0 and b in r2 and r3 leaving a hole in r1. But that
>>>> was some old reference manual and might no longer be the case
>>
>> This should not happen if clang compilation with -target bpf.
>> This MAY happen if they compile with 'clang -target riscv' as the IR
>> could change before coming to bpf backend.
>
> I guess this means in order to handle __int128 and structs in
> btf_ctx_access we would have to know this did not happen. Otherwise
> the arg to type mappings are off because we simply do
>
> arg = off / 8
Yes, btf_ctx_access already disqualified struct type, so a refined
check to ensure int width <= 64 should be sufficient.
>
>>
>>>> in reality. Perhaps just spreading hearsay, but the point is we
>>>> should say something about what the BPF backend convention
>>>> is and write it down. We've started to bump into these things
>>>> lately.
>>>
>>> calling convention for int128 in bpf is _undefined_.
>>> calling convention for struct by value in bpf is also _undefined_.
>>
>> Just to clarify a little bit. bpf backend did not do anything
>> special about int128 and struct type. It is using llvm default.
>> That is, int128 using two argument registers and struct passed
>> by address. But I do see some other architectures having their
>> own ways to handle these parameters like X86, AARCH64, AMDGPU, MIPS.
>>
>> int128 is not widely used. passing struct as the argument is not
>> a good practice. So Agree with Alexei is not really worthwhile to
>> handle them in the place of arguments.
>
> Agree as well I'll just add a small fix to check btf_type_is_int()
> size is <= u64 and that should be sufficient to skip handling the
> int128 case.
Agree.
>
>>
>>>
>>> In many cases the compiler has to have the backend code
>>> so other parts of the compiler can function.
>>> I didn't bother explicitly disabling every undefined case.
>>> Please don't read too much into llvm generated code.
>>>
>
>
^ permalink raw reply
* [PATCH net 2/3] net: ethtool: fix indentation of netdev_features_strings
From: Alexander Lobakin @ 2020-06-19 18:50 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski
Cc: Michal Kubecek, Florian Fainelli, Andrew Lunn, Jiri Pirko,
Antoine Tenart, Steffen Klassert, Aya Levin, Tom Herbert,
Alexander Lobakin, netdev, linux-kernel
In-Reply-To: <x6AQUs_HEHFh9N-5HYIEIDvv9krP6Fg6OgEuqUBC6jHmWwaeXSkyLVi05uelpCPAZXlXKlJqbJk8ox3xkIs33KVna41w5es0wJlc-cQhb8g=@pm.me>
The current indentation is an absolute mess of tabs, spaces and their
mixes in different proportions. Convert it all to plain tabs and move
assignment operation char to the right, which is the most commonly
used style in Linux code.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
---
net/ethtool/common.c | 120 +++++++++++++++++++++----------------------
1 file changed, 60 insertions(+), 60 deletions(-)
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index aaecfc916a4d..c8e3fce6e48d 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -6,66 +6,66 @@
#include "common.h"
const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
- [NETIF_F_SG_BIT] = "tx-scatter-gather",
- [NETIF_F_IP_CSUM_BIT] = "tx-checksum-ipv4",
- [NETIF_F_HW_CSUM_BIT] = "tx-checksum-ip-generic",
- [NETIF_F_IPV6_CSUM_BIT] = "tx-checksum-ipv6",
- [NETIF_F_HIGHDMA_BIT] = "highdma",
- [NETIF_F_FRAGLIST_BIT] = "tx-scatter-gather-fraglist",
- [NETIF_F_HW_VLAN_CTAG_TX_BIT] = "tx-vlan-hw-insert",
-
- [NETIF_F_HW_VLAN_CTAG_RX_BIT] = "rx-vlan-hw-parse",
- [NETIF_F_HW_VLAN_CTAG_FILTER_BIT] = "rx-vlan-filter",
- [NETIF_F_HW_VLAN_STAG_TX_BIT] = "tx-vlan-stag-hw-insert",
- [NETIF_F_HW_VLAN_STAG_RX_BIT] = "rx-vlan-stag-hw-parse",
- [NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter",
- [NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged",
- [NETIF_F_GSO_BIT] = "tx-generic-segmentation",
- [NETIF_F_LLTX_BIT] = "tx-lockless",
- [NETIF_F_NETNS_LOCAL_BIT] = "netns-local",
- [NETIF_F_GRO_BIT] = "rx-gro",
- [NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
- [NETIF_F_LRO_BIT] = "rx-lro",
-
- [NETIF_F_TSO_BIT] = "tx-tcp-segmentation",
- [NETIF_F_GSO_ROBUST_BIT] = "tx-gso-robust",
- [NETIF_F_TSO_ECN_BIT] = "tx-tcp-ecn-segmentation",
- [NETIF_F_TSO_MANGLEID_BIT] = "tx-tcp-mangleid-segmentation",
- [NETIF_F_TSO6_BIT] = "tx-tcp6-segmentation",
- [NETIF_F_FSO_BIT] = "tx-fcoe-segmentation",
- [NETIF_F_GSO_GRE_BIT] = "tx-gre-segmentation",
- [NETIF_F_GSO_GRE_CSUM_BIT] = "tx-gre-csum-segmentation",
- [NETIF_F_GSO_IPXIP4_BIT] = "tx-ipxip4-segmentation",
- [NETIF_F_GSO_IPXIP6_BIT] = "tx-ipxip6-segmentation",
- [NETIF_F_GSO_UDP_TUNNEL_BIT] = "tx-udp_tnl-segmentation",
- [NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT] = "tx-udp_tnl-csum-segmentation",
- [NETIF_F_GSO_PARTIAL_BIT] = "tx-gso-partial",
- [NETIF_F_GSO_TUNNEL_REMCSUM_BIT] = "tx-tunnel-remcsum-segmentation",
- [NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation",
- [NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation",
- [NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation",
- [NETIF_F_GSO_FRAGLIST_BIT] = "tx-gso-list",
-
- [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
- [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
- [NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu",
- [NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter",
- [NETIF_F_RXHASH_BIT] = "rx-hashing",
- [NETIF_F_RXCSUM_BIT] = "rx-checksum",
- [NETIF_F_NOCACHE_COPY_BIT] = "tx-nocache-copy",
- [NETIF_F_LOOPBACK_BIT] = "loopback",
- [NETIF_F_RXFCS_BIT] = "rx-fcs",
- [NETIF_F_RXALL_BIT] = "rx-all",
- [NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload",
- [NETIF_F_HW_TC_BIT] = "hw-tc-offload",
- [NETIF_F_HW_ESP_BIT] = "esp-hw-offload",
- [NETIF_F_HW_ESP_TX_CSUM_BIT] = "esp-tx-csum-hw-offload",
- [NETIF_F_RX_UDP_TUNNEL_PORT_BIT] = "rx-udp_tunnel-port-offload",
- [NETIF_F_HW_TLS_RECORD_BIT] = "tls-hw-record",
- [NETIF_F_HW_TLS_TX_BIT] = "tls-hw-tx-offload",
- [NETIF_F_HW_TLS_RX_BIT] = "tls-hw-rx-offload",
- [NETIF_F_GRO_FRAGLIST_BIT] = "rx-gro-list",
- [NETIF_F_HW_MACSEC_BIT] = "macsec-hw-offload",
+ [NETIF_F_SG_BIT] = "tx-scatter-gather",
+ [NETIF_F_IP_CSUM_BIT] = "tx-checksum-ipv4",
+ [NETIF_F_HW_CSUM_BIT] = "tx-checksum-ip-generic",
+ [NETIF_F_IPV6_CSUM_BIT] = "tx-checksum-ipv6",
+ [NETIF_F_HIGHDMA_BIT] = "highdma",
+ [NETIF_F_FRAGLIST_BIT] = "tx-scatter-gather-fraglist",
+ [NETIF_F_HW_VLAN_CTAG_TX_BIT] = "tx-vlan-hw-insert",
+
+ [NETIF_F_HW_VLAN_CTAG_RX_BIT] = "rx-vlan-hw-parse",
+ [NETIF_F_HW_VLAN_CTAG_FILTER_BIT] = "rx-vlan-filter",
+ [NETIF_F_HW_VLAN_STAG_TX_BIT] = "tx-vlan-stag-hw-insert",
+ [NETIF_F_HW_VLAN_STAG_RX_BIT] = "rx-vlan-stag-hw-parse",
+ [NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter",
+ [NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged",
+ [NETIF_F_GSO_BIT] = "tx-generic-segmentation",
+ [NETIF_F_LLTX_BIT] = "tx-lockless",
+ [NETIF_F_NETNS_LOCAL_BIT] = "netns-local",
+ [NETIF_F_GRO_BIT] = "rx-gro",
+ [NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
+ [NETIF_F_LRO_BIT] = "rx-lro",
+
+ [NETIF_F_TSO_BIT] = "tx-tcp-segmentation",
+ [NETIF_F_GSO_ROBUST_BIT] = "tx-gso-robust",
+ [NETIF_F_TSO_ECN_BIT] = "tx-tcp-ecn-segmentation",
+ [NETIF_F_TSO_MANGLEID_BIT] = "tx-tcp-mangleid-segmentation",
+ [NETIF_F_TSO6_BIT] = "tx-tcp6-segmentation",
+ [NETIF_F_FSO_BIT] = "tx-fcoe-segmentation",
+ [NETIF_F_GSO_GRE_BIT] = "tx-gre-segmentation",
+ [NETIF_F_GSO_GRE_CSUM_BIT] = "tx-gre-csum-segmentation",
+ [NETIF_F_GSO_IPXIP4_BIT] = "tx-ipxip4-segmentation",
+ [NETIF_F_GSO_IPXIP6_BIT] = "tx-ipxip6-segmentation",
+ [NETIF_F_GSO_UDP_TUNNEL_BIT] = "tx-udp_tnl-segmentation",
+ [NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT] = "tx-udp_tnl-csum-segmentation",
+ [NETIF_F_GSO_PARTIAL_BIT] = "tx-gso-partial",
+ [NETIF_F_GSO_TUNNEL_REMCSUM_BIT] = "tx-tunnel-remcsum-segmentation",
+ [NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation",
+ [NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation",
+ [NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation",
+ [NETIF_F_GSO_FRAGLIST_BIT] = "tx-gso-list",
+
+ [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
+ [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
+ [NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu",
+ [NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter",
+ [NETIF_F_RXHASH_BIT] = "rx-hashing",
+ [NETIF_F_RXCSUM_BIT] = "rx-checksum",
+ [NETIF_F_NOCACHE_COPY_BIT] = "tx-nocache-copy",
+ [NETIF_F_LOOPBACK_BIT] = "loopback",
+ [NETIF_F_RXFCS_BIT] = "rx-fcs",
+ [NETIF_F_RXALL_BIT] = "rx-all",
+ [NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload",
+ [NETIF_F_HW_TC_BIT] = "hw-tc-offload",
+ [NETIF_F_HW_ESP_BIT] = "esp-hw-offload",
+ [NETIF_F_HW_ESP_TX_CSUM_BIT] = "esp-tx-csum-hw-offload",
+ [NETIF_F_RX_UDP_TUNNEL_PORT_BIT] = "rx-udp_tunnel-port-offload",
+ [NETIF_F_HW_TLS_RECORD_BIT] = "tls-hw-record",
+ [NETIF_F_HW_TLS_TX_BIT] = "tls-hw-tx-offload",
+ [NETIF_F_HW_TLS_RX_BIT] = "tls-hw-rx-offload",
+ [NETIF_F_GRO_FRAGLIST_BIT] = "rx-gro-list",
+ [NETIF_F_HW_MACSEC_BIT] = "macsec-hw-offload",
};
const char
--
2.27.0
^ permalink raw reply related
* [PATCH net 1/3] net: ethtool: add missing string for NETIF_F_GSO_TUNNEL_REMCSUM
From: Alexander Lobakin @ 2020-06-19 18:49 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski
Cc: Michal Kubecek, Florian Fainelli, Andrew Lunn, Jiri Pirko,
Antoine Tenart, Steffen Klassert, Aya Levin, Tom Herbert,
Alexander Lobakin, netdev, linux-kernel
In-Reply-To: <x6AQUs_HEHFh9N-5HYIEIDvv9krP6Fg6OgEuqUBC6jHmWwaeXSkyLVi05uelpCPAZXlXKlJqbJk8ox3xkIs33KVna41w5es0wJlc-cQhb8g=@pm.me>
Commit e585f2363637 ("udp: Changes to udp_offload to support remote
checksum offload") added new GSO type and a corresponding netdev
feature, but missed Ethtool's 'netdev_features_strings' table.
Give it a name so it will be exposed to userspace and become available
for manual configuration.
Fixes: e585f2363637 ("udp: Changes to udp_offload to support remote
checksum offload")
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
---
net/ethtool/common.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 47f63526818e..aaecfc916a4d 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -40,6 +40,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
[NETIF_F_GSO_UDP_TUNNEL_BIT] = "tx-udp_tnl-segmentation",
[NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT] = "tx-udp_tnl-csum-segmentation",
[NETIF_F_GSO_PARTIAL_BIT] = "tx-gso-partial",
+ [NETIF_F_GSO_TUNNEL_REMCSUM_BIT] = "tx-tunnel-remcsum-segmentation",
[NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation",
[NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation",
[NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation",
--
2.27.0
^ permalink raw reply related
* [PATCH net v2 1/2] of: of_mdio: Correct loop scanning logic
From: Florian Fainelli @ 2020-06-19 18:47 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Jakub Kicinski, Rob Herring, Frank Rowand,
Dajun Jin, Alexandre Belloni, open list,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE
In-Reply-To: <20200619184747.16606-1-f.fainelli@gmail.com>
Commit 209c65b61d94 ("drivers/of/of_mdio.c:fix of_mdiobus_register()")
introduced a break of the loop on the premise that a successful
registration should exit the loop. The premise is correct but not to
code, because rc && rc != -ENODEV is just a special error condition,
that means we would exit the loop even with rc == -ENODEV which is
absolutely not correct since this is the error code to indicate to the
MDIO bus layer that scanning should continue.
Fix this by explicitly checking for rc = 0 as the only valid condition
to break out of the loop.
Fixes: 209c65b61d94 ("drivers/of/of_mdio.c:fix of_mdiobus_register()")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/of/of_mdio.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index a04afe79529c..ef6f818ce5b3 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -314,10 +314,15 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
child, addr);
if (of_mdiobus_child_is_phy(child)) {
+ /* -ENODEV is the return code that PHYLIB has
+ * standardized on to indicate that bus
+ * scanning should continue.
+ */
rc = of_mdiobus_register_phy(mdio, child, addr);
- if (rc && rc != -ENODEV)
+ if (!rc)
+ break;
+ if (rc != -ENODEV)
goto unregister;
- break;
}
}
}
--
2.17.1
^ permalink raw reply related
* [PATCH net v2 2/2] net: phy: Check harder for errors in get_phy_id()
From: Florian Fainelli @ 2020-06-19 18:47 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Jakub Kicinski, Rob Herring, Frank Rowand,
Dajun Jin, Alexandre Belloni, open list,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE
In-Reply-To: <20200619184747.16606-1-f.fainelli@gmail.com>
Commit 02a6efcab675 ("net: phy: allow scanning busses with missing
phys") added a special condition to return -ENODEV in case -ENODEV or
-EIO was returned from the first read of the MII_PHYSID1 register.
In case the MDIO bus data line pull-up is not strong enough, the MDIO
bus controller will not flag this as a read error. This can happen when
a pluggable daughter card is not connected and weak internal pull-ups
are used (since that is the only option, otherwise the pins are
floating).
The second read of MII_PHYSID2 will be correctly flagged an error
though, but now we will return -EIO which will be treated as a hard
error, thus preventing MDIO bus scanning loops to continue succesfully.
Apply the same logic to both register reads, thus allowing the scanning
logic to proceed.
Fixes: 02a6efcab675 ("net: phy: allow scanning busses with missing phys")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/phy_device.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 04946de74fa0..85ba95b598b5 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -794,8 +794,10 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
/* Grab the bits from PHYIR2, and put them in the lower half */
phy_reg = mdiobus_read(bus, addr, MII_PHYSID2);
- if (phy_reg < 0)
- return -EIO;
+ if (phy_reg < 0) {
+ /* returning -ENODEV doesn't stop bus scanning */
+ return (phy_reg == -EIO || phy_reg == -ENODEV) ? -ENODEV : -EIO;
+ }
*phy_id |= phy_reg;
--
2.17.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox