* Re: [PATCH net-next] net: hns3: remove unnecessary pci_set_drvdata() and devm_kfree()
From: David Miller @ 2018-03-29 18:35 UTC (permalink / raw)
To: weiyongjun1; +Cc: yisen.zhuang, salil.mehta, netdev, kernel-janitors
In-Reply-To: <1522241461-77556-1-git-send-email-weiyongjun1@huawei.com>
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Wed, 28 Mar 2018 12:51:01 +0000
> The devm_kfree function allocates memory that is released when a
devm_kfree doesn't allocate memory, it frees it.
Your commit log message is confusing at best. I know what you're
trying to say, but a lot of the logic is reversed or hard to
understand.
Thank you.
^ permalink raw reply
* Re: [PATCH] test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment()
From: David Miller @ 2018-03-29 18:33 UTC (permalink / raw)
To: daniel; +Cc: yhs, dan.carpenter, ast, netdev, kernel-janitors
In-Reply-To: <c76d47e1-100c-c2f3-4712-b338b80673f7@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Wed, 28 Mar 2018 20:57:27 +0200
> If you have a chance, please take this fix directly into your net-next tree
> since it also contains the original commit 76db8087c4c9 ("net: bpf: add a
> test for skb_segment in test_bpf module"), which is not in the bpf-next tree
> at this point.
Ok, done.
^ permalink raw reply
* Re: [PATCH net 1/1] qede: Do not drop rx-checksum invalidated packets.
From: David Miller @ 2018-03-29 18:32 UTC (permalink / raw)
To: manish.chopra; +Cc: netdev, ariel.elior
In-Reply-To: <20180328103552.5632-1-manish.chopra@cavium.com>
From: Manish Chopra <manish.chopra@cavium.com>
Date: Wed, 28 Mar 2018 03:35:52 -0700
> Today, driver drops received packets which are indicated as
> invalid checksum by the device. Instead of dropping such packets,
> pass them to the stack with CHECKSUM_NONE indication in skb.
>
> Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
> Signed-off-by: Manish Chopra <manish.chopra@cavium.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] sfp: allow cotsworks modules
From: David Miller @ 2018-03-29 18:31 UTC (permalink / raw)
To: rmk+kernel; +Cc: andrew, f.fainelli, netdev
In-Reply-To: <E1f189x-00059j-J9@rmk-PC.armlinux.org.uk>
From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Wed, 28 Mar 2018 11:18:25 +0100
> Cotsworks modules fail the checksums - it appears that Cotsworks
> reprograms the EEPROM at the end of production with the final product
> information (serial, date code, and exact part number for module
> options) and fails to update the checksum.
>
> Work around this by detecting the Cotsworks name in the manufacturer
> field, and reducing the checksum failures to warnings rather than a
> hard error.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Applied, thanks Russell.
^ permalink raw reply
* Re: [PATCH net-next v3 0/5] qed*: Flash upgrade support.
From: David Miller @ 2018-03-29 18:30 UTC (permalink / raw)
To: sudarsana.kalluru; +Cc: netdev, Ariel.Elior, yuvalm
In-Reply-To: <20180328121423.7718-1-sudarsana.kalluru@cavium.com>
From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Date: Wed, 28 Mar 2018 05:14:18 -0700
> From: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
>
> The patch series adds adapter flash upgrade support for qed/qede drivers.
>
> Please consider applying it to net-next branch.
Series applied, thank you.
^ permalink raw reply
* Re: [PATCH v2 net-next 2/2] net: dsa: mv88e6xxx: Make VTU miss violations less spammy
From: Florian Fainelli @ 2018-03-29 18:27 UTC (permalink / raw)
To: Andrew Lunn, David Miller; +Cc: netdev
In-Reply-To: <1522273829-23542-3-git-send-email-andrew@lunn.ch>
On 03/28/2018 02:50 PM, Andrew Lunn wrote:
> VTU miss violations can happen under normal conditions. Don't spam the
> kernel log, downgrade the output to debug level only. The statistics
> counter will indicate it is happening, if anybody not debugging is
> interested.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Revivewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reported-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply
* Re: [PATCH v2 net-next 1/2] net: dsa: mv88e6xxx: Keep ATU/VTU violation statistics
From: Florian Fainelli @ 2018-03-29 18:27 UTC (permalink / raw)
To: Andrew Lunn, David Miller; +Cc: netdev, vivien.didelot
In-Reply-To: <1522273829-23542-2-git-send-email-andrew@lunn.ch>
On 03/28/2018 02:50 PM, Andrew Lunn wrote:
> Count the numbers of various ATU and VTU violation statistics and
> return them as part of the ethtool -S statistics.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply
* Re: [PATCH net-next 0/9] devlink: Add support for region access
From: Andrew Lunn @ 2018-03-29 18:23 UTC (permalink / raw)
To: Rahul Lakkireddy, Alex Vesker
Cc: David S. Miller, netdev, Tariq Toukan, Jiri Pirko
In-Reply-To: <1522339672-18273-1-git-send-email-valex@mellanox.com>
On Thu, Mar 29, 2018 at 07:07:43PM +0300, Alex Vesker wrote:
> This is a proposal which will allow access to driver defined address
> regions using devlink. Each device can create its supported address
> regions and register them. A device which exposes a region will allow
> access to it using devlink.
Hi Alex
Did you see the work Rahul Lakkireddy has been doing?
https://patchwork.kernel.org/patch/10305935/
It seems like these are similar, or at least overlapping. We probably
want one solution for both.
Andrew
^ permalink raw reply
* [PATCH] PCI: allow drivers to limit the number of VFs to 0
From: Jakub Kicinski @ 2018-03-29 18:22 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-pci, netdev, Sathya Perla, Felix Manlunas, alexander.duyck,
john.fastabend, Jacob Keller, Donald Dutile, oss-drivers,
Jakub Kicinski
Some user space depends on driver allowing sriov_totalvfs to be
enabled. For devices which VF support depends on loaded FW we
have the pci_sriov_{g,s}et_totalvfs() API. However, this API
uses 0 as a special "unset" value, meaning drivers can't limit
sriov_totalvfs to 0. Change the special value to be U16_MAX.
Use simple min() to determine actual totalvfs.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
drivers/net/ethernet/netronome/nfp/nfp_main.c | 6 +++---
drivers/pci/iov.c | 6 ++----
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c
index c4b1f344b4da..dcd6e208a155 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c
@@ -123,7 +123,7 @@ static int nfp_pcie_sriov_read_nfd_limit(struct nfp_pf *pf)
return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs);
pf->limit_vfs = ~0;
- pci_sriov_set_totalvfs(pf->pdev, 0); /* 0 is unset */
+ pci_sriov_set_totalvfs(pf->pdev, ~0);
/* Allow any setting for backwards compatibility if symbol not found */
if (err == -ENOENT)
return 0;
@@ -537,7 +537,7 @@ static int nfp_pci_probe(struct pci_dev *pdev,
err_net_remove:
nfp_net_pci_remove(pf);
err_sriov_unlimit:
- pci_sriov_set_totalvfs(pf->pdev, 0);
+ pci_sriov_set_totalvfs(pf->pdev, ~0);
err_fw_unload:
kfree(pf->rtbl);
nfp_mip_close(pf->mip);
@@ -570,7 +570,7 @@ static void nfp_pci_remove(struct pci_dev *pdev)
nfp_hwmon_unregister(pf);
nfp_pcie_sriov_disable(pdev);
- pci_sriov_set_totalvfs(pf->pdev, 0);
+ pci_sriov_set_totalvfs(pf->pdev, ~0);
nfp_net_pci_remove(pf);
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 677924ae0350..aa3dfe3ecd68 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -446,6 +446,7 @@ static int sriov_init(struct pci_dev *dev, int pos)
pci_read_config_word(dev, pos + PCI_SRIOV_VF_DID, &iov->vf_device);
iov->pgsz = pgsz;
iov->self = dev;
+ iov->driver_max_VFs = U16_MAX;
iov->drivers_autoprobe = true;
pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap);
pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link);
@@ -801,9 +802,6 @@ int pci_sriov_get_totalvfs(struct pci_dev *dev)
if (!dev->is_physfn)
return 0;
- if (dev->sriov->driver_max_VFs)
- return dev->sriov->driver_max_VFs;
-
- return dev->sriov->total_VFs;
+ return min(dev->sriov->total_VFs, dev->sriov->driver_max_VFs);
}
EXPORT_SYMBOL_GPL(pci_sriov_get_totalvfs);
--
2.16.2
^ permalink raw reply related
* Re: [PATCH v2 net-next] qed*: Utilize FW 8.33.11.0
From: David Miller @ 2018-03-29 18:18 UTC (permalink / raw)
To: Michal.Kalderon
Cc: netdev, linux-rdma, linux-scsi, Tomer.Tayar, Manish.Rangankar,
Ariel.Elior
In-Reply-To: <1522226536-9812-1-git-send-email-Michal.Kalderon@cavium.com>
From: Michal Kalderon <Michal.Kalderon@cavium.com>
Date: Wed, 28 Mar 2018 11:42:16 +0300
> This FW contains several fixes and features
>
> RDMA Features
> - SRQ support
> - XRC support
> - Memory window support
> - RDMA low latency queue support
> - RDMA bonding support
>
> RDMA bug fixes
> - RDMA remote invalidate during retransmit fix
> - iWARP MPA connect interop issue with RTR fix
> - iWARP Legacy DPM support
> - Fix MPA reject flow
> - iWARP error handling
> - RQ WQE validation checks
>
> MISC
> - Fix some HSI types endianity
> - New Restriction: vlan insertion in core_tx_bd_data can't be set
> for LB packets
>
> ETH
> - HW QoS offload support
> - Fix vlan, dcb and sriov flow of VF sending a packet with
> inband VLAN tag instead of default VLAN
> - Allow GRE version 1 offloads in RX flow
> - Allow VXLAN steering
>
> iSCSI / FcoE
> - Fix bd availability checking flow
> - Support 256th sge proerly in iscsi/fcoe retransmit
> - Performance improvement
> - Fix handle iSCSI command arrival with AHS and with immediate
> - Fix ipv6 traffic class configuration
>
> DEBUG
> - Update debug utilities
>
> Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
> Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
> Signed-off-by: Manish Rangankar <Manish.Rangankar@cavium.com>
> Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
> ---
> Changes from v1
> Remove version bump and qedr module version addition
Applied.
^ permalink raw reply
* Re: [PATCH net-next] ipv6: export ip6 fragments sysctl to unprivileged users
From: David Miller @ 2018-03-29 18:14 UTC (permalink / raw)
To: edumazet; +Cc: netdev, eric.dumazet, kernel
In-Reply-To: <20180328024942.147207-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Tue, 27 Mar 2018 19:49:42 -0700
> IPv4 was changed in commit 52a773d645e9 ("net: Export ip fragment
> sysctl to unprivileged users")
>
> The only sysctl that is not per-netns is not used :
> ip6frag_secret_interval
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] liquidio: Prioritize control messages
From: David Miller @ 2018-03-29 18:14 UTC (permalink / raw)
To: felix.manlunas
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
intiyaz.basha
In-Reply-To: <20180328022518.GA9011@felix-thinkpad.cavium.com>
From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Tue, 27 Mar 2018 19:25:18 -0700
> From: Intiyaz Basha <intiyaz.basha@cavium.com>
>
> During heavy tx traffic, control messages (sent by liquidio driver to NIC
> firmware) sometimes do not get processed in a timely manner. Reason is:
> the low-level metadata of control messages and that of egress network
> packets indicate that they have the same priority.
>
> Fix it by setting a higher priority for control messages through the new
> ctrl_qpg field in the oct_txpciq struct. It is the NIC firmware that does
> the actual setting of priority by writing to the new ctrl_qpg field; the
> host driver treats that value as opaque and just assigns it to pki_ih3->qpg
>
> Signed-off-by: Intiyaz Basha <intiyaz.basha@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Applied.
^ permalink raw reply
* [PATCH V2 net-next] liquidio: prevent rx queues from getting stalled
From: Felix Manlunas @ 2018-03-29 18:13 UTC (permalink / raw)
To: davem
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
felix.manlunas
From: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
This commit has fix for RX traffic issues when we stress test the driver
with continuous ifconfig up/down under very high traffic conditions.
Reason for the issue is that, in existing liquidio_stop function NAPI is
disabled even before actual FW/HW interface is brought down via
send_rx_ctrl_cmd(lio, 0). Between time frame of NAPI disable and actual
interface down in firmware, firmware continuously enqueues rx traffic to
host. When interrupt happens for new packets, host irq handler fails in
scheduling NAPI as the NAPI is already disabled.
After "ifconfig <iface> up", Host re-enables NAPI but cannot schedule it
until it receives another Rx interrupt. Host never receives Rx interrupt as
it never cleared the Rx interrupt it received during interface down
operation. NIC Rx interrupt gets cleared only when Host processes queue and
clears the queue counts. Above anomaly leads to other issues like packet
overflow in FW/HW queues, backpressure.
Fix:
This commit fixes this issue by disabling NAPI only after informing
firmware to stop queueing packets to host via send_rx_ctrl_cmd(lio, 0).
send_rx_ctrl_cmd is not visible in the patch as it is already there in the
code. The DOWN command also waits for any pending packets to be processed
by NAPI so that the deadlock will not occur.
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Acked-by: Derek Chickles <derek.chickles@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
---
Patch Change Log:
V1 -> V2:
Revised the subject line and patch description to add clarity.
No change in the actual code.
drivers/net/ethernet/cavium/liquidio/lio_core.c | 23 ++++++++++++++++++++
drivers/net/ethernet/cavium/liquidio/lio_main.c | 25 +++++++++++++---------
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 23 ++++++++++++--------
.../net/ethernet/cavium/liquidio/octeon_network.h | 1 +
4 files changed, 53 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
index 73e70e0..2a94eee 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
@@ -1146,3 +1146,26 @@ int liquidio_change_mtu(struct net_device *netdev, int new_mtu)
octeon_free_soft_command(oct, sc);
return 0;
}
+
+int lio_wait_for_clean_oq(struct octeon_device *oct)
+{
+ int retry = 100, pending_pkts = 0;
+ int idx;
+
+ do {
+ pending_pkts = 0;
+
+ for (idx = 0; idx < MAX_OCTEON_OUTPUT_QUEUES(oct); idx++) {
+ if (!(oct->io_qmask.oq & BIT_ULL(idx)))
+ continue;
+ pending_pkts +=
+ atomic_read(&oct->droq[idx]->pkts_pending);
+ }
+
+ if (pending_pkts > 0)
+ schedule_timeout_uninterruptible(1);
+
+ } while (retry-- && pending_pkts);
+
+ return pending_pkts;
+}
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index 43c5ba0..603a144 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -2084,16 +2084,6 @@ static int liquidio_stop(struct net_device *netdev)
struct octeon_device *oct = lio->oct_dev;
struct napi_struct *napi, *n;
- if (oct->props[lio->ifidx].napi_enabled) {
- list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list)
- napi_disable(napi);
-
- oct->props[lio->ifidx].napi_enabled = 0;
-
- if (OCTEON_CN23XX_PF(oct))
- oct->droq[0]->ops.poll_mode = 0;
- }
-
ifstate_reset(lio, LIO_IFSTATE_RUNNING);
netif_tx_disable(netdev);
@@ -2119,6 +2109,21 @@ static int liquidio_stop(struct net_device *netdev)
lio->ptp_clock = NULL;
}
+ /* Wait for any pending Rx descriptors */
+ if (lio_wait_for_clean_oq(oct))
+ netif_info(lio, rx_err, lio->netdev,
+ "Proceeding with stop interface after partial RX desc processing\n");
+
+ if (oct->props[lio->ifidx].napi_enabled == 1) {
+ list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list)
+ napi_disable(napi);
+
+ oct->props[lio->ifidx].napi_enabled = 0;
+
+ if (OCTEON_CN23XX_PF(oct))
+ oct->droq[0]->ops.poll_mode = 0;
+ }
+
dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name);
return 0;
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index dc62698..f92dfa4 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -1138,15 +1138,6 @@ static int liquidio_stop(struct net_device *netdev)
/* tell Octeon to stop forwarding packets to host */
send_rx_ctrl_cmd(lio, 0);
- if (oct->props[lio->ifidx].napi_enabled) {
- list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list)
- napi_disable(napi);
-
- oct->props[lio->ifidx].napi_enabled = 0;
-
- oct->droq[0]->ops.poll_mode = 0;
- }
-
netif_info(lio, ifdown, lio->netdev, "Stopping interface!\n");
/* Inform that netif carrier is down */
lio->intf_open = 0;
@@ -1159,6 +1150,20 @@ static int liquidio_stop(struct net_device *netdev)
stop_txqs(netdev);
+ /* Wait for any pending Rx descriptors */
+ if (lio_wait_for_clean_oq(oct))
+ netif_info(lio, rx_err, lio->netdev,
+ "Proceeding with stop interface after partial RX desc processing\n");
+
+ if (oct->props[lio->ifidx].napi_enabled == 1) {
+ list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list)
+ napi_disable(napi);
+
+ oct->props[lio->ifidx].napi_enabled = 0;
+
+ oct->droq[0]->ops.poll_mode = 0;
+ }
+
dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name);
return 0;
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_network.h b/drivers/net/ethernet/cavium/liquidio/octeon_network.h
index 8782206..4069710 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_network.h
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_network.h
@@ -190,6 +190,7 @@ irqreturn_t liquidio_msix_intr_handler(int irq __attribute__((unused)),
int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs);
+int lio_wait_for_clean_oq(struct octeon_device *oct);
/**
* \brief Register ethtool operations
* @param netdev pointer to network device
^ permalink raw reply related
* Re: [PATCH net-next 6/6] netdevsim: Add simple FIB resource controller via devlink
From: David Miller @ 2018-03-29 18:11 UTC (permalink / raw)
To: jakub.kicinski; +Cc: dsa, netdev, roopa, shm, jiri, idosch, andy.roulin
In-Reply-To: <20180327183450.34d6e9b6@cakuba.netronome.com>
From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Tue, 27 Mar 2018 18:34:50 -0700
> On Tue, 27 Mar 2018 18:22:00 -0700, David Ahern wrote:
>> +void nsim_devlink_setup(struct netdevsim *ns)
>> +{
...
> nit: DaveM expressed preference to not have silent failures in a
> discussion about DebugFS, not sure it applies here, but why not
> handle errors?
Yes it is a concern.
David please address this as a follow-up.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/6] net: Allow FIB notifiers to fail add and replace
From: David Miller @ 2018-03-29 18:11 UTC (permalink / raw)
To: dsa; +Cc: netdev, roopa, shm, jiri, idosch, jakub.kicinski, andy.roulin
In-Reply-To: <20180328012200.15175-1-dsa@cumulusnetworks.com>
From: David Ahern <dsa@cumulusnetworks.com>
Date: Tue, 27 Mar 2018 18:21:54 -0700
> I wanted to revisit how resource overload is handled for hardware offload
> of FIB entries and rules. At the moment, the in-kernel fib notifier can
> tell a driver about a route or rule add, replace, and delete, but the
> notifier can not affect the action. Specifically, in the case of mlxsw
> if a route or rule add is going to overflow the ASIC resources the only
> recourse is to abort hardware offload. Aborting offload is akin to taking
> down the switch as the path from data plane to the control plane simply
> can not support the traffic bandwidth of the front panel ports. Further,
> the current state of FIB notifiers is inconsistent with other resources
> where a driver can affect a user request - e.g., enslavement of a port
> into a bridge or a VRF.
>
> As a result of the work done over the past 3+ years, I believe we are
> at a point where we can bring consistency to the stack and offloads,
> and reliably allow the FIB notifiers to fail a request, pushing an error
> along with a suitable error message back to the user. Rather than
> aborting offload when the switch is out of resources, userspace is simply
> prevented from adding more routes and has a clear indication of why.
>
> This set does not resolve the corner case where rules or routes not
> supported by the device are installed prior to the driver getting loaded
> and registering for FIB notifications. In that case, hardware offload has
> not been established and it can refuse to offload anything, sending
> errors back to userspace via extack. Since conceptually the driver owns
> the netdevices associated with its asic, this corner case mainly applies
> to unsupported rules and any races during the bringup phase.
>
> Patch 1 fixes call_fib_notifiers to extract the errno from the encoded
> response from handlers.
>
> Patches 2-5 allow the call to call_fib_notifiers to fail the add or
> replace of a route or rule.
>
> Patch 6 adds a simple resource controller to netdevsim to illustrate
> how a FIB resource controller can limit the number of route entries.
Series applied, thanks David.
^ permalink raw reply
* Re: [PATCH 07/30] aio: add delayed cancel support
From: Christoph Hellwig @ 2018-03-29 18:08 UTC (permalink / raw)
To: Al Viro
Cc: Christoph Hellwig, Avi Kivity, linux-aio, linux-fsdevel, netdev,
linux-api, linux-kernel
In-Reply-To: <20180329142506.GX30522@ZenIV.linux.org.uk>
On Thu, Mar 29, 2018 at 03:25:06PM +0100, Al Viro wrote:
> OK. Let's leave that alone for now. Re deferred cancels - AFAICS, we *must*
> remove the sucker from ctx->active_reqs before dropping ->ctx_lock.
>
> As it is, you are creating a io_cancel()/io_cancel() race leading to double
> fput(). It's not that hard to fix; I can do that myself while applying your
> series (as described in previous posting - kiocb_cancel_locked() returning
> NULL or ERR_PTR() in non-deferred case and pointer to aio_kiocb removed from
> ->active_reqs in deferred one) or you could fix it in some other way and
> update your branch.
I think that is the right fix. Let me resend so that I can test the
result first.
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
^ permalink raw reply
* Re: [PATCH net-next] net/mlx4_en: CHECKSUM_COMPLETE support for fragments
From: David Miller @ 2018-03-29 18:07 UTC (permalink / raw)
To: edumazet; +Cc: netdev, eric.dumazet, willemb, tariqt
In-Reply-To: <20180327212114.164202-1-edumazet@google.com>
From: Eric Dumazet <edumazet@google.com>
Date: Tue, 27 Mar 2018 14:21:14 -0700
> Refine the RX check summing handling to propagate the
> hardware provided checksum so that we do not have to
> compute it later in software.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Tariq, please review.
^ permalink raw reply
* Vmbus series...
From: David Miller @ 2018-03-29 18:06 UTC (permalink / raw)
To: longli; +Cc: netdev, linux-scsi
Please feel free put it in via the scsi tree:
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [pull request][net-next 00/15] Mellanox, mlx5 mlx5-updates-2018-03-27
From: David Miller @ 2018-03-29 18:04 UTC (permalink / raw)
To: saeedm; +Cc: netdev
In-Reply-To: <20180328004249.3796-1-saeedm@mellanox.com>
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Tue, 27 Mar 2018 17:42:34 -0700
> This series contains Misc updates and cleanups for mlx5e rx path
> and SQ recovery feature for tx path.
>
> For more information please see tag log below.
>
> Please pull and let me know if there's any problem.
Pulled, thank you.
^ permalink raw reply
* Re: [iproute2-next 0/2] tipc: changes to addressing structure
From: David Ahern @ 2018-03-29 17:58 UTC (permalink / raw)
To: Jon Maloy, davem, netdev
Cc: mohan.krishna.ghanta.krishnamurthy, tung.q.nguyen, hoang.h.le,
canh.d.luu, ying.xue, tipc-discussion
In-Reply-To: <01b6fe63-def9-4c67-cdb3-a88a07964f83@gmail.com>
On 3/29/18 11:52 AM, David Ahern wrote:
> On 3/28/18 10:52 AM, Jon Maloy wrote:
>> 1: We introduce ability to set/get 128-bit node identities
>> 2: We rename 'net id' to 'cluster id' in the command API,
>> of course in a compatible way.
>> 3: We print out all 32-bit node addresses as an integer in hex format,
>> i.e., we remove the assumption about an internal structure.
>>
>
> Applied to iproute2-next. Thanks,
>
BTW, please consider adding json support to tipc. It will make tipc
command more robust to changes in output format.
^ permalink raw reply
* Re: [PATCH net-next 3/3] net: bcmgenet: Fix coalescing settings handling
From: Florian Fainelli @ 2018-03-29 17:54 UTC (permalink / raw)
To: Doug Berger, netdev
Cc: davem, jaedon.shin, pgynther, Michael Chan, gospo, talgi, saeedm
In-Reply-To: <b8d41df2-8052-2f9e-8da7-b45c5d5ee768@gmail.com>
On 03/29/2018 10:51 AM, Doug Berger wrote:
> On 03/27/2018 12:47 PM, Florian Fainelli wrote:
>> There were a number of issues with setting the RX coalescing parameters:
>>
>> - we would not be preserving values that would have been configured
>> across close/open calls, instead we would always reset to no timeout
>> and 1 interrupt per packet, this would also prevent DIM from setting its
>> default usec/pkts values
>>
>> - when adaptive RX would be turned on, we woud not be fetching the
>> default parameters, we would stay with no timeout/1 packet per interrupt
>> until the estimator kicks in and changes that
>>
>> - finally disabling adaptive RX coalescing while providing parameters
>> would not be honored, and we would stay with whatever DIM had previously
>> determined instead of the user requested parameters
>>
>> Fixes: 9f4ca05827a2 ("net: bcmgenet: Add support for adaptive RX coalescing")
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> drivers/net/ethernet/broadcom/genet/bcmgenet.c | 78 ++++++++++++++++++--------
>> drivers/net/ethernet/broadcom/genet/bcmgenet.h | 4 +-
>> 2 files changed, 57 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>> index 7db8edc643ec..76409debb796 100644
>> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>> @@ -625,18 +625,18 @@ static int bcmgenet_get_coalesce(struct net_device *dev,
>> return 0;
>> }
>>
>> -static void bcmgenet_set_rx_coalesce(struct bcmgenet_rx_ring *ring)
>> +static void bcmgenet_set_rx_coalesce(struct bcmgenet_rx_ring *ring,
>> + u32 usecs, u32 pkts)
>> {
>> struct bcmgenet_priv *priv = ring->priv;
>> unsigned int i = ring->index;
>> u32 reg;
>>
>> - bcmgenet_rdma_ring_writel(priv, i, ring->dim.coal_pkts,
>> - DMA_MBUF_DONE_THRESH);
>> + bcmgenet_rdma_ring_writel(priv, i, pkts, DMA_MBUF_DONE_THRESH);
>>
>> reg = bcmgenet_rdma_readl(priv, DMA_RING0_TIMEOUT + i);
>> reg &= ~DMA_TIMEOUT_MASK;
>> - reg |= DIV_ROUND_UP(ring->dim.coal_usecs * 1000, 8192);
>> + reg |= DIV_ROUND_UP(usecs * 1000, 8192);
>> bcmgenet_rdma_writel(priv, reg, DMA_RING0_TIMEOUT + i);
>> }
>>
>> @@ -645,6 +645,8 @@ static int bcmgenet_set_coalesce(struct net_device *dev,
>> {
>> struct bcmgenet_priv *priv = netdev_priv(dev);
>> struct bcmgenet_rx_ring *ring;
>> + struct net_dim_cq_moder moder;
>> + u32 usecs, pkts;
>> unsigned int i;
>>
>> /* Base system clock is 125Mhz, DMA timeout is this reference clock
>> @@ -682,25 +684,37 @@ static int bcmgenet_set_coalesce(struct net_device *dev,
>>
>> for (i = 0; i < priv->hw_params->rx_queues; i++) {
>> ring = &priv->rx_rings[i];
>> - ring->dim.coal_usecs = ec->rx_coalesce_usecs;
>> - ring->dim.coal_pkts = ec->rx_max_coalesced_frames;
>> - if (!ec->use_adaptive_rx_coalesce && ring->dim.use_dim) {
>> - ring->dim.coal_pkts = 1;
>> - ring->dim.coal_usecs = 0;
>> +
>> + ring->rx_coalesce_usecs = ec->rx_coalesce_usecs;
>> + ring->rx_max_coalesced_frames = ec->rx_max_coalesced_frames;
>> + usecs = ring->rx_coalesce_usecs;
>> + pkts = ring->rx_max_coalesced_frames;
>> +
>> + if (ec->use_adaptive_rx_coalesce) {
>> + moder = net_dim_get_def_profile(ring->dim.dim.mode);
>> + usecs = moder.usec;
>> + pkts = moder.pkts;
>> }
>> +
>> ring->dim.use_dim = ec->use_adaptive_rx_coalesce;
>> - bcmgenet_set_rx_coalesce(ring);
>> + bcmgenet_set_rx_coalesce(ring, usecs, pkts);
> You might want to put this loop code in a separate function with ring
> and ec parameters
Indeed, that also itched me, v2 has this in a function:
http://patchwork.ozlabs.org/patch/892509/
(gmail coalescing threads, oh oh oh, what a good pun).
Thanks!
--
Florian
^ permalink raw reply
* Re: [PATCH net-next 3/3] net: bcmgenet: Fix coalescing settings handling
From: Doug Berger @ 2018-03-29 17:53 UTC (permalink / raw)
To: Florian Fainelli, netdev
Cc: davem, jaedon.shin, pgynther, Michael Chan, gospo, talgi, saeedm
In-Reply-To: <b8d41df2-8052-2f9e-8da7-b45c5d5ee768@gmail.com>
On 03/29/2018 10:51 AM, Doug Berger wrote:
> On 03/27/2018 12:47 PM, Florian Fainelli wrote:
>> There were a number of issues with setting the RX coalescing parameters:
>>
>> - we would not be preserving values that would have been configured
>> across close/open calls, instead we would always reset to no timeout
>> and 1 interrupt per packet, this would also prevent DIM from setting its
>> default usec/pkts values
>>
>> - when adaptive RX would be turned on, we woud not be fetching the
>> default parameters, we would stay with no timeout/1 packet per interrupt
>> until the estimator kicks in and changes that
>>
>> - finally disabling adaptive RX coalescing while providing parameters
>> would not be honored, and we would stay with whatever DIM had previously
>> determined instead of the user requested parameters
>>
>> Fixes: 9f4ca05827a2 ("net: bcmgenet: Add support for adaptive RX coalescing")
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> drivers/net/ethernet/broadcom/genet/bcmgenet.c | 78 ++++++++++++++++++--------
>> drivers/net/ethernet/broadcom/genet/bcmgenet.h | 4 +-
>> 2 files changed, 57 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>> index 7db8edc643ec..76409debb796 100644
>> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
>> @@ -625,18 +625,18 @@ static int bcmgenet_get_coalesce(struct net_device *dev,
>> return 0;
>> }
>>
>> -static void bcmgenet_set_rx_coalesce(struct bcmgenet_rx_ring *ring)
>> +static void bcmgenet_set_rx_coalesce(struct bcmgenet_rx_ring *ring,
>> + u32 usecs, u32 pkts)
>> {
>> struct bcmgenet_priv *priv = ring->priv;
>> unsigned int i = ring->index;
>> u32 reg;
>>
>> - bcmgenet_rdma_ring_writel(priv, i, ring->dim.coal_pkts,
>> - DMA_MBUF_DONE_THRESH);
>> + bcmgenet_rdma_ring_writel(priv, i, pkts, DMA_MBUF_DONE_THRESH);
>>
>> reg = bcmgenet_rdma_readl(priv, DMA_RING0_TIMEOUT + i);
>> reg &= ~DMA_TIMEOUT_MASK;
>> - reg |= DIV_ROUND_UP(ring->dim.coal_usecs * 1000, 8192);
>> + reg |= DIV_ROUND_UP(usecs * 1000, 8192);
>> bcmgenet_rdma_writel(priv, reg, DMA_RING0_TIMEOUT + i);
>> }
>>
>> @@ -645,6 +645,8 @@ static int bcmgenet_set_coalesce(struct net_device *dev,
>> {
>> struct bcmgenet_priv *priv = netdev_priv(dev);
>> struct bcmgenet_rx_ring *ring;
>> + struct net_dim_cq_moder moder;
>> + u32 usecs, pkts;
>> unsigned int i;
>>
>> /* Base system clock is 125Mhz, DMA timeout is this reference clock
>> @@ -682,25 +684,37 @@ static int bcmgenet_set_coalesce(struct net_device *dev,
>>
>> for (i = 0; i < priv->hw_params->rx_queues; i++) {
>> ring = &priv->rx_rings[i];
>> - ring->dim.coal_usecs = ec->rx_coalesce_usecs;
>> - ring->dim.coal_pkts = ec->rx_max_coalesced_frames;
>> - if (!ec->use_adaptive_rx_coalesce && ring->dim.use_dim) {
>> - ring->dim.coal_pkts = 1;
>> - ring->dim.coal_usecs = 0;
>> +
>> + ring->rx_coalesce_usecs = ec->rx_coalesce_usecs;
>> + ring->rx_max_coalesced_frames = ec->rx_max_coalesced_frames;
>> + usecs = ring->rx_coalesce_usecs;
>> + pkts = ring->rx_max_coalesced_frames;
>> +
>> + if (ec->use_adaptive_rx_coalesce) {
>> + moder = net_dim_get_def_profile(ring->dim.dim.mode);
>> + usecs = moder.usec;
>> + pkts = moder.pkts;
>> }
>> +
>> ring->dim.use_dim = ec->use_adaptive_rx_coalesce;
>> - bcmgenet_set_rx_coalesce(ring);
>> + bcmgenet_set_rx_coalesce(ring, usecs, pkts);
> You might want to put this loop code in a separate function with ring
> and ec parameters
>
>> }
>>
>> ring = &priv->rx_rings[DESC_INDEX];
>> - ring->dim.coal_usecs = ec->rx_coalesce_usecs;
>> - ring->dim.coal_pkts = ec->rx_max_coalesced_frames;
>> - if (!ec->use_adaptive_rx_coalesce && ring->dim.use_dim) {
>> - ring->dim.coal_pkts = 1;
>> - ring->dim.coal_usecs = 0;
>> +
>> + ring->rx_coalesce_usecs = ec->rx_coalesce_usecs;
>> + ring->rx_max_coalesced_frames = ec->rx_max_coalesced_frames;
>> + usecs = ring->rx_coalesce_usecs;
>> + pkts = ring->rx_max_coalesced_frames;
>> +
>> + if (ec->use_adaptive_rx_coalesce) {
>> + moder = net_dim_get_def_profile(ring->dim.dim.mode);
>> + usecs = moder.usec;
>> + pkts = moder.pkts;
>> }
>> +
>> ring->dim.use_dim = ec->use_adaptive_rx_coalesce;
>> - bcmgenet_set_rx_coalesce(ring);
>> + bcmgenet_set_rx_coalesce(ring, usecs, pkts);
> so you don't need to repeat it here. (just for maintenance reasons)
Looks like you already did in V2 :)!
I should read my mail more frequently ;).
>
>>
>> return 0;
>> }
>> @@ -1924,10 +1938,7 @@ static void bcmgenet_dim_work(struct work_struct *work)
>> struct net_dim_cq_moder cur_profile =
>> net_dim_get_profile(dim->mode, dim->profile_ix);
>>
>> - ring->dim.coal_usecs = cur_profile.usec;
>> - ring->dim.coal_pkts = cur_profile.pkts;
>> -
>> - bcmgenet_set_rx_coalesce(ring);
>> + bcmgenet_set_rx_coalesce(ring, cur_profile.usec, cur_profile.pkts);
>> dim->state = NET_DIM_START_MEASURE;
>> }
>>
>> @@ -2079,14 +2090,30 @@ static void init_umac(struct bcmgenet_priv *priv)
>> dev_dbg(kdev, "done init umac\n");
>> }
>>
>> -static void bcmgenet_init_dim(struct bcmgenet_net_dim *dim,
>> +static void bcmgenet_init_dim(struct bcmgenet_rx_ring *ring,
>> void (*cb)(struct work_struct *work))
>> {
>> + struct bcmgenet_net_dim *dim = &ring->dim;
>> + struct net_dim_cq_moder moder;
>> + u32 usecs, pkts;
>> +
>> INIT_WORK(&dim->dim.work, cb);
>> dim->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
>> dim->event_ctr = 0;
>> dim->packets = 0;
>> dim->bytes = 0;
>> +
>> + usecs = ring->rx_coalesce_usecs;
>> + pkts = ring->rx_max_coalesced_frames;
>> +
>> + /* If DIM was enabled, re-apply default parameters */
>> + if (dim->use_dim) {
>> + moder = net_dim_get_def_profile(dim->dim.mode);
>> + usecs = moder.usec;
>> + pkts = moder.pkts;
>> + }
>> +
>> + bcmgenet_set_rx_coalesce(ring, usecs, pkts);
>> }
>>
>> /* Initialize a Tx ring along with corresponding hardware registers */
>> @@ -2178,7 +2205,7 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv,
>> if (ret)
>> return ret;
>>
>> - bcmgenet_init_dim(&ring->dim, bcmgenet_dim_work);
>> + bcmgenet_init_dim(ring, bcmgenet_dim_work);
>>
>> /* Initialize Rx NAPI */
>> netif_napi_add(priv->dev, &ring->napi, bcmgenet_rx_poll,
>> @@ -2186,7 +2213,6 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv,
>>
>> bcmgenet_rdma_ring_writel(priv, index, 0, RDMA_PROD_INDEX);
>> bcmgenet_rdma_ring_writel(priv, index, 0, RDMA_CONS_INDEX);
>> - bcmgenet_rdma_ring_writel(priv, index, 1, DMA_MBUF_DONE_THRESH);
>> bcmgenet_rdma_ring_writel(priv, index,
>> ((size << DMA_RING_SIZE_SHIFT) |
>> RX_BUF_LENGTH), DMA_RING_BUF_SIZE);
>> @@ -3424,6 +3450,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
>> struct net_device *dev;
>> const void *macaddr;
>> struct resource *r;
>> + unsigned int i;
>> int err = -EIO;
>> const char *phy_mode_str;
>>
>> @@ -3552,6 +3579,11 @@ static int bcmgenet_probe(struct platform_device *pdev)
>> netif_set_real_num_tx_queues(priv->dev, priv->hw_params->tx_queues + 1);
>> netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1);
>>
>> + /* Set default coalescing parameters */
>> + for (i = 0; i < priv->hw_params->rx_queues; i++)
>> + priv->rx_rings[i].rx_max_coalesced_frames = 1;
>> + priv->rx_rings[DESC_INDEX].rx_max_coalesced_frames = 1;
>> +
>> /* libphy will determine the link state */
>> netif_carrier_off(dev);
>>
>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>> index 22c41e0430fb..b773bc07edf7 100644
>> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
>> @@ -578,8 +578,6 @@ struct bcmgenet_net_dim {
>> u16 event_ctr;
>> unsigned long packets;
>> unsigned long bytes;
>> - u32 coal_usecs;
>> - u32 coal_pkts;
>> struct net_dim dim;
>> };
>>
>> @@ -598,6 +596,8 @@ struct bcmgenet_rx_ring {
>> unsigned int end_ptr; /* Rx ring end CB ptr */
>> unsigned int old_discards;
>> struct bcmgenet_net_dim dim;
>> + u32 rx_max_coalesced_frames;
>> + u32 rx_coalesce_usecs;
>> void (*int_enable)(struct bcmgenet_rx_ring *);
>> void (*int_disable)(struct bcmgenet_rx_ring *);
>> struct bcmgenet_priv *priv;
>>
>
^ permalink raw reply
* Re: [iproute2-next 0/2] tipc: changes to addressing structure
From: David Ahern @ 2018-03-29 17:52 UTC (permalink / raw)
To: Jon Maloy, davem, netdev
Cc: mohan.krishna.ghanta.krishnamurthy, tung.q.nguyen, hoang.h.le,
canh.d.luu, ying.xue, tipc-discussion
In-Reply-To: <1522255934-497-1-git-send-email-jon.maloy@ericsson.com>
On 3/28/18 10:52 AM, Jon Maloy wrote:
> 1: We introduce ability to set/get 128-bit node identities
> 2: We rename 'net id' to 'cluster id' in the command API,
> of course in a compatible way.
> 3: We print out all 32-bit node addresses as an integer in hex format,
> i.e., we remove the assumption about an internal structure.
>
Applied to iproute2-next. Thanks,
^ permalink raw reply
* Re: [PATCH net-next 3/3] net: bcmgenet: Fix coalescing settings handling
From: Doug Berger @ 2018-03-29 17:51 UTC (permalink / raw)
To: Florian Fainelli, netdev
Cc: davem, jaedon.shin, pgynther, Michael Chan, gospo, talgi, saeedm
In-Reply-To: <20180327194707.31857-4-f.fainelli@gmail.com>
On 03/27/2018 12:47 PM, Florian Fainelli wrote:
> There were a number of issues with setting the RX coalescing parameters:
>
> - we would not be preserving values that would have been configured
> across close/open calls, instead we would always reset to no timeout
> and 1 interrupt per packet, this would also prevent DIM from setting its
> default usec/pkts values
>
> - when adaptive RX would be turned on, we woud not be fetching the
> default parameters, we would stay with no timeout/1 packet per interrupt
> until the estimator kicks in and changes that
>
> - finally disabling adaptive RX coalescing while providing parameters
> would not be honored, and we would stay with whatever DIM had previously
> determined instead of the user requested parameters
>
> Fixes: 9f4ca05827a2 ("net: bcmgenet: Add support for adaptive RX coalescing")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/ethernet/broadcom/genet/bcmgenet.c | 78 ++++++++++++++++++--------
> drivers/net/ethernet/broadcom/genet/bcmgenet.h | 4 +-
> 2 files changed, 57 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index 7db8edc643ec..76409debb796 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -625,18 +625,18 @@ static int bcmgenet_get_coalesce(struct net_device *dev,
> return 0;
> }
>
> -static void bcmgenet_set_rx_coalesce(struct bcmgenet_rx_ring *ring)
> +static void bcmgenet_set_rx_coalesce(struct bcmgenet_rx_ring *ring,
> + u32 usecs, u32 pkts)
> {
> struct bcmgenet_priv *priv = ring->priv;
> unsigned int i = ring->index;
> u32 reg;
>
> - bcmgenet_rdma_ring_writel(priv, i, ring->dim.coal_pkts,
> - DMA_MBUF_DONE_THRESH);
> + bcmgenet_rdma_ring_writel(priv, i, pkts, DMA_MBUF_DONE_THRESH);
>
> reg = bcmgenet_rdma_readl(priv, DMA_RING0_TIMEOUT + i);
> reg &= ~DMA_TIMEOUT_MASK;
> - reg |= DIV_ROUND_UP(ring->dim.coal_usecs * 1000, 8192);
> + reg |= DIV_ROUND_UP(usecs * 1000, 8192);
> bcmgenet_rdma_writel(priv, reg, DMA_RING0_TIMEOUT + i);
> }
>
> @@ -645,6 +645,8 @@ static int bcmgenet_set_coalesce(struct net_device *dev,
> {
> struct bcmgenet_priv *priv = netdev_priv(dev);
> struct bcmgenet_rx_ring *ring;
> + struct net_dim_cq_moder moder;
> + u32 usecs, pkts;
> unsigned int i;
>
> /* Base system clock is 125Mhz, DMA timeout is this reference clock
> @@ -682,25 +684,37 @@ static int bcmgenet_set_coalesce(struct net_device *dev,
>
> for (i = 0; i < priv->hw_params->rx_queues; i++) {
> ring = &priv->rx_rings[i];
> - ring->dim.coal_usecs = ec->rx_coalesce_usecs;
> - ring->dim.coal_pkts = ec->rx_max_coalesced_frames;
> - if (!ec->use_adaptive_rx_coalesce && ring->dim.use_dim) {
> - ring->dim.coal_pkts = 1;
> - ring->dim.coal_usecs = 0;
> +
> + ring->rx_coalesce_usecs = ec->rx_coalesce_usecs;
> + ring->rx_max_coalesced_frames = ec->rx_max_coalesced_frames;
> + usecs = ring->rx_coalesce_usecs;
> + pkts = ring->rx_max_coalesced_frames;
> +
> + if (ec->use_adaptive_rx_coalesce) {
> + moder = net_dim_get_def_profile(ring->dim.dim.mode);
> + usecs = moder.usec;
> + pkts = moder.pkts;
> }
> +
> ring->dim.use_dim = ec->use_adaptive_rx_coalesce;
> - bcmgenet_set_rx_coalesce(ring);
> + bcmgenet_set_rx_coalesce(ring, usecs, pkts);
You might want to put this loop code in a separate function with ring
and ec parameters
> }
>
> ring = &priv->rx_rings[DESC_INDEX];
> - ring->dim.coal_usecs = ec->rx_coalesce_usecs;
> - ring->dim.coal_pkts = ec->rx_max_coalesced_frames;
> - if (!ec->use_adaptive_rx_coalesce && ring->dim.use_dim) {
> - ring->dim.coal_pkts = 1;
> - ring->dim.coal_usecs = 0;
> +
> + ring->rx_coalesce_usecs = ec->rx_coalesce_usecs;
> + ring->rx_max_coalesced_frames = ec->rx_max_coalesced_frames;
> + usecs = ring->rx_coalesce_usecs;
> + pkts = ring->rx_max_coalesced_frames;
> +
> + if (ec->use_adaptive_rx_coalesce) {
> + moder = net_dim_get_def_profile(ring->dim.dim.mode);
> + usecs = moder.usec;
> + pkts = moder.pkts;
> }
> +
> ring->dim.use_dim = ec->use_adaptive_rx_coalesce;
> - bcmgenet_set_rx_coalesce(ring);
> + bcmgenet_set_rx_coalesce(ring, usecs, pkts);
so you don't need to repeat it here. (just for maintenance reasons)
>
> return 0;
> }
> @@ -1924,10 +1938,7 @@ static void bcmgenet_dim_work(struct work_struct *work)
> struct net_dim_cq_moder cur_profile =
> net_dim_get_profile(dim->mode, dim->profile_ix);
>
> - ring->dim.coal_usecs = cur_profile.usec;
> - ring->dim.coal_pkts = cur_profile.pkts;
> -
> - bcmgenet_set_rx_coalesce(ring);
> + bcmgenet_set_rx_coalesce(ring, cur_profile.usec, cur_profile.pkts);
> dim->state = NET_DIM_START_MEASURE;
> }
>
> @@ -2079,14 +2090,30 @@ static void init_umac(struct bcmgenet_priv *priv)
> dev_dbg(kdev, "done init umac\n");
> }
>
> -static void bcmgenet_init_dim(struct bcmgenet_net_dim *dim,
> +static void bcmgenet_init_dim(struct bcmgenet_rx_ring *ring,
> void (*cb)(struct work_struct *work))
> {
> + struct bcmgenet_net_dim *dim = &ring->dim;
> + struct net_dim_cq_moder moder;
> + u32 usecs, pkts;
> +
> INIT_WORK(&dim->dim.work, cb);
> dim->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE;
> dim->event_ctr = 0;
> dim->packets = 0;
> dim->bytes = 0;
> +
> + usecs = ring->rx_coalesce_usecs;
> + pkts = ring->rx_max_coalesced_frames;
> +
> + /* If DIM was enabled, re-apply default parameters */
> + if (dim->use_dim) {
> + moder = net_dim_get_def_profile(dim->dim.mode);
> + usecs = moder.usec;
> + pkts = moder.pkts;
> + }
> +
> + bcmgenet_set_rx_coalesce(ring, usecs, pkts);
> }
>
> /* Initialize a Tx ring along with corresponding hardware registers */
> @@ -2178,7 +2205,7 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv,
> if (ret)
> return ret;
>
> - bcmgenet_init_dim(&ring->dim, bcmgenet_dim_work);
> + bcmgenet_init_dim(ring, bcmgenet_dim_work);
>
> /* Initialize Rx NAPI */
> netif_napi_add(priv->dev, &ring->napi, bcmgenet_rx_poll,
> @@ -2186,7 +2213,6 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv,
>
> bcmgenet_rdma_ring_writel(priv, index, 0, RDMA_PROD_INDEX);
> bcmgenet_rdma_ring_writel(priv, index, 0, RDMA_CONS_INDEX);
> - bcmgenet_rdma_ring_writel(priv, index, 1, DMA_MBUF_DONE_THRESH);
> bcmgenet_rdma_ring_writel(priv, index,
> ((size << DMA_RING_SIZE_SHIFT) |
> RX_BUF_LENGTH), DMA_RING_BUF_SIZE);
> @@ -3424,6 +3450,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
> struct net_device *dev;
> const void *macaddr;
> struct resource *r;
> + unsigned int i;
> int err = -EIO;
> const char *phy_mode_str;
>
> @@ -3552,6 +3579,11 @@ static int bcmgenet_probe(struct platform_device *pdev)
> netif_set_real_num_tx_queues(priv->dev, priv->hw_params->tx_queues + 1);
> netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1);
>
> + /* Set default coalescing parameters */
> + for (i = 0; i < priv->hw_params->rx_queues; i++)
> + priv->rx_rings[i].rx_max_coalesced_frames = 1;
> + priv->rx_rings[DESC_INDEX].rx_max_coalesced_frames = 1;
> +
> /* libphy will determine the link state */
> netif_carrier_off(dev);
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> index 22c41e0430fb..b773bc07edf7 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> @@ -578,8 +578,6 @@ struct bcmgenet_net_dim {
> u16 event_ctr;
> unsigned long packets;
> unsigned long bytes;
> - u32 coal_usecs;
> - u32 coal_pkts;
> struct net_dim dim;
> };
>
> @@ -598,6 +596,8 @@ struct bcmgenet_rx_ring {
> unsigned int end_ptr; /* Rx ring end CB ptr */
> unsigned int old_discards;
> struct bcmgenet_net_dim dim;
> + u32 rx_max_coalesced_frames;
> + u32 rx_coalesce_usecs;
> void (*int_enable)(struct bcmgenet_rx_ring *);
> void (*int_disable)(struct bcmgenet_rx_ring *);
> struct bcmgenet_priv *priv;
>
^ permalink raw reply
* Re: [PATCH net-next 0/5] Introduce net_rwsem to protect net_namespace_list
From: David Miller @ 2018-03-29 17:48 UTC (permalink / raw)
To: ktkhai-5HdwGun5lf+gSpxsJD1C4w
Cc: jakub.kicinski-wFxRvT7yatFl57MIdRCFDg,
avagin-5HdwGun5lf+gSpxsJD1C4w,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-qQsb+v5E8BnlAoU/VqSP6n9LOBIZ5rWg,
ast-DgEjT+Ai2ygdnm+yROfE0A, roman.kapl-uSbOeAmDUekAvxtiuMwx3w,
selinux-+05T5uksL2qpZYMLLGbcSA,
christian.brauner-GeWIH/nMZzLQT0dZR+AlfA,
dev-yBygre7rU0TnMu66kgdUjQ,
linux-security-module-u79uwXL29TY76Z2rM5mHXA,
lucien.xin-Re5JQEeQqe8AvxtiuMwx3w, paul-r2n+y4ga6xFZroRs9YW3xA,
leon-DgEjT+Ai2ygdnm+yROfE0A, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
jmorris-gx6/JNMH7DfYtjvyW6yDsg, jgg-uk2M96/98Pc,
dledford-H+wXaHxf7aLQT0dZR+AlfA, coreteam-Cap9r6Oaw4JrovVCs/uTlw,
kadlec-K40Dz/62t/MgiyqX0sVFJYdd74u8MsAO,
paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
sds-+05T5uksL2qpZYMLLGbcSA, pablo-Cap9r6Oaw4JrovVCs/uTlw,
serge-A9i7LUbDfNHQT0dZR+AlfA, parav-VPRAkNaXOzVWk0Htik3J/w,
brouer-H+wXaHxf7aLQT0dZR+AlfA, yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA,
jbenc-H+wXaHxf7aLQT0dZR+AlfA, idosch-VPRAkNaXOzVWk0Htik3J/w,
jiri-VPRAkNaXOzVWk0Htik3J/w, eparis-FjpueFixGhCM4zKIHC2jIg,
nicolas.dichtel-pdR9zngts4EAvxtiuMwx3w,
vyasevic-H+wXaHxf7aLQT0dZR+AlfA, vvs-5HdwGun5lf+gSpxsJD1C4w,
daniel-FeC+5ew28dpmcu3hnIyYJQ, pombredanne-od1rfyK75/E,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
vyasevich-Re5JQEeQqe8AvxtiuMwx3w, fw-HFFVJYpyMKqzQB+pC5nmwQ,
danielj-VPRAkNaXOzVWk0Htik3J/w, ma
In-Reply-To: <152234005959.19153.17907173734141707348.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
From: Kirill Tkhai <ktkhai-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
Date: Thu, 29 Mar 2018 19:20:23 +0300
> The series introduces fine grained rw_semaphore, which will be used
> instead of rtnl_lock() to protect net_namespace_list.
>
> This improves scalability and allows to do non-exclusive sleepable
> iteration for_each_net(), which is enough for most cases.
>
> scripts/get_maintainer.pl gives enormous list of people, and I add
> all to CC.
>
> Note, that this patch is independent of "Close race between
> {un, }register_netdevice_notifier and pernet_operations":
> https://patchwork.ozlabs.org/project/netdev/list/?series=36495
>
> Signed-off-by: Kirill Tkhai <ktkhai-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
Great stuff!
Series applied, thanks!
^ permalink raw reply
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;
as well as URLs for NNTP newsgroup(s).