* [PATCH 0/2] Drivers: net: hyperv: Cleanup the recive path
From: K. Y. Srinivasan @ 2014-01-31 16:24 UTC (permalink / raw)
To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang
Some minor cleanup of the receive path. Get rid of unnecessary
indirection as well as unnecessary re-establishment of state.
K. Y. Srinivasan (2):
Drivers: net: hyperv: Get rid of the rndis_filter_packet structure
Drivers: net: hyperv: Cleanup the receive path
drivers/net/hyperv/hyperv_net.h | 6 -----
drivers/net/hyperv/netvsc.c | 29 +++++++++++--------------
drivers/net/hyperv/netvsc_drv.c | 2 +-
drivers/net/hyperv/rndis_filter.c | 41 ++----------------------------------
4 files changed, 17 insertions(+), 61 deletions(-)
--
1.7.4.1
^ permalink raw reply
* [PATCH 1/2] Drivers: net: hyperv: Get rid of the rndis_filter_packet structure
From: K. Y. Srinivasan @ 2014-01-31 16:25 UTC (permalink / raw)
To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang
In-Reply-To: <1391185478-5655-1-git-send-email-kys@microsoft.com>
This structure is redundant; get rid of it make the code little more efficient -
get rid of the unnecessary indirection.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/net/hyperv/hyperv_net.h | 6 -----
drivers/net/hyperv/netvsc_drv.c | 2 +-
drivers/net/hyperv/rndis_filter.c | 41 ++----------------------------------
3 files changed, 4 insertions(+), 45 deletions(-)
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 7b594ce..7645ba3 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -846,12 +846,6 @@ struct rndis_message {
};
-struct rndis_filter_packet {
- void *completion_ctx;
- void (*completion)(void *context);
- struct rndis_message msg;
-};
-
/* Handy macros */
/* get the size of an RNDIS message. Pass in the message type, */
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 7756118..1eadc13 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -146,7 +146,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
/* Allocate a netvsc packet based on # of frags. */
packet = kzalloc(sizeof(struct hv_netvsc_packet) +
(num_pages * sizeof(struct hv_page_buffer)) +
- sizeof(struct rndis_filter_packet) +
+ sizeof(struct rndis_message) +
NDIS_VLAN_PPI_SIZE, GFP_ATOMIC);
if (!packet) {
/* out of memory, drop packet */
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 1084e5d..f0cc8ef 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -58,9 +58,6 @@ struct rndis_request {
u8 request_ext[RNDIS_EXT_LEN];
};
-static void rndis_filter_send_completion(void *ctx);
-
-
static struct rndis_device *get_rndis_device(void)
{
struct rndis_device *device;
@@ -277,7 +274,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
"rndis response buffer overflow "
"detected (size %u max %zu)\n",
resp->msg_len,
- sizeof(struct rndis_filter_packet));
+ sizeof(struct rndis_message));
if (resp->ndis_msg_type ==
RNDIS_MSG_RESET_C) {
@@ -898,17 +895,14 @@ int rndis_filter_close(struct hv_device *dev)
int rndis_filter_send(struct hv_device *dev,
struct hv_netvsc_packet *pkt)
{
- int ret;
- struct rndis_filter_packet *filter_pkt;
struct rndis_message *rndis_msg;
struct rndis_packet *rndis_pkt;
u32 rndis_msg_size;
bool isvlan = pkt->vlan_tci & VLAN_TAG_PRESENT;
/* Add the rndis header */
- filter_pkt = (struct rndis_filter_packet *)pkt->extension;
+ rndis_msg = (struct rndis_message *)pkt->extension;
- rndis_msg = &filter_pkt->msg;
rndis_msg_size = RNDIS_MESSAGE_SIZE(struct rndis_packet);
if (isvlan)
rndis_msg_size += NDIS_VLAN_PPI_SIZE;
@@ -961,34 +955,5 @@ int rndis_filter_send(struct hv_device *dev,
pkt->page_buf[1].len = rndis_msg_size - pkt->page_buf[0].len;
}
- /* Save the packet send completion and context */
- filter_pkt->completion = pkt->completion.send.send_completion;
- filter_pkt->completion_ctx =
- pkt->completion.send.send_completion_ctx;
-
- /* Use ours */
- pkt->completion.send.send_completion = rndis_filter_send_completion;
- pkt->completion.send.send_completion_ctx = filter_pkt;
-
- ret = netvsc_send(dev, pkt);
- if (ret != 0) {
- /*
- * Reset the completion to originals to allow retries from
- * above
- */
- pkt->completion.send.send_completion =
- filter_pkt->completion;
- pkt->completion.send.send_completion_ctx =
- filter_pkt->completion_ctx;
- }
-
- return ret;
-}
-
-static void rndis_filter_send_completion(void *ctx)
-{
- struct rndis_filter_packet *filter_pkt = ctx;
-
- /* Pass it back to the original handler */
- filter_pkt->completion(filter_pkt->completion_ctx);
+ return netvsc_send(dev, pkt);
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 2/2] Drivers: net: hyperv: Cleanup the receive path
From: K. Y. Srinivasan @ 2014-01-31 16:25 UTC (permalink / raw)
To: davem, netdev, linux-kernel, devel, olaf, apw, jasowang
In-Reply-To: <1391185517-5698-1-git-send-email-kys@microsoft.com>
Make the receive path a little more efficient by parameterizing the
required state rather than re-establishing that state.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/net/hyperv/netvsc.c | 29 +++++++++++++----------------
1 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 03a2c6e..7fa2bba 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -432,17 +432,14 @@ static inline u32 hv_ringbuf_avail_percent(
return avail_write * 100 / ring_info->ring_datasize;
}
-static void netvsc_send_completion(struct hv_device *device,
+static void netvsc_send_completion(struct netvsc_device *net_device,
+ struct hv_device *device,
struct vmpacket_descriptor *packet)
{
- struct netvsc_device *net_device;
struct nvsp_message *nvsp_packet;
struct hv_netvsc_packet *nvsc_packet;
struct net_device *ndev;
- net_device = get_inbound_net_device(device);
- if (!net_device)
- return;
ndev = net_device->ndev;
nvsp_packet = (struct nvsp_message *)((unsigned long)packet +
@@ -561,13 +558,13 @@ int netvsc_send(struct hv_device *device,
}
static void netvsc_send_recv_completion(struct hv_device *device,
+ struct netvsc_device *net_device,
u64 transaction_id, u32 status)
{
struct nvsp_message recvcompMessage;
int retries = 0;
int ret;
struct net_device *ndev;
- struct netvsc_device *net_device = hv_get_drvdata(device);
ndev = net_device->ndev;
@@ -653,14 +650,15 @@ static void netvsc_receive_completion(void *context)
/* Send a receive completion for the xfer page packet */
if (fsend_receive_comp)
- netvsc_send_recv_completion(device, transaction_id, status);
+ netvsc_send_recv_completion(device, net_device, transaction_id,
+ status);
}
-static void netvsc_receive(struct hv_device *device,
- struct vmpacket_descriptor *packet)
+static void netvsc_receive(struct netvsc_device *net_device,
+ struct hv_device *device,
+ struct vmpacket_descriptor *packet)
{
- struct netvsc_device *net_device;
struct vmtransfer_page_packet_header *vmxferpage_packet;
struct nvsp_message *nvsp_packet;
struct hv_netvsc_packet *netvsc_packet = NULL;
@@ -673,9 +671,6 @@ static void netvsc_receive(struct hv_device *device,
LIST_HEAD(listHead);
- net_device = get_inbound_net_device(device);
- if (!net_device)
- return;
ndev = net_device->ndev;
/*
@@ -741,7 +736,7 @@ static void netvsc_receive(struct hv_device *device,
spin_unlock_irqrestore(&net_device->recv_pkt_list_lock,
flags);
- netvsc_send_recv_completion(device,
+ netvsc_send_recv_completion(device, net_device,
vmxferpage_packet->d.trans_id,
NVSP_STAT_FAIL);
@@ -825,11 +820,13 @@ static void netvsc_channel_cb(void *context)
desc = (struct vmpacket_descriptor *)buffer;
switch (desc->type) {
case VM_PKT_COMP:
- netvsc_send_completion(device, desc);
+ netvsc_send_completion(net_device,
+ device, desc);
break;
case VM_PKT_DATA_USING_XFER_PAGES:
- netvsc_receive(device, desc);
+ netvsc_receive(net_device,
+ device, desc);
break;
default:
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH linux-3.10.y v2 1/3] sit: fix double free of fb_tunnel_dev on exit
From: Steven Rostedt @ 2014-01-31 17:19 UTC (permalink / raw)
To: Nicolas Dichtel
Cc: linux-kernel, netdev, stable, williams, lclaudio, jkacur, willemb
In-Reply-To: <1391156646-11981-1-git-send-email-nicolas.dichtel@6wind.com>
Just FYI.
Our full tier tests have completed with no issues due to the sit or
ip6_tunnel modules. These patches appear to have solved our problems.
Nicolas, Thanks again for posting these!
-- Steve
On Fri, 31 Jan 2014 09:24:04 +0100
Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
> This problem was fixed upstream by commit 9434266f2c64 ("sit: fix use after free
> of fb_tunnel_dev").
> The upstream patch depends on upstream commit 5e6700b3bf98 ("sit: add support of
> x-netns"), which was not backported into 3.10 branch.
>
> First, explain the problem: when the sit module is unloaded, sit_cleanup() is
> called.
> rmmod sit
> => sit_cleanup()
> => rtnl_link_unregister()
> => __rtnl_kill_links()
> => for_each_netdev(net, dev) {
> if (dev->rtnl_link_ops == ops)
> ops->dellink(dev, &list_kill);
> }
> At this point, the FB device is deleted (and all sit tunnels).
> => unregister_pernet_device()
> => unregister_pernet_operations()
> => ops_exit_list()
> => sit_exit_net()
> => sit_destroy_tunnels()
> In this function, no tunnel is found.
> => unregister_netdevice_queue(sitn->fb_tunnel_dev, &list);
> We delete the FB device a second time here!
>
> Because we cannot simply remove the second deletion (sit_exit_net() must remove
> the FB device when a netns is deleted), we add an rtnl ops which delete all sit
> device excepting the FB device and thus we can keep the explicit deletion in
> sit_exit_net().
>
^ permalink raw reply
* Re: [PATCH 31/34] efx: Use pci_enable_msix_range()
From: Shradha Shah @ 2014-01-31 17:21 UTC (permalink / raw)
To: Alexander Gordeev; +Cc: linux-kernel, Solarflare maintainers, netdev, linux-pci
In-Reply-To: <433fe68f834c10679986274f4bb605aa4ed5eaf3.1391172839.git.agordeev@redhat.com>
On 01/31/2014 03:08 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range() and pci_enable_msix_range()
> interfaces.
>
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Acked-by: Shradha Shah <sshah@solarflare.com>
> ---
> drivers/net/ethernet/sfc/efx.c | 20 +++++++++-----------
> 1 files changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 83d4643..297b97a 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -1346,20 +1346,23 @@ static int efx_probe_interrupts(struct efx_nic *efx)
>
> for (i = 0; i < n_channels; i++)
> xentries[i].entry = i;
> - rc = pci_enable_msix(efx->pci_dev, xentries, n_channels);
> - if (rc > 0) {
> + rc = pci_enable_msix_range(efx->pci_dev,
> + xentries, 1, n_channels);
> + if (rc < 0) {
> + /* Fall back to single channel MSI */
> + efx->interrupt_mode = EFX_INT_MODE_MSI;
> + netif_err(efx, drv, efx->net_dev,
> + "could not enable MSI-X\n");
> + } else if (rc < n_channels) {
> netif_err(efx, drv, efx->net_dev,
> "WARNING: Insufficient MSI-X vectors"
> " available (%d < %u).\n", rc, n_channels);
> netif_err(efx, drv, efx->net_dev,
> "WARNING: Performance may be reduced.\n");
> - EFX_BUG_ON_PARANOID(rc >= n_channels);
> n_channels = rc;
> - rc = pci_enable_msix(efx->pci_dev, xentries,
> - n_channels);
> }
>
> - if (rc == 0) {
> + if (rc > 0) {
> efx->n_channels = n_channels;
> if (n_channels > extra_channels)
> n_channels -= extra_channels;
> @@ -1375,11 +1378,6 @@ static int efx_probe_interrupts(struct efx_nic *efx)
> for (i = 0; i < efx->n_channels; i++)
> efx_get_channel(efx, i)->irq =
> xentries[i].vector;
> - } else {
> - /* Fall back to single channel MSI */
> - efx->interrupt_mode = EFX_INT_MODE_MSI;
> - netif_err(efx, drv, efx->net_dev,
> - "could not enable MSI-X\n");
> }
> }
>
>
^ permalink raw reply
* Re: [PATCH v2 2/4] net: ethoc: implement ethtool get/set settings
From: Ben Hutchings @ 2014-01-31 18:03 UTC (permalink / raw)
To: Max Filippov
Cc: netdev, linux-kernel, David S. Miller, Florian Fainelli,
Marc Gauthier
In-Reply-To: <1391146867-30508-3-git-send-email-jcmvbkbc@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]
On Fri, 2014-01-31 at 09:41 +0400, Max Filippov wrote:
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> Changes v1->v2:
> - fix {get,set}_settings return code in case there's no PHY.
>
> drivers/net/ethernet/ethoc.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
> index 0623c20..779d3c3 100644
> --- a/drivers/net/ethernet/ethoc.c
> +++ b/drivers/net/ethernet/ethoc.c
> @@ -890,7 +890,31 @@ out:
> return NETDEV_TX_OK;
> }
>
> +static int ethoc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
> +{
> + struct ethoc *priv = netdev_priv(dev);
> + struct phy_device *phydev = priv->phy;
> +
> + if (!phydev)
> + return -EOPNOTSUPP;
> +
> + return phy_ethtool_gset(phydev, cmd);
> +}
> +
> +static int ethoc_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
> +{
> + struct ethoc *priv = netdev_priv(dev);
> + struct phy_device *phydev = priv->phy;
> +
> + if (!phydev)
> + return -EOPNOTSUPP;
> +
> + return phy_ethtool_sset(phydev, cmd);
> +}
> +
> const struct ethtool_ops ethoc_ethtool_ops = {
> + .get_settings = ethoc_get_settings,
> + .set_settings = ethoc_set_settings,
> .get_link = ethtool_op_get_link,
> .get_ts_info = ethtool_op_get_ts_info,
> };
--
Ben Hutchings
It is easier to write an incorrect program than to understand a correct one.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [PATCH 17/34] ixgbevf: Use pci_enable_msix_range()
From: Sergei Shtylyov @ 2014-01-31 19:20 UTC (permalink / raw)
To: Alexander Gordeev, linux-kernel
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, e1000-devel, netdev,
linux-pci
In-Reply-To: <3d63d58082b8cb80de7f2cb434ca5d83781e8c9f.1391172839.git.agordeev@redhat.com>
On 01/31/2014 06:08 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range() and pci_enable_msix_range()
> interfaces.
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 33 +++++++-------------
> 1 files changed, 12 insertions(+), 21 deletions(-)
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> index 9df2898..521a9d7 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> @@ -1831,33 +1830,25 @@ static int ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter,
> * Right now, we simply care about how many we'll get; we'll
> * set them up later while requesting irq's.
> */
> - while (vectors >= vector_threshold) {
> - err = pci_enable_msix(adapter->pdev, adapter->msix_entries,
> - vectors);
> - if (!err || err < 0) /* Success or a nasty failure. */
> - break;
> - else /* err == number of vectors we should try again with */
> - vectors = err;
> - }
> + vectors = pci_enable_msix_range(adapter->pdev, adapter->msix_entries,
> + vector_threshold, vectors);
>
> - if (vectors < vector_threshold)
> - err = -ENOMEM;
> -
> - if (err) {
> + if (vectors < 0) {
> dev_err(&adapter->pdev->dev,
> "Unable to allocate MSI-X interrupts\n");
> kfree(adapter->msix_entries);
> adapter->msix_entries = NULL;
> - } else {
> - /*
> - * Adjust for only the vectors we'll use, which is minimum
> - * of max_msix_q_vectors + NON_Q_VECTORS, or the number of
> - * vectors we were allocated.
> - */
> - adapter->num_msix_vectors = vectors;
> + return vectors;
> }
>
> - return err;
> + /*
> + * Adjust for only the vectors we'll use, which is minimum
> + * of max_msix_q_vectors + NON_Q_VECTORS, or the number of
> + * vectors we were allocated.
> + */
Networking code formats multi-line comments slightly differently to the
rest of the kernel:
/* bla
* bla
*/
Although, you're only moving what was there before you, maybe it's a good
time to get this right.
WBR, Sergei
^ permalink raw reply
* Re: Help testing for USB ethernet/xHCI regression
From: Sarah Sharp @ 2014-01-31 18:37 UTC (permalink / raw)
To: Mark Lord
Cc: Paul Zimmerman, David Laight, renevant@internode.on.net,
linux-usb@vger.kernel.org, Greg Kroah-Hartman,
netdev@vger.kernel.org
In-Reply-To: <52EB0B51.4020407@pobox.com>
On Thu, Jan 30, 2014 at 09:32:49PM -0500, Mark Lord wrote:
> On 14-01-30 06:26 PM, Sarah Sharp wrote:
> > On Thu, Jan 30, 2014 at 05:20:40PM -0500, Mark Lord wrote:
> >> On 14-01-30 04:41 PM, Sarah Sharp wrote:
> >>>
> >>> Mark and David, can you pull the 3.13-td-changes-reverted branch again,
> >>> and see if the latest patch fixes your issue? It disables scatter
> >>> gather for the ax88179_178a device, but only when it's operating at USB
> >>> 3.0 speeds.
> >>
> >> As expected, this works just fine.
> >
> > Did it work when plugged into a USB 2.0 hub?
>
> Curiosity, NO. Dies almost immediately when run at USB 2.0 Hi-Speed.
> With a USB 2.0 hub, with a USB 2.0 port on a USB 3.0 hub,
> and with a USB 2.0 extension cable in place of a hub.
>
> Near instant hangs.
>
> Plugged directly to the USB 3.0 port, it works fine.
Ok, that makes sense. The patch I wrote only limited scatter-gather at
USB 3.0 speeds, to see if scatter-gather could work at USB 2.0 speeds.
Reverting commit 3804fad45411b48233b48003e33a78f290d227c8 "USBNET:
ax88179_178a: enable tso if usb host supports sg dma" is the right way
to go instead.
Sarah Sharp
^ permalink raw reply
* [RFC PATCHv2] net: ipv4: move inetpeer garbage collector work to power efficient workqueue
From: Zoran Markovic @ 2014-01-31 18:48 UTC (permalink / raw)
To: linux-kernel
Cc: netdev, Shaibal Dutta, David S. Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy, Zoran Markovic
From: Shaibal Dutta <shaibal.dutta@broadcom.com>
Garbage collector work does not have to be bound to the CPU that scheduled
it. By moving work to the power-efficient workqueue, the selection of
CPU executing the work is left to the scheduler. This extends idle
residency times and conserves power.
This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Shaibal Dutta <shaibal.dutta@broadcom.com>
[zoran.markovic@linaro.org: Rebased to latest kernel version. Added
commit message. Fixed code alignment.]
Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
---
net/ipv4/inetpeer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 48f4244..7e3da6c6 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -161,7 +161,8 @@ static void inetpeer_gc_worker(struct work_struct *work)
list_splice(&list, &gc_list);
spin_unlock_bh(&gc_lock);
- schedule_delayed_work(&gc_work, gc_delay);
+ queue_delayed_work(system_power_efficient_wq,
+ &gc_work, gc_delay);
}
/* Called from ip_output.c:ip_init */
@@ -576,7 +577,8 @@ static void inetpeer_inval_rcu(struct rcu_head *head)
list_add_tail(&p->gc_list, &gc_list);
spin_unlock_bh(&gc_lock);
- schedule_delayed_work(&gc_work, gc_delay);
+ queue_delayed_work(system_power_efficient_wq,
+ &gc_work, gc_delay);
}
void inetpeer_invalidate_tree(struct inet_peer_base *base)
--
1.7.9.5
^ permalink raw reply related
* [RFC PATCHv2] net: core: move core networking work to power efficient workqueue
From: Zoran Markovic @ 2014-01-31 18:51 UTC (permalink / raw)
To: linux-kernel
Cc: netdev, Shaibal Dutta, David S. Miller, Jiri Pirko,
YOSHIFUJI Hideaki, Eric Dumazet, Julian Anastasov, Flavio Leitner,
Neil Horman, Patrick McHardy, John Fastabend, Amerigo Wang,
Joe Perches, Jason Wang, Antonio Quartulli, Simon Horman,
Nikolay Aleksandrov, Zoran Markovic
From: Shaibal Dutta <shaibal.dutta@broadcom.com>
This patch moves the following work to the power efficient workqueue:
- Transmit work of netpoll
- Destination cache garbage collector work
- Link watch event handler work
In general, assignment of CPUs to pending work could be deferred to
the scheduler in order to extend idle residency time and improve
power efficiency. I would value community's opinion on the migration
of this work to the power efficient workqueue, with an emphasis on
migration of netpoll's transmit work.
This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Julian Anastasov <ja@ssi.bg>
Cc: Flavio Leitner <fbl@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: John Fastabend <john.r.fastabend@intel.com>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Antonio Quartulli <antonio@meshcoding.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: Shaibal Dutta <shaibal.dutta@broadcom.com>
[zoran.markovic@linaro.org: Rebased to latest kernel version. Edited
calls to mod_delayed_work to reference power efficient workqueue.
Added commit message. Fixed code alignment.]
Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
---
net/core/dst.c | 5 +++--
net/core/link_watch.c | 5 +++--
net/core/netpoll.c | 6 ++++--
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index ca4231e..57fba10 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -135,7 +135,8 @@ loop:
*/
if (expires > 4*HZ)
expires = round_jiffies_relative(expires);
- schedule_delayed_work(&dst_gc_work, expires);
+ queue_delayed_work(system_power_efficient_wq,
+ &dst_gc_work, expires);
}
spin_unlock_bh(&dst_garbage.lock);
@@ -223,7 +224,7 @@ void __dst_free(struct dst_entry *dst)
if (dst_garbage.timer_inc > DST_GC_INC) {
dst_garbage.timer_inc = DST_GC_INC;
dst_garbage.timer_expires = DST_GC_MIN;
- mod_delayed_work(system_wq, &dst_gc_work,
+ mod_delayed_work(system_power_efficient_wq, &dst_gc_work,
dst_garbage.timer_expires);
}
spin_unlock_bh(&dst_garbage.lock);
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index 9c3a839..6899935 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -135,9 +135,10 @@ static void linkwatch_schedule_work(int urgent)
* override the existing timer.
*/
if (test_bit(LW_URGENT, &linkwatch_flags))
- mod_delayed_work(system_wq, &linkwatch_work, 0);
+ mod_delayed_work(system_power_efficient_wq, &linkwatch_work, 0);
else
- schedule_delayed_work(&linkwatch_work, delay);
+ queue_delayed_work(system_power_efficient_wq,
+ &linkwatch_work, delay);
}
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index c03f3de..6685938 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -101,7 +101,8 @@ static void queue_process(struct work_struct *work)
__netif_tx_unlock(txq);
local_irq_restore(flags);
- schedule_delayed_work(&npinfo->tx_work, HZ/10);
+ queue_delayed_work(system_power_efficient_wq,
+ &npinfo->tx_work, HZ/10);
return;
}
__netif_tx_unlock(txq);
@@ -423,7 +424,8 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
if (status != NETDEV_TX_OK) {
skb_queue_tail(&npinfo->txq, skb);
- schedule_delayed_work(&npinfo->tx_work,0);
+ queue_delayed_work(system_power_efficient_wq,
+ &npinfo->tx_work, 0);
}
}
EXPORT_SYMBOL(netpoll_send_skb_on_dev);
--
1.7.9.5
^ permalink raw reply related
* Re: igb and bnx2: "NETDEV WATCHDOG: transmit queue timed out" when skb has huge linear buffer
From: Wei Liu @ 2014-01-31 18:56 UTC (permalink / raw)
To: Zoltan Kiss
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, Tushar Dave, Akeem G Abodunrin, David S. Miller,
e1000-devel, netdev@vger.kernel.org, linux-kernel, Michael Chan,
xen-devel@lists.xenproject.org, wei.liu2
In-Reply-To: <52EAA31B.1090606@schaman.hu>
On Thu, Jan 30, 2014 at 07:08:11PM +0000, Zoltan Kiss wrote:
> Hi,
>
> I've experienced some queue timeout problems mentioned in the
> subject with igb and bnx2 cards. I haven't seen them on other cards
> so far. I'm using XenServer with 3.10 Dom0 kernel (however igb were
> already updated to latest version), and there are Windows guests
> sending data through these cards. I noticed these problems in XenRT
> test runs, and I know that they usually mean some lost interrupt
> problem or other hardware error, but in my case they started to
> appear more often, and they are likely connected to my netback grant
> mapping patches. These patches causing skb's with huge (~64kb)
> linear buffers to appear more often.
> The reason for that is an old problem in the ring protocol:
> originally the maximum amount of slots were linked to MAX_SKB_FRAGS,
> as every slot ended up as a frag of the skb. When this value were
> changed, netback had to cope with the situation by coalescing the
> packets into fewer frags.
> My patch series take a different approach: the leftover slots
> (pages) were assigned to a new skb's frags, and that skb were
> stashed to the frag_list of the first one. Then, before sending it
> off to the stack it calls skb = skb_copy_expand(skb, 0, 0,
> GFP_ATOMIC, __GFP_NOWARN), which basically creates a new skb and
> copied all the data into it. As far as I understood, it put
> everything into the linear buffer, which can amount to 64KB at most.
> The original skb are freed then, and this new one were sent to the
> stack.
Just my two cents, if it is this case, you can try to call
skb_copy_expand on every SKB netback receives to manually create SKBs
with ~64KB linear buffer to see how it goes...
Wei.
> I suspect that this is the problem as it only happens when guests
> send too much slots. Does anyone familiar with these drivers have
> seen such issue before? (when these kind of skb's get stucked in the
> queue)
>
> Regards,
>
> Zoltan Kiss
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH RFC 1/1] usb: Tell xhci when usb data might be misaligned
From: Sarah Sharp @ 2014-01-31 19:00 UTC (permalink / raw)
To: Ming Lei
Cc: Bjørn Mork, David Laight, linux-usb@vger.kernel.org,
netdev@vger.kernel.org, Greg Kroah-Hartman, David Miller,
Dan Williams, Nyman, Mathias, Mark Lord, Alan Stern, Freddy Xin
In-Reply-To: <CACVXFVMVoMAH3DRiv-VYZL8VWq2Rw+fZwreVtUVm1M44HR+X8Q@mail.gmail.com>
On Fri, Jan 31, 2014 at 08:17:58AM +0800, Ming Lei wrote:
> On Fri, Jan 31, 2014 at 6:15 AM, Sarah Sharp
> <sarah.a.sharp@linux.intel.com> wrote:
> > On Thu, Jan 30, 2014 at 10:50:21PM +0100, Bjørn Mork wrote:
> >> FWIW, the plan looks fine to me. Just adding a couple of hints to
> >> simplify the implementation.
> >>
> >> Sarah Sharp <sarah.a.sharp@linux.intel.com> writes:
> >>
> >> > Let's do this fix the right way, instead of wall papering over the
> >> > issue. Here's what we should do:
> >> >
> >> > 1. Disable scatter-gather for the ax88179_178a driver when it's under an
> >> > xHCI host.
> >>
> >> No need to make this conditional. SG is only enabled in the
> >> ax88179_178a driver if udev->bus->no_sg_constraint is true, so it
> >> applies only to xHCI hosts in the first place.
> >
> > Ah, so you're suggesting just reverting commit
> > 3804fad45411b48233b48003e33a78f290d227c8 "USBNET: ax88179_178a: enable
> > tso if usb host supports sg dma"?
>
> If I understand the problem correctly, the current issue is that xhci driver
> doesn't support the arbitrary dma length not well, but per XHCI spec, it
> should be supported, right?
>
> If the above is correct, reverting the commit isn't correct since there isn't
> any issue about the commit, so I suggest to disable the flag in xhci
> for the buggy devices, and it may be enabled again if the problem is fixed.
Ok, I like that plan, since it means I don't have to touch any
networking code to fix this. :)
I believe that means we'll have to disable the flag for all 1.0 xHCI
hosts, since those are the ones that need TD fragments.
> >> > 2. Revert the following commits:
> >> > f2d9b991c549 xhci: Set scatter-gather limit to avoid failed block writes.
> >> > d6c9ea9069af xhci: Avoid infinite loop when sg urb requires too many trbs
> >> > 35773dac5f86 usb: xhci: Link TRB must not occur within a USB payload burst
> >> >
> >> > 3. Dan and Mathias can work together to come up with an overall plan to
> >> > change the xHCI driver architecture to be fully compliant with the TD
> >> > fragment rules. That can be done over the next few kernel releases.
> >> >
> >> > The end result is that we don't destabilize storage or break userspace
> >> > USB drivers, we don't break people's xHCI host controllers,
> >> > the ax88179_178a USB ethernet devices still work under xHCI (a bit with
> >> > worse performance), and other USB ethernet devices still get the
> >> > performance improvement introduced in 3.12.
> >>
> >> No other usbnet drivers has enabled SG... Which is why you have only
> >> seen this problem with the ax88179_178a devices. So there is no
> >> performance improvement to keep.
>
> In my test environment, the patch does improve both throughput and
> cpu utilization, if you search the previous email for the patch, you can
> see the data.
Right, I did see the performance improvement note in that commit. Do
you know if the ARM A15 dual core board was using a 0.96 xHCI host, or a
1.0 host? You can find out by reloading the xHCI driver with dynamic
debugging turned on:
# sudo modprobe xhci_hcd dyndbg
and then look for lines like:
[25296.765767] xhci_hcd 0000:00:14.0: HCIVERSION: 0x100
Sarah Sharp
^ permalink raw reply
* I NEED YOUR HELP.
From: FROM MRS GRACE MANDA @ 2014-01-31 18:55 UTC (permalink / raw)
In-Reply-To: <1391189868.90855.YahooMailNeo@web5706.biz.mail.ne1.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 59 bytes --]
I PRAY THAT THIS MAIL GETS TO YOU IN BETTER HEALTH.
[-- Attachment #2: From Mrs Grace Manda..pdf --]
[-- Type: application/pdf, Size: 41148 bytes --]
^ permalink raw reply
* Re: [PATCH 02/34] bnx2x: Use pci_enable_msix_range()
From: Sergei Shtylyov @ 2014-01-31 19:11 UTC (permalink / raw)
To: Alexander Gordeev, linux-kernel; +Cc: Ariel Elior, netdev, linux-pci
In-Reply-To: <911884c4e906af8acfa4c06ee3206387449f1d84.1391172839.git.agordeev@redhat.com>
Hello.
On 01/31/2014 06:08 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range() and pci_enable_msix_range()
> interfaces.
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 48 ++++++++++-------------
> 1 files changed, 21 insertions(+), 27 deletions(-)
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> index 9d7419e..b396d74 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> @@ -1638,24 +1638,36 @@ int bnx2x_enable_msix(struct bnx2x *bp)
> DP(BNX2X_MSG_SP, "about to request enable msix with %d vectors\n",
> msix_vec);
>
> - rc = pci_enable_msix(bp->pdev, &bp->msix_table[0], msix_vec);
> -
> + rc = pci_enable_msix_range(bp->pdev, &bp->msix_table[0],
> + BNX2X_MIN_MSIX_VEC_CNT(bp), msix_vec);
> /*
> * reconfigure number of tx/rx queues according to available
> * MSI-X vectors
> */
> - if (rc >= BNX2X_MIN_MSIX_VEC_CNT(bp)) {
> + if (rc < 0) {
> + BNX2X_DEV_INFO("MSI-X is not attainable rc %d\n", rc);
> + goto no_msix;
> + } else if (rc == -ENOSPC) {
This branch is unreachable now. You should have put this check first.
> + /* Get by with single vector */
> + rc = pci_enable_msix_range(bp->pdev, &bp->msix_table[0], 1, 1);
> + if (rc < 0) {
> + BNX2X_DEV_INFO("Single MSI-X is not attainable rc %d\n",
> + rc);
> + goto no_msix;
> + }
> +
> + BNX2X_DEV_INFO("Using single MSI-X vector\n");
> + bp->flags |= USING_SINGLE_MSIX_FLAG;
> +
> + BNX2X_DEV_INFO("set number of queues to 1\n");
> + bp->num_ethernet_queues = 1;
> + bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues;
> + } else if (rc < msix_vec) {
WBR, Sergei
^ permalink raw reply
* Re: [PATCH 12/34] e1000e: Use pci_enable_msix_range()
From: Sergei Shtylyov @ 2014-01-31 19:17 UTC (permalink / raw)
To: Alexander Gordeev, linux-kernel
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, e1000-devel, netdev,
linux-pci
In-Reply-To: <0ec36309e17031a66d3a6ab489fc60702b6d76b3.1391172839.git.agordeev@redhat.com>
Hello.
On 01/31/2014 06:08 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range() and pci_enable_msix_range()
> interfaces.
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
> drivers/net/ethernet/intel/e1000e/netdev.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 6d91933..7735d1a 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -2041,10 +2041,11 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
> for (i = 0; i < adapter->num_vectors; i++)
> adapter->msix_entries[i].entry = i;
>
> - err = pci_enable_msix(adapter->pdev,
> - adapter->msix_entries,
> - adapter->num_vectors);
> - if (err == 0)
> + err = pci_enable_msix_range(adapter->pdev,
> + adapter->msix_entries,
> + adapter->num_vectors,
> + adapter->num_vectors);
You should align all 'adapter' references under each other, according to
networking coding rules.
WBR, Sergei
^ permalink raw reply
* Re: [PATCH 18/34] mlx4: Use pci_enable_msix_range()
From: Sergei Shtylyov @ 2014-01-31 19:22 UTC (permalink / raw)
To: Alexander Gordeev, linux-kernel
Cc: David S. Miller, Amir Vadai, netdev, linux-pci
In-Reply-To: <2f6674dabb90d4cbca3ef4039c3b893f2e5e9ec4.1391172839.git.agordeev@redhat.com>
Hello.
On 01/31/2014 06:08 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range() and pci_enable_msix_range()
> interfaces.
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
> drivers/net/ethernet/mellanox/mlx4/main.c | 19 ++++---------------
> 1 files changed, 4 insertions(+), 15 deletions(-)
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index d711158..a9d1249 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
[...]
> @@ -1990,22 +1989,12 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
[...]
> + nreq = pci_enable_msix_range(dev->pdev, entries, 2, nreq);
> +
> + if (nreq < 0) {
> kfree(entries);
> goto no_msi;
> - }
> -
> - if (nreq <
> + } else if (nreq <
> MSIX_LEGACY_SZ + dev->caps.num_ports * MIN_MSIX_P_PORT) {
Please realign this line to start right under 'nreq'.
WBR, Sergei
^ permalink raw reply
* Re: [PATCH 20/34] myri10ge: Use pci_enable_msix_range()
From: Sergei Shtylyov @ 2014-01-31 19:24 UTC (permalink / raw)
To: Alexander Gordeev, linux-kernel; +Cc: Hyong-Youb Kim, netdev, linux-pci
In-Reply-To: <1253b3c920637ab6bb987defb88d1698ac1e4851.1391172839.git.agordeev@redhat.com>
Hello.
On 01/31/2014 06:08 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range() and pci_enable_msix_range()
> interfaces.
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
> drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 32 ++++++++++-----------
> 1 files changed, 15 insertions(+), 17 deletions(-)
> diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> index 68026f7..9f717d6 100644
> --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> @@ -2329,16 +2329,14 @@ static int myri10ge_request_irq(struct myri10ge_priv *mgp)
> status = 0;
> if (myri10ge_msi) {
> if (mgp->num_slices > 1) {
> - status =
> - pci_enable_msix(pdev, mgp->msix_vectors,
> - mgp->num_slices);
> - if (status == 0) {
> - mgp->msix_enabled = 1;
> - } else {
> + status = pci_enable_msix_range(pdev, mgp->msix_vectors,
> + mgp->num_slices, mgp->num_slices);
> + if (status < 0) {
> dev_err(&pdev->dev,
> "Error %d setting up MSI-X\n", status);
> return status;
> }
> + mgp->msix_enabled = 1;
> }
> if (mgp->msix_enabled == 0) {
> status = pci_enable_msi(pdev);
> @@ -3901,23 +3899,23 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
> }
>
> while (mgp->num_slices > 1) {
> - /* make sure it is a power of two */
> - while (!is_power_of_2(mgp->num_slices))
> - mgp->num_slices--;
> + mgp->num_slices = rounddown_pow_of_two(mgp->num_slices);
> if (mgp->num_slices == 1)
> goto disable_msix;
> - status = pci_enable_msix(pdev, mgp->msix_vectors,
> - mgp->num_slices);
> - if (status == 0) {
> - pci_disable_msix(pdev);
> + status = pci_enable_msix_range(pdev, mgp->msix_vectors,
> + mgp->num_slices, mgp->num_slices);
The continuation line(s) should be aligned to start right under 'pdev',
according to the networking coding rules.
> + if (status < 0)
> + goto disable_msix;
Hm, if enabling MSI failed, we don't need to disable it, right? So,
perhaps the label should be renamed?
> +
> + pci_disable_msix(pdev);
> +
> + if (status == mgp->num_slices) {
> if (old_allocated)
> kfree(old_fw);
> return;
> - }
> - if (status > 0)
> + } else {
> mgp->num_slices = status;
> - else
> - goto disable_msix;
> + }
> }
>
> disable_msix:
WBR, Sergei
^ permalink raw reply
* BUG ip_dst_cache (Not tainted): Poison overwritten
From: Tommi Rantala @ 2014-01-31 20:11 UTC (permalink / raw)
To: netdev; +Cc: Dave Jones, trinity, LKML
Hello,
Hit this while fuzzing v3.13-9218-g0e47c96 with trinity in a qemu
virtual machine.
Tommi
[ 6329.061605] =============================================================================
[ 6329.062014] BUG ip_dst_cache (Not tainted): Poison overwritten
[ 6329.062014] -----------------------------------------------------------------------------
[ 6329.062014] Disabling lock debugging due to kernel taint
[ 6329.062014] INFO: 0xffff8800b4809940-0xffff8800b4809940. First byte
0x6a instead of 0x6b
[ 6329.062014] INFO: Allocated in dst_alloc+0x46/0x180 age=33 cpu=0 pid=6108
[ 6329.062014] __slab_alloc+0x4f8/0x58c
[ 6329.062014] kmem_cache_alloc+0x94/0x290
[ 6329.062014] dst_alloc+0x46/0x180
[ 6329.062014] rt_dst_alloc+0x47/0x50
[ 6329.062014] __ip_route_output_key+0x882/0xa80
[ 6329.062014] ip_route_output_flow+0x22/0x60
[ 6329.062014] igmpv3_newpack+0xe2/0x210
[ 6329.062014] add_grhead.isra.17+0x37/0xa0
[ 6329.062014] add_grec+0x3b2/0x470
[ 6329.062014] igmp_ifc_timer_expire+0x28e/0x400
[ 6329.062014] call_timer_fn+0x146/0x320
[ 6329.062014] run_timer_softirq+0x2d4/0x360
[ 6329.062014] __do_softirq+0x217/0x4a0
[ 6329.062014] irq_exit+0x45/0xb0
[ 6329.062014] smp_apic_timer_interrupt+0x3f/0x50
[ 6329.062014] apic_timer_interrupt+0x72/0x80
[ 6329.062014] INFO: Freed in dst_destroy+0x8a/0xe0 age=33 cpu=0 pid=6108
[ 6329.062014] __slab_free+0x32/0x380
[ 6329.062014] kmem_cache_free+0x186/0x2c0
[ 6329.062014] dst_destroy+0x8a/0xe0
[ 6329.062014] dst_release+0x53/0x70
[ 6329.062014] ip_tunnel_xmit+0x50e/0xfb0
[ 6329.062014] ipip_tunnel_xmit+0x41/0x60
[ 6329.062014] dev_hard_start_xmit+0x3ed/0x950
[ 6329.062014] __dev_queue_xmit+0x621/0x890
[ 6329.062014] dev_queue_xmit+0xb/0x10
[ 6329.062014] neigh_direct_output+0xc/0x10
[ 6329.062014] ip_finish_output2+0x494/0x5d0
[ 6329.062014] ip_finish_output+0x238/0x2d0
[ 6329.062014] ip_output+0x9f/0x110
[ 6329.062014] ip_local_out+0x6e/0xa0
[ 6329.062014] igmpv3_sendpack+0x43/0x50
[ 6329.062014] igmp_ifc_timer_expire+0x395/0x400
[ 6329.062014] INFO: Slab 0xffffea0002d20200 objects=14 used=14 fp=0x
(null) flags=0x100000000004080
[ 6329.062014] INFO: Object 0xffff8800b48098c0 @offset=6336
fp=0xffff8800b4809680
[ 6329.062014] Bytes b4 ffff8800b48098b0: 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6329.062014] Object ffff8800b48098c0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b48098d0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b48098e0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b48098f0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b4809900: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b4809910: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b4809920: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b4809930: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b4809940: 6a 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b jkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b4809950: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b4809960: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6329.062014] Object ffff8800b4809970: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b a5 kkkkkkkkkkkkkkk.
[ 6329.062014] Redzone ffff8800b4809980: bb bb bb bb bb bb bb bb
........
[ 6329.062014] Padding ffff8800b4809ac0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6329.062014] Padding ffff8800b4809ad0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6329.062014] Padding ffff8800b4809ae0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6329.062014] Padding ffff8800b4809af0: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6329.062014] CPU: 0 PID: 6108 Comm: trinity-main Tainted: G B
3.13.0+ #1
[ 6329.062014] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 6329.062014] ffff8800b48098c0 ffff8800ab253b38 ffffffff82366c34
ffff8800baacd8c0
[ 6329.062014] ffff8800ab253b68 ffffffff81262e41 ffff8800b4809941
ffff8800baacd8c0
[ 6329.062014] 000000000000006b ffff8800b48098c0 ffff8800ab253bb0
ffffffff81263284
[ 6329.062014] Call Trace:
[ 6329.062014] [<ffffffff82366c34>] dump_stack+0x4d/0x66
[ 6329.062014] [<ffffffff81262e41>] print_trailer+0x131/0x140
[ 6329.062014] [<ffffffff81263284>] check_bytes_and_report+0xc4/0x120
[ 6329.062014] [<ffffffff81263b5e>] check_object+0x11e/0x240
[ 6329.062014] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6329.062014] [<ffffffff8236183c>] alloc_debug_processing+0x62/0x104
[ 6329.062014] [<ffffffff8236256d>] __slab_alloc+0x4f8/0x58c
[ 6329.062014] [<ffffffff8117a418>] ? sched_clock_cpu+0xb8/0xe0
[ 6329.062014] [<ffffffff810ac027>] ? kvm_clock_read+0x27/0x40
[ 6329.062014] [<ffffffff810787d9>] ? sched_clock+0x9/0x10
[ 6329.062014] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6329.062014] [<ffffffff8117a418>] ? sched_clock_cpu+0xb8/0xe0
[ 6329.062014] [<ffffffff8204e565>] ? fib_table_lookup+0x535/0x570
[ 6329.062014] [<ffffffff8117a55a>] ? local_clock+0x1a/0x40
[ 6329.062014] [<ffffffff8118fa38>] ? lock_release_holdtime+0x28/0x180
[ 6329.062014] [<ffffffff81265b84>] kmem_cache_alloc+0x94/0x290
[ 6329.062014] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6329.062014] [<ffffffff8204e57d>] ? fib_table_lookup+0x54d/0x570
[ 6329.062014] [<ffffffff81f9d696>] dst_alloc+0x46/0x180
[ 6329.062014] [<ffffffff8118f1b2>] ? __lock_is_held+0x52/0x80
[ 6329.062014] [<ffffffff81ff58b7>] rt_dst_alloc+0x47/0x50
[ 6329.062014] [<ffffffff81ff9a92>] __ip_route_output_key+0x882/0xa80
[ 6329.062014] [<ffffffff81ff9210>] ? ip_route_input_noref+0x1060/0x1060
[ 6329.062014] [<ffffffff81ffa002>] ip_route_output_flow+0x22/0x60
[ 6329.062014] [<ffffffff8202a746>] ip4_datagram_release_cb+0x266/0x390
[ 6329.062014] [<ffffffff8202a5a4>] ? ip4_datagram_release_cb+0xc4/0x390
[ 6329.062014] [<ffffffff81f7de84>] release_sock+0x184/0x220
[ 6329.062014] [<ffffffff81f7ed38>] sock_setsockopt+0xa58/0xa80
[ 6329.062014] [<ffffffff814b5b06>] ? selinux_socket_setsockopt+0x46/0x60
[ 6329.062014] [<ffffffff81f78e97>] SyS_setsockopt+0x77/0xe0
[ 6329.062014] [<ffffffff82380e39>] system_call_fastpath+0x16/0x1b
[ 6329.062014] FIX ip_dst_cache: Restoring
0xffff8800b4809940-0xffff8800b4809940=0x6b
[ 6329.062014] FIX ip_dst_cache: Marking all objects used
[ 6342.045208] =============================================================================
[ 6342.046024] BUG ip_dst_cache (Tainted: G B ): Poison overwritten
[ 6342.046024] -----------------------------------------------------------------------------
[ 6342.046024] INFO: 0xffff8800541b9dc0-0xffff8800541b9dc0. First byte
0x6a instead of 0x6b
[ 6342.046024] INFO: Allocated in dst_alloc+0x46/0x180 age=12273 cpu=0 pid=8801
[ 6342.046024] __slab_alloc+0x4f8/0x58c
[ 6342.046024] kmem_cache_alloc+0x94/0x290
[ 6342.046024] dst_alloc+0x46/0x180
[ 6342.046024] rt_dst_alloc+0x47/0x50
[ 6342.046024] __ip_route_output_key+0x882/0xa80
[ 6342.046024] ip_route_output_flow+0x22/0x60
[ 6342.046024] igmpv3_newpack+0xe2/0x210
[ 6342.046024] add_grhead.isra.17+0x37/0xa0
[ 6342.046024] add_grec+0x3b2/0x470
[ 6342.046024] igmp_ifc_timer_expire+0x28e/0x400
[ 6342.046024] call_timer_fn+0x146/0x320
[ 6342.046024] run_timer_softirq+0x2d4/0x360
[ 6342.046024] __do_softirq+0x217/0x4a0
[ 6342.046024] irq_exit+0x45/0xb0
[ 6342.046024] smp_apic_timer_interrupt+0x3f/0x50
[ 6342.046024] apic_timer_interrupt+0x72/0x80
[ 6342.046024] INFO: Freed in dst_destroy+0x8a/0xe0 age=12273 cpu=0 pid=8801
[ 6342.046024] __slab_free+0x32/0x380
[ 6342.046024] kmem_cache_free+0x186/0x2c0
[ 6342.046024] dst_destroy+0x8a/0xe0
[ 6342.046024] dst_release+0x53/0x70
[ 6342.046024] ip_tunnel_xmit+0x50e/0xfb0
[ 6342.046024] ipip_tunnel_xmit+0x41/0x60
[ 6342.046024] dev_hard_start_xmit+0x3ed/0x950
[ 6342.046024] __dev_queue_xmit+0x621/0x890
[ 6342.046024] dev_queue_xmit+0xb/0x10
[ 6342.046024] neigh_direct_output+0xc/0x10
[ 6342.046024] ip_finish_output2+0x494/0x5d0
[ 6342.046024] ip_finish_output+0x238/0x2d0
[ 6342.046024] ip_output+0x9f/0x110
[ 6342.046024] ip_local_out+0x6e/0xa0
[ 6342.046024] igmpv3_sendpack+0x43/0x50
[ 6342.046024] igmp_ifc_timer_expire+0x395/0x400
[ 6342.046024] INFO: Slab 0xffffea0001506e00 objects=14 used=14 fp=0x
(null) flags=0x100000000004080
[ 6342.046024] INFO: Object 0xffff8800541b9d40 @offset=7488
fp=0xffff8800541b8240
[ 6342.046024] Bytes b4 ffff8800541b9d30: 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6342.046024] Object ffff8800541b9d40: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9d50: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9d60: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9d70: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9d80: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9d90: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9da0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9db0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9dc0: 6a 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b jkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9dd0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9de0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6342.046024] Object ffff8800541b9df0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b a5 kkkkkkkkkkkkkkk.
[ 6342.046024] Redzone ffff8800541b9e00: bb bb bb bb bb bb bb bb
........
[ 6342.046024] Padding ffff8800541b9f40: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6342.046024] Padding ffff8800541b9f50: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6342.046024] Padding ffff8800541b9f60: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6342.046024] Padding ffff8800541b9f70: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6342.046024] CPU: 0 PID: 2715 Comm: dhcpcd Tainted: G B 3.13.0+ #1
[ 6342.046024] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 6342.046024] ffff8800541b9d40 ffff8800b66f78a8 ffffffff82366c34
ffff8800baacd8c0
[ 6342.046024] ffff8800b66f78d8 ffffffff81262e41 ffff8800541b9dc1
ffff8800baacd8c0
[ 6342.046024] 000000000000006b ffff8800541b9d40 ffff8800b66f7920
ffffffff81263284
[ 6342.046024] Call Trace:
[ 6342.046024] [<ffffffff82366c34>] dump_stack+0x4d/0x66
[ 6342.046024] [<ffffffff81262e41>] print_trailer+0x131/0x140
[ 6342.046024] [<ffffffff81263284>] check_bytes_and_report+0xc4/0x120
[ 6342.046024] [<ffffffff81263b5e>] check_object+0x11e/0x240
[ 6342.046024] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6342.046024] [<ffffffff8236183c>] alloc_debug_processing+0x62/0x104
[ 6342.046024] [<ffffffff8236256d>] __slab_alloc+0x4f8/0x58c
[ 6342.046024] [<ffffffff81f80c28>] ? __alloc_skb+0x88/0x250
[ 6342.046024] [<ffffffff8107efa6>] ? save_stack_trace+0x26/0x50
[ 6342.046024] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6342.046024] [<ffffffff811919f6>] ? trace_hardirqs_on_caller+0x16/0x220
[ 6342.046024] [<ffffffff81191c0d>] ? trace_hardirqs_on+0xd/0x10
[ 6342.046024] [<ffffffff81265b84>] kmem_cache_alloc+0x94/0x290
[ 6342.046024] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6342.046024] [<ffffffff81f9d696>] dst_alloc+0x46/0x180
[ 6342.046024] [<ffffffff81ff58b7>] rt_dst_alloc+0x47/0x50
[ 6342.046024] [<ffffffff81ff9a92>] __ip_route_output_key+0x882/0xa80
[ 6342.046024] [<ffffffff81ff9210>] ? ip_route_input_noref+0x1060/0x1060
[ 6342.046024] [<ffffffff81f80c28>] ? __alloc_skb+0x88/0x250
[ 6342.046024] [<ffffffff81ffa002>] ip_route_output_flow+0x22/0x60
[ 6342.046024] [<ffffffff82060ebf>] vti_tunnel_xmit+0x9f/0x450
[ 6342.046024] [<ffffffff81f93dbd>] dev_hard_start_xmit+0x3ed/0x950
[ 6342.046024] [<ffffffff81f94320>] ? dev_hard_start_xmit+0x950/0x950
[ 6342.046024] [<ffffffff81f94941>] __dev_queue_xmit+0x621/0x890
[ 6342.046024] [<ffffffff81f94320>] ? dev_hard_start_xmit+0x950/0x950
[ 6342.046024] [<ffffffff81f94bbb>] dev_queue_xmit+0xb/0x10
[ 6342.046024] [<ffffffff820f5c89>] packet_sendmsg+0x559/0x5e0
[ 6342.046024] [<ffffffff81f77987>] sock_sendmsg+0x97/0xd0
[ 6342.046024] [<ffffffff8123ff45>] ? might_fault+0x55/0xb0
[ 6342.046024] [<ffffffff8123ff8e>] ? might_fault+0x9e/0xb0
[ 6342.046024] [<ffffffff8123ff45>] ? might_fault+0x55/0xb0
[ 6342.046024] [<ffffffff81f77e6c>] SYSC_sendto+0x11c/0x160
[ 6342.046024] [<ffffffff81f78dc9>] SyS_sendto+0x9/0x10
[ 6342.046024] [<ffffffff82380e39>] system_call_fastpath+0x16/0x1b
[ 6342.046024] FIX ip_dst_cache: Restoring
0xffff8800541b9dc0-0xffff8800541b9dc0=0x6b
[ 6342.046024] FIX ip_dst_cache: Marking all objects used
[ 6344.988076] =============================================================================
[ 6344.989020] BUG ip_dst_cache (Tainted: G B ): Poison overwritten
[ 6344.989020] -----------------------------------------------------------------------------
[ 6344.989020] INFO: 0xffff8800a3bc8080-0xffff8800a3bc8080. First byte
0x6a instead of 0x6b
[ 6344.989020] INFO: Allocated in dst_alloc+0x46/0x180 age=705 cpu=0 pid=6108
[ 6344.989020] __slab_alloc+0x4f8/0x58c
[ 6344.989020] kmem_cache_alloc+0x94/0x290
[ 6344.989020] dst_alloc+0x46/0x180
[ 6344.989020] rt_dst_alloc+0x47/0x50
[ 6344.989020] __ip_route_output_key+0x882/0xa80
[ 6344.989020] ip_route_output_flow+0x22/0x60
[ 6344.989020] igmpv3_newpack+0xe2/0x210
[ 6344.989020] add_grhead.isra.17+0x37/0xa0
[ 6344.989020] add_grec+0x3b2/0x470
[ 6344.989020] igmp_ifc_timer_expire+0x11a/0x400
[ 6344.989020] call_timer_fn+0x146/0x320
[ 6344.989020] run_timer_softirq+0x2d4/0x360
[ 6344.989020] __do_softirq+0x217/0x4a0
[ 6344.989020] irq_exit+0x45/0xb0
[ 6344.989020] smp_apic_timer_interrupt+0x3f/0x50
[ 6344.989020] apic_timer_interrupt+0x72/0x80
[ 6344.989020] INFO: Freed in dst_destroy+0x8a/0xe0 age=705 cpu=0 pid=6108
[ 6344.989020] __slab_free+0x32/0x380
[ 6344.989020] kmem_cache_free+0x186/0x2c0
[ 6344.989020] dst_destroy+0x8a/0xe0
[ 6344.989020] dst_release+0x53/0x70
[ 6344.989020] ip_tunnel_xmit+0x50e/0xfb0
[ 6344.989020] ipip_tunnel_xmit+0x41/0x60
[ 6344.989020] dev_hard_start_xmit+0x3ed/0x950
[ 6344.989020] __dev_queue_xmit+0x621/0x890
[ 6344.989020] dev_queue_xmit+0xb/0x10
[ 6344.989020] neigh_direct_output+0xc/0x10
[ 6344.989020] ip_finish_output2+0x494/0x5d0
[ 6344.989020] ip_finish_output+0x238/0x2d0
[ 6344.989020] ip_output+0x9f/0x110
[ 6344.989020] ip_local_out+0x6e/0xa0
[ 6344.989020] igmpv3_sendpack+0x43/0x50
[ 6344.989020] igmp_ifc_timer_expire+0x395/0x400
[ 6344.989020] INFO: Slab 0xffffea00028ef200 objects=14 used=14 fp=0x
(null) flags=0x100000000004080
[ 6344.989020] INFO: Object 0xffff8800a3bc8000 @offset=0 fp=0xffff8800a3bc8240
[ 6344.989020] Object ffff8800a3bc8000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8020: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8030: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8040: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8050: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8060: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8070: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8080: 6a 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b jkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc8090: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc80a0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6344.989020] Object ffff8800a3bc80b0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b a5 kkkkkkkkkkkkkkk.
[ 6344.989020] Redzone ffff8800a3bc80c0: bb bb bb bb bb bb bb bb
........
[ 6344.989020] Padding ffff8800a3bc8200: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6344.989020] Padding ffff8800a3bc8210: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6344.989020] Padding ffff8800a3bc8220: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6344.989020] Padding ffff8800a3bc8230: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6344.989020] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G B 3.13.0+ #1
[ 6344.989020] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 6344.989020] ffff8800a3bc8000 ffff8800bf6039b8 ffffffff82366c34
ffff8800baacd8c0
[ 6344.989020] ffff8800bf6039e8 ffffffff81262e41 ffff8800a3bc8081
ffff8800baacd8c0
[ 6344.989020] 000000000000006b ffff8800a3bc8000 ffff8800bf603a30
ffffffff81263284
[ 6344.989020] Call Trace:
[ 6344.989020] <IRQ> [<ffffffff82366c34>] dump_stack+0x4d/0x66
[ 6344.989020] [<ffffffff81262e41>] print_trailer+0x131/0x140
[ 6344.989020] [<ffffffff81263284>] check_bytes_and_report+0xc4/0x120
[ 6344.989020] [<ffffffff81263b5e>] check_object+0x11e/0x240
[ 6344.989020] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6344.989020] [<ffffffff8236183c>] alloc_debug_processing+0x62/0x104
[ 6344.989020] [<ffffffff8236256d>] __slab_alloc+0x4f8/0x58c
[ 6344.989020] [<ffffffff811919f6>] ? trace_hardirqs_on_caller+0x16/0x220
[ 6344.989020] [<ffffffff81191c0d>] ? trace_hardirqs_on+0xd/0x10
[ 6344.989020] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6344.989020] [<ffffffff81191c0d>] ? trace_hardirqs_on+0xd/0x10
[ 6344.989020] [<ffffffff81f80c28>] ? __alloc_skb+0x88/0x250
[ 6344.989020] [<ffffffff81265b84>] kmem_cache_alloc+0x94/0x290
[ 6344.989020] [<ffffffff8203b150>] ? devinet_ioctl+0x740/0x740
[ 6344.989020] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6344.989020] [<ffffffff81f9d696>] dst_alloc+0x46/0x180
[ 6344.989020] [<ffffffff81ff58b7>] rt_dst_alloc+0x47/0x50
[ 6344.989020] [<ffffffff81ff9a92>] __ip_route_output_key+0x882/0xa80
[ 6344.989020] [<ffffffff81ff9210>] ? ip_route_input_noref+0x1060/0x1060
[ 6344.989020] [<ffffffff81ffa002>] ip_route_output_flow+0x22/0x60
[ 6344.989020] [<ffffffff8203fc62>] igmpv3_newpack+0xe2/0x210
[ 6344.989020] [<ffffffff8203fdc7>] add_grhead.isra.17+0x37/0xa0
[ 6344.989020] [<ffffffff820401e2>] add_grec+0x3b2/0x470
[ 6344.989020] [<ffffffff82041850>] ? igmp_ifc_timer_expire+0x90/0x400
[ 6344.989020] [<ffffffff820418da>] igmp_ifc_timer_expire+0x11a/0x400
[ 6344.989020] [<ffffffff820417c0>] ? igmp_mc_get_next.isra.15+0x250/0x250
[ 6344.989020] [<ffffffff820417c0>] ? igmp_mc_get_next.isra.15+0x250/0x250
[ 6344.989020] [<ffffffff81149596>] call_timer_fn+0x146/0x320
[ 6344.989020] [<ffffffff81149450>] ? ftrace_raw_event_timer_start+0x180/0x180
[ 6344.989020] [<ffffffff820417c0>] ? igmp_mc_get_next.isra.15+0x250/0x250
[ 6344.989020] [<ffffffff81149a44>] run_timer_softirq+0x2d4/0x360
[ 6344.989020] [<ffffffff8113fb17>] __do_softirq+0x217/0x4a0
[ 6344.989020] [<ffffffff81140025>] irq_exit+0x45/0xb0
[ 6344.989020] [<ffffffff810a31bf>] smp_apic_timer_interrupt+0x3f/0x50
[ 6344.989020] [<ffffffff82381ab2>] apic_timer_interrupt+0x72/0x80
[ 6344.989020] <EOI> [<ffffffff81079a8d>] ? default_idle+0xed/0x270
[ 6344.989020] [<ffffffff81191c0d>] ? trace_hardirqs_on+0xd/0x10
[ 6344.989020] [<ffffffff810ac416>] ? native_safe_halt+0x6/0x10
[ 6344.989020] [<ffffffff81079a92>] default_idle+0xf2/0x270
[ 6344.989020] [<ffffffff8107a3d3>] arch_cpu_idle+0x13/0x30
[ 6344.989020] [<ffffffff811a0457>] cpu_startup_entry+0x2e7/0x400
[ 6344.989020] [<ffffffff82357ad8>] rest_init+0x138/0x140
[ 6344.989020] [<ffffffff823579a0>] ? csum_partial_copy_generic+0x170/0x170
[ 6344.989020] [<ffffffff82febf3d>] start_kernel+0x40b/0x418
[ 6344.989020] [<ffffffff82feb8b0>] ? repair_env_string+0x5e/0x5e
[ 6344.989020] [<ffffffff82feb117>] ? early_idt_handlers+0x117/0x120
[ 6344.989020] [<ffffffff82feb5e0>] x86_64_start_reservations+0x2a/0x2c
[ 6344.989020] [<ffffffff82feb728>] x86_64_start_kernel+0x146/0x155
[ 6344.989020] FIX ip_dst_cache: Restoring
0xffff8800a3bc8080-0xffff8800a3bc8080=0x6b
[ 6344.989020] FIX ip_dst_cache: Marking all objects used
[ 6346.340084] =============================================================================
[ 6346.341017] BUG ip_dst_cache (Tainted: G B ): Poison overwritten
[ 6346.341017] -----------------------------------------------------------------------------
[ 6346.341017] INFO: 0xffff8800ab252080-0xffff8800ab252080. First byte
0x6a instead of 0x6b
[ 6346.341017] INFO: Allocated in dst_alloc+0x46/0x180 age=1352 cpu=0 pid=0
[ 6346.341017] __slab_alloc+0x4f8/0x58c
[ 6346.341017] kmem_cache_alloc+0x94/0x290
[ 6346.341017] dst_alloc+0x46/0x180
[ 6346.341017] rt_dst_alloc+0x47/0x50
[ 6346.341017] __ip_route_output_key+0x882/0xa80
[ 6346.341017] ip_route_output_flow+0x22/0x60
[ 6346.341017] igmpv3_newpack+0xe2/0x210
[ 6346.341017] add_grhead.isra.17+0x37/0xa0
[ 6346.341017] add_grec+0x3b2/0x470
[ 6346.341017] igmp_ifc_timer_expire+0x11a/0x400
[ 6346.341017] call_timer_fn+0x146/0x320
[ 6346.341017] run_timer_softirq+0x2d4/0x360
[ 6346.341017] __do_softirq+0x217/0x4a0
[ 6346.341017] irq_exit+0x45/0xb0
[ 6346.341017] smp_apic_timer_interrupt+0x3f/0x50
[ 6346.341017] apic_timer_interrupt+0x72/0x80
[ 6346.341017] INFO: Freed in dst_destroy+0x8a/0xe0 age=1184 cpu=0 pid=0
[ 6346.341017] __slab_free+0x32/0x380
[ 6346.341017] kmem_cache_free+0x186/0x2c0
[ 6346.341017] dst_destroy+0x8a/0xe0
[ 6346.341017] dst_release+0x53/0x70
[ 6346.341017] ip_tunnel_xmit+0x50e/0xfb0
[ 6346.341017] ipip_tunnel_xmit+0x41/0x60
[ 6346.341017] dev_hard_start_xmit+0x3ed/0x950
[ 6346.341017] __dev_queue_xmit+0x621/0x890
[ 6346.341017] dev_queue_xmit+0xb/0x10
[ 6346.341017] neigh_direct_output+0xc/0x10
[ 6346.341017] ip_finish_output2+0x494/0x5d0
[ 6346.341017] ip_finish_output+0x238/0x2d0
[ 6346.341017] ip_output+0x9f/0x110
[ 6346.341017] ip_local_out+0x6e/0xa0
[ 6346.341017] igmpv3_sendpack+0x43/0x50
[ 6346.341017] igmp_ifc_timer_expire+0x395/0x400
[ 6346.341017] INFO: Slab 0xffffea0002ac9480 objects=14 used=14 fp=0x
(null) flags=0x100000000004080
[ 6346.341017] INFO: Object 0xffff8800ab252000 @offset=0 fp=0xffff8800ab253d40
[ 6346.341017] Object ffff8800ab252000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252020: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252030: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252040: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252050: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252060: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252070: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252080: 6a 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b jkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab252090: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab2520a0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 6346.341017] Object ffff8800ab2520b0: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
6b 6b 6b 6b 6b a5 kkkkkkkkkkkkkkk.
[ 6346.341017] Redzone ffff8800ab2520c0: bb bb bb bb bb bb bb bb
........
[ 6346.341017] Padding ffff8800ab252200: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6346.341017] Padding ffff8800ab252210: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6346.341017] Padding ffff8800ab252220: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6346.341017] Padding ffff8800ab252230: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a
5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZZZZZ
[ 6346.341017] CPU: 0 PID: 2715 Comm: dhcpcd Tainted: G B 3.13.0+ #1
[ 6346.341017] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 6346.341017] ffff8800ab252000 ffff8800b66f77e8 ffffffff82366c34
ffff8800baacd8c0
[ 6346.341017] ffff8800b66f7818 ffffffff81262e41 ffff8800ab252081
ffff8800baacd8c0
[ 6346.341017] 000000000000006b ffff8800ab252000 ffff8800b66f7860
ffffffff81263284
[ 6346.341017] Call Trace:
[ 6346.341017] [<ffffffff82366c34>] dump_stack+0x4d/0x66
[ 6346.341017] [<ffffffff81262e41>] print_trailer+0x131/0x140
[ 6346.341017] [<ffffffff81263284>] check_bytes_and_report+0xc4/0x120
[ 6346.341017] [<ffffffff81263b5e>] check_object+0x11e/0x240
[ 6346.341017] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6346.341017] [<ffffffff8236183c>] alloc_debug_processing+0x62/0x104
[ 6346.341017] [<ffffffff8236256d>] __slab_alloc+0x4f8/0x58c
[ 6346.341017] [<ffffffff81264df9>] ? deactivate_slab+0x279/0x550
[ 6346.341017] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6346.341017] [<ffffffff8204d064>] ? check_leaf.isra.6+0x84/0x2d0
[ 6346.341017] [<ffffffff81265b84>] kmem_cache_alloc+0x94/0x290
[ 6346.341017] [<ffffffff81f9d696>] ? dst_alloc+0x46/0x180
[ 6346.341017] [<ffffffff8204e57d>] ? fib_table_lookup+0x54d/0x570
[ 6346.341017] [<ffffffff81f9d696>] dst_alloc+0x46/0x180
[ 6346.341017] [<ffffffff81ff58b7>] rt_dst_alloc+0x47/0x50
[ 6346.341017] [<ffffffff81ff9a92>] __ip_route_output_key+0x882/0xa80
[ 6346.341017] [<ffffffff81ff9210>] ? ip_route_input_noref+0x1060/0x1060
[ 6346.341017] [<ffffffff81ffa002>] ip_route_output_flow+0x22/0x60
[ 6346.341017] [<ffffffff82053ae8>] ip_tunnel_xmit+0x4b8/0xfb0
[ 6346.341017] [<ffffffff82053932>] ? ip_tunnel_xmit+0x302/0xfb0
[ 6346.341017] [<ffffffff8205eb33>] __gre_xmit+0x73/0x90
[ 6346.341017] [<ffffffff8205f042>] ipgre_xmit+0x172/0x1a0
[ 6346.341017] [<ffffffff81f93dbd>] dev_hard_start_xmit+0x3ed/0x950
[ 6346.341017] [<ffffffff81f94320>] ? dev_hard_start_xmit+0x950/0x950
[ 6346.341017] [<ffffffff8205eda0>] ? gre_tap_xmit+0xd0/0xd0
[ 6346.341017] [<ffffffff81f94941>] __dev_queue_xmit+0x621/0x890
[ 6346.341017] [<ffffffff81f94320>] ? dev_hard_start_xmit+0x950/0x950
[ 6346.341017] [<ffffffff8205eda0>] ? gre_tap_xmit+0xd0/0xd0
[ 6346.341017] [<ffffffff81f94bbb>] dev_queue_xmit+0xb/0x10
[ 6346.341017] [<ffffffff820f5c89>] packet_sendmsg+0x559/0x5e0
[ 6346.341017] [<ffffffff81f77987>] sock_sendmsg+0x97/0xd0
[ 6346.341017] [<ffffffff8123ff45>] ? might_fault+0x55/0xb0
[ 6346.341017] [<ffffffff8123ff8e>] ? might_fault+0x9e/0xb0
[ 6346.341017] [<ffffffff8123ff45>] ? might_fault+0x55/0xb0
[ 6346.341017] [<ffffffff81f77e6c>] SYSC_sendto+0x11c/0x160
[ 6346.341017] [<ffffffff81f78dc9>] SyS_sendto+0x9/0x10
[ 6346.341017] [<ffffffff82380e39>] system_call_fastpath+0x16/0x1b
[ 6346.341017] FIX ip_dst_cache: Restoring
0xffff8800ab252080-0xffff8800ab252080=0x6b
[ 6346.341017] FIX ip_dst_cache: Marking all objects used
[19618.459429] sock: sock_set_timeout: `trinity-main' (pid 30849)
tries to set negative timeout
^ permalink raw reply
* [PATCH net-next 1/2] dts: Add bindings for multicast hash bins and perfect filter entries
From: Vince Bridgers @ 2014-01-31 20:15 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
Cc: peppe.cavallaro-qxv4g6HH51o, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, dinguyen-EIB2kfCEclfQT0dZR+AlfA,
rayagond-AmucfkJibqKGw+nKnLezzg,
vbridgers2013-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <1391199356-27226-1-git-send-email-vbridgers2013-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
This change adds bindings for the number of multicast hash bins and perfect
filter entries supported by the Synopsys EMAC. The Synopsys EMAC core is
configurable at device creation time, and can be configured for a different
number of multicast hash bins and a different number of perfect filter entries.
The device does not provide a way to query these parameters, therefore
parameters are required. The Altera Cyclone V SOC has support for 256
multicast hash bins and 128 perfect filter entries, and is different than
what's currently provided in the stmmac driver.
Signed-off-by: Vince Bridgers <vbridgers2013-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
Documentation/devicetree/bindings/net/stmmac.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
index 9d92d42..dbf7498 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -34,6 +34,10 @@ Optional properties:
reset phandle is given
- max-frame-size: Maximum Transfer Unit (IEEE defined MTU), rather
than the maximum frame size.
+- snps,multicast-filter-bins: Number of multicast filter hash bins
+ supported by this device instance
+- snps,perfect-filter-entries: Number of perfect filter entries supported
+ by this device instance
Examples:
@@ -46,4 +50,6 @@ Examples:
mac-address = [000000000000]; /* Filled in by U-Boot */
max-frame-size = <3800>;
phy-mode = "gmii";
+ snps,multicast-filter-bins = <256>;
+ snps,perfect-filter-entries = <128>;
};
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH net-next 2/2] stmmac: add extended set multicast filter & devicetree options
From: Vince Bridgers @ 2014-01-31 20:15 UTC (permalink / raw)
To: devicetree, netdev
Cc: peppe.cavallaro, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, dinguyen, rayagond, vbridgers2013
In-Reply-To: <1391199356-27226-1-git-send-email-vbridgers2013@gmail.com>
The synopsys EMAC can be configured for different numbers of multicast hash
bins and perfect filter entries at device creation time and there's no way
to query this configuration information at runtime. As a result, a devicetree
parameter is required in order for the driver to program these filters
correctly for a particular device instance. This patch extends the current
driver by providing a different multicast filter programming function if
different than the currently supported 64 multicast hash bins and 32
perfect unicast addresses. This patch is required to correct multicast
filtering for the Altera Cyclone V SOC.
Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/common.h | 42 +++--
drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 5 +-
.../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 161 +++++++++++++++++---
.../net/ethernet/stmicro/stmmac/dwmac100_core.c | 29 ++--
.../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 36 ++---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 51 +++++++
include/linux/stmmac.h | 2 +
8 files changed, 261 insertions(+), 71 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index 7834a39..ca07afe 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -294,6 +294,8 @@ struct dma_features {
#define JUMBO_LEN 9000
+#define GMAC_MAX_PERFECT_ADDRESSES 32
+
struct stmmac_desc_ops {
/* DMA RX descriptor ring initialization */
void (*init_rx_desc) (struct dma_desc *p, int disable_rx_ic, int mode,
@@ -368,34 +370,37 @@ struct stmmac_dma_ops {
void (*rx_watchdog) (void __iomem *ioaddr, u32 riwt);
};
+struct mac_device_info;
+
struct stmmac_ops {
/* MAC core initialization */
- void (*core_init) (void __iomem *ioaddr, int mtu);
+ void (*core_init)(struct mac_device_info *hw, int mtu);
/* Enable and verify that the IPC module is supported */
- int (*rx_ipc) (void __iomem *ioaddr);
+ int (*rx_ipc)(struct mac_device_info *hw);
/* Dump MAC registers */
- void (*dump_regs) (void __iomem *ioaddr);
+ void (*dump_regs)(struct mac_device_info *hw);
/* Handle extra events on specific interrupts hw dependent */
- int (*host_irq_status) (void __iomem *ioaddr,
+ int (*host_irq_status)(struct mac_device_info *hw,
struct stmmac_extra_stats *x);
/* Multicast filter setting */
- void (*set_filter) (struct net_device *dev, int id);
+ void (*set_filter)(struct mac_device_info *hw,
+ struct net_device *dev);
/* Flow control setting */
- void (*flow_ctrl) (void __iomem *ioaddr, unsigned int duplex,
+ void (*flow_ctrl)(struct mac_device_info *hw, unsigned int duplex,
unsigned int fc, unsigned int pause_time);
/* Set power management mode (e.g. magic frame) */
- void (*pmt) (void __iomem *ioaddr, unsigned long mode);
+ void (*pmt)(struct mac_device_info *hw, unsigned long mode);
/* Set/Get Unicast MAC addresses */
- void (*set_umac_addr) (void __iomem *ioaddr, unsigned char *addr,
+ void (*set_umac_addr)(struct mac_device_info *hw, unsigned char *addr,
unsigned int reg_n);
- void (*get_umac_addr) (void __iomem *ioaddr, unsigned char *addr,
+ void (*get_umac_addr)(struct mac_device_info *hw, unsigned char *addr,
unsigned int reg_n);
- void (*set_eee_mode) (void __iomem *ioaddr);
- void (*reset_eee_mode) (void __iomem *ioaddr);
- void (*set_eee_timer) (void __iomem *ioaddr, int ls, int tw);
- void (*set_eee_pls) (void __iomem *ioaddr, int link);
- void (*ctrl_ane) (void __iomem *ioaddr, bool restart);
- void (*get_adv) (void __iomem *ioaddr, struct rgmii_adv *adv);
+ void (*set_eee_mode)(struct mac_device_info *hw);
+ void (*reset_eee_mode)(struct mac_device_info *hw);
+ void (*set_eee_timer)(struct mac_device_info *hw, int ls, int tw);
+ void (*set_eee_pls)(struct mac_device_info *hw, int link);
+ void (*ctrl_ane)(struct mac_device_info *hw, bool restart);
+ void (*get_adv)(struct mac_device_info *hw, struct rgmii_adv *adv);
};
struct stmmac_hwtimestamp {
@@ -447,9 +452,14 @@ struct mac_device_info {
struct mii_regs mii; /* MII register Addresses */
struct mac_link link;
unsigned int synopsys_uid;
+ void __iomem *pcsr; /* vpointer to device CSRs */
+ int multicast_filter_bins;
+ int unicast_filter_entries;
+ int mcast_bits_log2;
};
-struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr);
+struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr,
+ int mcbins, int perfect_uc_entries);
struct mac_device_info *dwmac100_setup(void __iomem *ioaddr);
void stmmac_set_mac_addr(void __iomem *ioaddr, u8 addr[6],
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
index f37d90f..40b8533 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
@@ -87,7 +87,6 @@ enum power_event {
(reg * 8))
#define GMAC_ADDR_LOW(reg) (((reg > 15) ? 0x00000804 : 0x00000044) + \
(reg * 8))
-#define GMAC_MAX_PERFECT_ADDRESSES 32
/* PCS registers (AN/TBI/SGMII/RGMII) offset */
#define GMAC_AN_CTRL 0x000000c0 /* AN control */
@@ -130,6 +129,8 @@ enum power_event {
#define GMAC_CONTROL_2K 0x08000000 /* IEEE 802.3as 2K packets */
#define GMAC_CONTROL_TC 0x01000000 /* Transmit Conf. in RGMII/SGMII */
#define GMAC_CONTROL_WD 0x00800000 /* Disable Watchdog on receive */
+
+/* GMAC Configuration defines */
#define GMAC_CONTROL_JD 0x00400000 /* Jabber disable */
#define GMAC_CONTROL_BE 0x00200000 /* Frame Burst Enable */
#define GMAC_CONTROL_JE 0x00100000 /* Jumbo frame */
@@ -262,5 +263,7 @@ enum rtc_control {
#define GMAC_MMC_TX_INTR 0x108
#define GMAC_MMC_RX_CSUM_OFFLOAD 0x208
+#define GMAC_EXTHASH_BASE 0x500
+
extern const struct stmmac_dma_ops dwmac1000_dma_ops;
#endif /* __DWMAC1000_H__ */
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index b3e148e..44db9fb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -26,14 +26,15 @@
Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
*******************************************************************************/
+#include <linux/io.h>
#include <linux/crc32.h>
-#include <linux/slab.h>
#include <linux/ethtool.h>
-#include <asm/io.h>
+#include <linux/slab.h>
#include "dwmac1000.h"
-static void dwmac1000_core_init(void __iomem *ioaddr, int mtu)
+static void dwmac1000_core_init(struct mac_device_info *hw, int mtu)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 value = readl(ioaddr + GMAC_CONTROL);
value |= GMAC_CORE_INIT;
if (mtu > 1500)
@@ -52,8 +53,9 @@ static void dwmac1000_core_init(void __iomem *ioaddr, int mtu)
#endif
}
-static int dwmac1000_rx_ipc_enable(void __iomem *ioaddr)
+static int dwmac1000_rx_ipc_enable(struct mac_device_info *hw)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 value = readl(ioaddr + GMAC_CONTROL);
value |= GMAC_CONTROL_IPC;
@@ -64,8 +66,9 @@ static int dwmac1000_rx_ipc_enable(void __iomem *ioaddr)
return !!(value & GMAC_CONTROL_IPC);
}
-static void dwmac1000_dump_regs(void __iomem *ioaddr)
+static void dwmac1000_dump_regs(struct mac_device_info *hw)
{
+ void __iomem *ioaddr = hw->pcsr;
int i;
pr_info("\tDWMAC1000 regs (base addr = 0x%p)\n", ioaddr);
@@ -76,21 +79,113 @@ static void dwmac1000_dump_regs(void __iomem *ioaddr)
}
}
-static void dwmac1000_set_umac_addr(void __iomem *ioaddr, unsigned char *addr,
+static void dwmac1000_set_umac_addr(struct mac_device_info *hw,
+ unsigned char *addr,
unsigned int reg_n)
{
- stmmac_set_mac_addr(ioaddr, addr, GMAC_ADDR_HIGH(reg_n),
+ stmmac_set_mac_addr(hw->pcsr, addr, GMAC_ADDR_HIGH(reg_n),
GMAC_ADDR_LOW(reg_n));
}
-static void dwmac1000_get_umac_addr(void __iomem *ioaddr, unsigned char *addr,
+static void dwmac1000_get_umac_addr(struct mac_device_info *hw,
+ unsigned char *addr,
unsigned int reg_n)
{
- stmmac_get_mac_addr(ioaddr, addr, GMAC_ADDR_HIGH(reg_n),
+ stmmac_get_mac_addr(hw->pcsr, addr, GMAC_ADDR_HIGH(reg_n),
GMAC_ADDR_LOW(reg_n));
}
-static void dwmac1000_set_filter(struct net_device *dev, int id)
+static void dwmac1000_set_extmchash(void __iomem *ioaddr, u32 *mcfilterbits,
+ int numhashregs)
+{
+ int regs;
+ for (regs = 0; regs < numhashregs; regs++)
+ writel(mcfilterbits[regs],
+ ioaddr + GMAC_EXTHASH_BASE + regs * 4);
+}
+
+static void dwmac1000_set_filterex(struct mac_device_info *hw,
+ struct net_device *dev)
+{
+ void __iomem *ioaddr = (void __iomem *)dev->base_addr;
+ unsigned int value = 0;
+ unsigned int perfect_addr_number;
+ u32 mc_filter[8];
+
+ pr_debug("%s: # mcasts %d, # unicast %d\n", __func__,
+ netdev_mc_count(dev), netdev_uc_count(dev));
+
+ if (dev->flags & IFF_PROMISC) {
+ value = GMAC_FRAME_FILTER_PR;
+ } else if (dev->flags & IFF_ALLMULTI) {
+ value = GMAC_FRAME_FILTER_PM; /* pass all multi */
+ } else if (!netdev_mc_empty(dev)) {
+ struct netdev_hw_addr *ha;
+
+ memset(mc_filter, 0, sizeof(mc_filter));
+
+ /* Hash filter for multicast */
+ value = GMAC_FRAME_FILTER_HMC;
+
+ netdev_for_each_mc_addr(ha, dev) {
+ /* The upper n bits of the calculated CRC are used to
+ * index the contents of the hash table depending
+ * on the particular core's multicast hash size
+ * configured through Synopsys Core Consultant
+ */
+ int bit_nr = bitrev32(~crc32_le(~0, ha->addr,
+ ETH_ALEN)) >>
+ (32 - hw->mcast_bits_log2);
+
+ /* The most significant bit determines the register to
+ * use (H/L) while the other 5 bits determine the bit
+ * within the register.
+ */
+ mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
+ }
+ if (hw->mcast_bits_log2 == 6) {
+ writel(mc_filter[0], ioaddr + GMAC_HASH_LOW);
+ writel(mc_filter[1], ioaddr + GMAC_HASH_HIGH);
+ } else if (hw->mcast_bits_log2 == 7) {
+ dwmac1000_set_extmchash(ioaddr, mc_filter, 4);
+ } else if (hw->mcast_bits_log2 == 8) {
+ dwmac1000_set_extmchash(ioaddr, mc_filter, 8);
+ } else {
+ pr_debug("STMMAC: err in setting mulitcast filter\n");
+ }
+ }
+
+ /* Extra 16 regs are available in cores newer than the 3.40. */
+ if (hw->synopsys_uid > DWMAC_CORE_3_40)
+ perfect_addr_number = hw->unicast_filter_entries;
+ else
+ perfect_addr_number = hw->unicast_filter_entries / 2;
+
+ /* Handle multiple unicast addresses (perfect filtering) */
+ if (netdev_uc_count(dev) > perfect_addr_number)
+ /* Switch to promiscuous mode if more than 16 addrs
+ * are required
+ */
+ value |= GMAC_FRAME_FILTER_PR;
+ else {
+ int reg = 1;
+ struct netdev_hw_addr *ha;
+
+ netdev_for_each_uc_addr(ha, dev) {
+ dwmac1000_set_umac_addr(hw, ha->addr, reg);
+ reg++;
+ }
+ }
+
+#ifdef FRAME_FILTER_DEBUG
+ /* Enable Receive all mode (to debug filtering_fail errors) */
+ value |= GMAC_FRAME_FILTER_RA;
+#endif
+ writel(value, ioaddr + GMAC_FRAME_FILTER);
+}
+
+static void dwmac1000_set_filter(struct mac_device_info *hw,
+ struct net_device *dev)
{
void __iomem *ioaddr = (void __iomem *)dev->base_addr;
unsigned int value = 0;
@@ -130,7 +225,7 @@ static void dwmac1000_set_filter(struct net_device *dev, int id)
}
/* Extra 16 regs are available in cores newer than the 3.40. */
- if (id > DWMAC_CORE_3_40)
+ if (hw->synopsys_uid > DWMAC_CORE_3_40)
perfect_addr_number = GMAC_MAX_PERFECT_ADDRESSES;
else
perfect_addr_number = GMAC_MAX_PERFECT_ADDRESSES / 2;
@@ -146,7 +241,7 @@ static void dwmac1000_set_filter(struct net_device *dev, int id)
struct netdev_hw_addr *ha;
netdev_for_each_uc_addr(ha, dev) {
- dwmac1000_set_umac_addr(ioaddr, ha->addr, reg);
+ dwmac1000_set_umac_addr(hw, ha->addr, reg);
reg++;
}
}
@@ -162,9 +257,10 @@ static void dwmac1000_set_filter(struct net_device *dev, int id)
readl(ioaddr + GMAC_HASH_HIGH), readl(ioaddr + GMAC_HASH_LOW));
}
-static void dwmac1000_flow_ctrl(void __iomem *ioaddr, unsigned int duplex,
+static void dwmac1000_flow_ctrl(struct mac_device_info *hw, unsigned int duplex,
unsigned int fc, unsigned int pause_time)
{
+ void __iomem *ioaddr = hw->pcsr;
unsigned int flow = 0;
pr_debug("GMAC Flow-Control:\n");
@@ -185,8 +281,9 @@ static void dwmac1000_flow_ctrl(void __iomem *ioaddr, unsigned int duplex,
writel(flow, ioaddr + GMAC_FLOW_CTRL);
}
-static void dwmac1000_pmt(void __iomem *ioaddr, unsigned long mode)
+static void dwmac1000_pmt(struct mac_device_info *hw, unsigned long mode)
{
+ void __iomem *ioaddr = hw->pcsr;
unsigned int pmt = 0;
if (mode & WAKE_MAGIC) {
@@ -201,9 +298,10 @@ static void dwmac1000_pmt(void __iomem *ioaddr, unsigned long mode)
writel(pmt, ioaddr + GMAC_PMT);
}
-static int dwmac1000_irq_status(void __iomem *ioaddr,
+static int dwmac1000_irq_status(struct mac_device_info *hw,
struct stmmac_extra_stats *x)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 intr_status = readl(ioaddr + GMAC_INT_STATUS);
int ret = 0;
@@ -268,8 +366,9 @@ static int dwmac1000_irq_status(void __iomem *ioaddr,
return ret;
}
-static void dwmac1000_set_eee_mode(void __iomem *ioaddr)
+static void dwmac1000_set_eee_mode(struct mac_device_info *hw)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 value;
/* Enable the link status receive on RGMII, SGMII ore SMII
@@ -281,8 +380,9 @@ static void dwmac1000_set_eee_mode(void __iomem *ioaddr)
writel(value, ioaddr + LPI_CTRL_STATUS);
}
-static void dwmac1000_reset_eee_mode(void __iomem *ioaddr)
+static void dwmac1000_reset_eee_mode(struct mac_device_info *hw)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 value;
value = readl(ioaddr + LPI_CTRL_STATUS);
@@ -290,8 +390,9 @@ static void dwmac1000_reset_eee_mode(void __iomem *ioaddr)
writel(value, ioaddr + LPI_CTRL_STATUS);
}
-static void dwmac1000_set_eee_pls(void __iomem *ioaddr, int link)
+static void dwmac1000_set_eee_pls(struct mac_device_info *hw, int link)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 value;
value = readl(ioaddr + LPI_CTRL_STATUS);
@@ -304,8 +405,9 @@ static void dwmac1000_set_eee_pls(void __iomem *ioaddr, int link)
writel(value, ioaddr + LPI_CTRL_STATUS);
}
-static void dwmac1000_set_eee_timer(void __iomem *ioaddr, int ls, int tw)
+static void dwmac1000_set_eee_timer(struct mac_device_info *hw, int ls, int tw)
{
+ void __iomem *ioaddr = hw->pcsr;
int value = ((tw & 0xffff)) | ((ls & 0x7ff) << 16);
/* Program the timers in the LPI timer control register:
@@ -318,8 +420,9 @@ static void dwmac1000_set_eee_timer(void __iomem *ioaddr, int ls, int tw)
writel(value, ioaddr + LPI_TIMER_CTRL);
}
-static void dwmac1000_ctrl_ane(void __iomem *ioaddr, bool restart)
+static void dwmac1000_ctrl_ane(struct mac_device_info *hw, bool restart)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 value;
value = readl(ioaddr + GMAC_AN_CTRL);
@@ -332,8 +435,9 @@ static void dwmac1000_ctrl_ane(void __iomem *ioaddr, bool restart)
writel(value, ioaddr + GMAC_AN_CTRL);
}
-static void dwmac1000_get_adv(void __iomem *ioaddr, struct rgmii_adv *adv)
+static void dwmac1000_get_adv(struct mac_device_info *hw, struct rgmii_adv *adv)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 value = readl(ioaddr + GMAC_ANE_ADV);
if (value & GMAC_ANE_FD)
@@ -353,7 +457,7 @@ static void dwmac1000_get_adv(void __iomem *ioaddr, struct rgmii_adv *adv)
adv->lp_pause = (value & GMAC_ANE_PSE) >> GMAC_ANE_PSE_SHIFT;
}
-static const struct stmmac_ops dwmac1000_ops = {
+static struct stmmac_ops dwmac1000_ops = {
.core_init = dwmac1000_core_init,
.rx_ipc = dwmac1000_rx_ipc_enable,
.dump_regs = dwmac1000_dump_regs,
@@ -371,7 +475,8 @@ static const struct stmmac_ops dwmac1000_ops = {
.get_adv = dwmac1000_get_adv,
};
-struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr)
+struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr, int mcbins,
+ int perfect_uc_entries)
{
struct mac_device_info *mac;
u32 hwid = readl(ioaddr + GMAC_VERSION);
@@ -380,6 +485,16 @@ struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr)
if (!mac)
return NULL;
+ mac->pcsr = ioaddr;
+ mac->multicast_filter_bins = mcbins;
+ mac->unicast_filter_entries = perfect_uc_entries;
+ mac->mcast_bits_log2 = 0;
+ if (mac->multicast_filter_bins)
+ mac->mcast_bits_log2 = ilog2(mac->multicast_filter_bins);
+
+ if (mac->mcast_bits_log2 != 64)
+ dwmac1000_ops.set_filter = dwmac1000_set_filterex;
+
mac->mac = &dwmac1000_ops;
mac->dma = &dwmac1000_dma_ops;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
index 2ff767b..3ee3ab5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
@@ -28,12 +28,13 @@
Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
*******************************************************************************/
-#include <linux/crc32.h>
#include <asm/io.h>
+#include <linux/crc32.h>
#include "dwmac100.h"
-static void dwmac100_core_init(void __iomem *ioaddr, int mtu)
+static void dwmac100_core_init(struct mac_device_info *hw, int mtu)
{
+ void __iomem *ioaddr = hw->pcsr;
u32 value = readl(ioaddr + MAC_CONTROL);
writel((value | MAC_CORE_INIT), ioaddr + MAC_CONTROL);
@@ -43,8 +44,9 @@ static void dwmac100_core_init(void __iomem *ioaddr, int mtu)
#endif
}
-static void dwmac100_dump_mac_regs(void __iomem *ioaddr)
+static void dwmac100_dump_mac_regs(struct mac_device_info *hw)
{
+ void __iomem *ioaddr = hw->pcsr;
pr_info("\t----------------------------------------------\n"
"\t DWMAC 100 CSR (base addr = 0x%p)\n"
"\t----------------------------------------------\n", ioaddr);
@@ -66,30 +68,35 @@ static void dwmac100_dump_mac_regs(void __iomem *ioaddr)
readl(ioaddr + MAC_VLAN2));
}
-static int dwmac100_rx_ipc_enable(void __iomem *ioaddr)
+static int dwmac100_rx_ipc_enable(struct mac_device_info *hw)
{
return 0;
}
-static int dwmac100_irq_status(void __iomem *ioaddr,
+static int dwmac100_irq_status(struct mac_device_info *hw,
struct stmmac_extra_stats *x)
{
return 0;
}
-static void dwmac100_set_umac_addr(void __iomem *ioaddr, unsigned char *addr,
+static void dwmac100_set_umac_addr(struct mac_device_info *hw,
+ unsigned char *addr,
unsigned int reg_n)
{
+ void __iomem *ioaddr = hw->pcsr;
stmmac_set_mac_addr(ioaddr, addr, MAC_ADDR_HIGH, MAC_ADDR_LOW);
}
-static void dwmac100_get_umac_addr(void __iomem *ioaddr, unsigned char *addr,
+static void dwmac100_get_umac_addr(struct mac_device_info *hw,
+ unsigned char *addr,
unsigned int reg_n)
{
+ void __iomem *ioaddr = hw->pcsr;
stmmac_get_mac_addr(ioaddr, addr, MAC_ADDR_HIGH, MAC_ADDR_LOW);
}
-static void dwmac100_set_filter(struct net_device *dev, int id)
+static void dwmac100_set_filter(struct mac_device_info *hw,
+ struct net_device *dev)
{
void __iomem *ioaddr = (void __iomem *)dev->base_addr;
u32 value = readl(ioaddr + MAC_CONTROL);
@@ -137,9 +144,10 @@ static void dwmac100_set_filter(struct net_device *dev, int id)
writel(value, ioaddr + MAC_CONTROL);
}
-static void dwmac100_flow_ctrl(void __iomem *ioaddr, unsigned int duplex,
+static void dwmac100_flow_ctrl(struct mac_device_info *hw, unsigned int duplex,
unsigned int fc, unsigned int pause_time)
{
+ void __iomem *ioaddr = hw->pcsr;
unsigned int flow = MAC_FLOW_CTRL_ENABLE;
if (duplex)
@@ -148,7 +156,7 @@ static void dwmac100_flow_ctrl(void __iomem *ioaddr, unsigned int duplex,
}
/* No PMT module supported on ST boards with this Eth chip. */
-static void dwmac100_pmt(void __iomem *ioaddr, unsigned long mode)
+static void dwmac100_pmt(struct mac_device_info *hw, unsigned long mode)
{
return;
}
@@ -175,6 +183,7 @@ struct mac_device_info *dwmac100_setup(void __iomem *ioaddr)
pr_info("\tDWMAC100\n");
+ mac->pcsr = ioaddr;
mac->mac = &dwmac100_ops;
mac->dma = &dwmac100_dma_ops;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index c5f9cb8..e679fa6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -262,7 +262,7 @@ static int stmmac_ethtool_getsettings(struct net_device *dev,
/* Get and convert ADV/LP_ADV from the HW AN registers */
if (priv->hw->mac->get_adv)
- priv->hw->mac->get_adv(priv->ioaddr, &adv);
+ priv->hw->mac->get_adv(priv->hw, &adv);
else
return -EOPNOTSUPP; /* should never happen indeed */
@@ -352,7 +352,7 @@ static int stmmac_ethtool_setsettings(struct net_device *dev,
spin_lock(&priv->lock);
if (priv->hw->mac->ctrl_ane)
- priv->hw->mac->ctrl_ane(priv->ioaddr, 1);
+ priv->hw->mac->ctrl_ane(priv->hw, 1);
spin_unlock(&priv->lock);
}
@@ -471,7 +471,7 @@ stmmac_set_pauseparam(struct net_device *netdev,
if (netif_running(netdev))
ret = phy_start_aneg(phy);
} else
- priv->hw->mac->flow_ctrl(priv->ioaddr, phy->duplex,
+ priv->hw->mac->flow_ctrl(priv->hw, phy->duplex,
priv->flow_ctrl, priv->pause);
spin_unlock(&priv->lock);
return ret;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d93aa87..aaa14b2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -233,7 +233,7 @@ static void stmmac_enable_eee_mode(struct stmmac_priv *priv)
/* Check and enter in LPI mode */
if ((priv->dirty_tx == priv->cur_tx) &&
(priv->tx_path_in_lpi_mode == false))
- priv->hw->mac->set_eee_mode(priv->ioaddr);
+ priv->hw->mac->set_eee_mode(priv->hw);
}
/**
@@ -244,7 +244,7 @@ static void stmmac_enable_eee_mode(struct stmmac_priv *priv)
*/
void stmmac_disable_eee_mode(struct stmmac_priv *priv)
{
- priv->hw->mac->reset_eee_mode(priv->ioaddr);
+ priv->hw->mac->reset_eee_mode(priv->hw);
del_timer_sync(&priv->eee_ctrl_timer);
priv->tx_path_in_lpi_mode = false;
}
@@ -298,12 +298,12 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
priv->eee_ctrl_timer.expires = STMMAC_LPI_T(eee_timer);
add_timer(&priv->eee_ctrl_timer);
- priv->hw->mac->set_eee_timer(priv->ioaddr,
+ priv->hw->mac->set_eee_timer(priv->hw,
STMMAC_DEFAULT_LIT_LS,
priv->tx_lpi_timer);
} else
/* Set HW EEE according to the speed */
- priv->hw->mac->set_eee_pls(priv->ioaddr,
+ priv->hw->mac->set_eee_pls(priv->hw,
priv->phydev->link);
pr_info("stmmac: Energy-Efficient Ethernet initialized\n");
@@ -678,7 +678,7 @@ static void stmmac_adjust_link(struct net_device *dev)
}
/* Flow Control operation */
if (phydev->pause)
- priv->hw->mac->flow_ctrl(priv->ioaddr, phydev->duplex,
+ priv->hw->mac->flow_ctrl(priv->hw, phydev->duplex,
fc, pause_time);
if (phydev->speed != priv->speed) {
@@ -1519,8 +1519,7 @@ static int stmmac_get_hw_features(struct stmmac_priv *priv)
static void stmmac_check_ether_addr(struct stmmac_priv *priv)
{
if (!is_valid_ether_addr(priv->dev->dev_addr)) {
- priv->hw->mac->get_umac_addr((void __iomem *)
- priv->dev->base_addr,
+ priv->hw->mac->get_umac_addr(priv->hw,
priv->dev->dev_addr, 0);
if (!is_valid_ether_addr(priv->dev->dev_addr))
eth_hw_addr_random(priv->dev);
@@ -1617,14 +1616,14 @@ static int stmmac_hw_setup(struct net_device *dev)
}
/* Copy the MAC addr into the HW */
- priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0);
+ priv->hw->mac->set_umac_addr(priv->hw, dev->dev_addr, 0);
/* If required, perform hw setup of the bus. */
if (priv->plat->bus_setup)
priv->plat->bus_setup(priv->ioaddr);
/* Initialize the MAC Core */
- priv->hw->mac->core_init(priv->ioaddr, dev->mtu);
+ priv->hw->mac->core_init(priv->hw, dev->mtu);
/* Enable the MAC Rx/Tx */
stmmac_set_mac(priv->ioaddr, true);
@@ -1650,7 +1649,7 @@ static int stmmac_hw_setup(struct net_device *dev)
/* Dump DMA/MAC registers */
if (netif_msg_hw(priv)) {
- priv->hw->mac->dump_regs(priv->ioaddr);
+ priv->hw->mac->dump_regs(priv->hw);
priv->hw->dma->dump_regs(priv->ioaddr);
}
priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS;
@@ -1665,7 +1664,7 @@ static int stmmac_hw_setup(struct net_device *dev)
}
if (priv->pcs && priv->hw->mac->ctrl_ane)
- priv->hw->mac->ctrl_ane(priv->ioaddr, 0);
+ priv->hw->mac->ctrl_ane(priv->hw, 0);
return 0;
}
@@ -2244,7 +2243,7 @@ static void stmmac_set_rx_mode(struct net_device *dev)
struct stmmac_priv *priv = netdev_priv(dev);
spin_lock(&priv->lock);
- priv->hw->mac->set_filter(dev, priv->synopsys_id);
+ priv->hw->mac->set_filter(priv->hw, dev);
spin_unlock(&priv->lock);
}
@@ -2334,8 +2333,7 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id)
/* To handle GMAC own interrupts */
if (priv->plat->has_gmac) {
- int status = priv->hw->mac->host_irq_status((void __iomem *)
- dev->base_addr,
+ int status = priv->hw->mac->host_irq_status(priv->hw,
&priv->xstats);
if (unlikely(status)) {
/* For LPI we need to save the tx status */
@@ -2619,7 +2617,9 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
/* Identify the MAC HW device */
if (priv->plat->has_gmac) {
priv->dev->priv_flags |= IFF_UNICAST_FLT;
- mac = dwmac1000_setup(priv->ioaddr);
+ mac = dwmac1000_setup(priv->ioaddr,
+ priv->plat->multicast_filter_bins,
+ priv->plat->unicast_filter_entries);
} else {
mac = dwmac100_setup(priv->ioaddr);
}
@@ -2668,7 +2668,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
/* To use alternate (extended) or normal descriptor structures */
stmmac_selec_desc_mode(priv);
- ret = priv->hw->mac->rx_ipc(priv->ioaddr);
+ ret = priv->hw->mac->rx_ipc(priv->hw);
if (!ret) {
pr_warn(" RX IPC Checksum Offload not configured.\n");
priv->plat->rx_coe = STMMAC_RX_COE_NONE;
@@ -2888,7 +2888,7 @@ int stmmac_suspend(struct net_device *ndev)
/* Enable Power down mode by programming the PMT regs */
if (device_may_wakeup(priv->device)) {
- priv->hw->mac->pmt(priv->ioaddr, priv->wolopts);
+ priv->hw->mac->pmt(priv->hw, priv->wolopts);
priv->irq_wake = 1;
} else {
stmmac_set_mac(priv->ioaddr, false);
@@ -2917,7 +2917,7 @@ int stmmac_resume(struct net_device *ndev)
* from another devices (e.g. serial console).
*/
if (device_may_wakeup(priv->device)) {
- priv->hw->mac->pmt(priv->ioaddr, 0);
+ priv->hw->mac->pmt(priv->hw, 0);
priv->irq_wake = 0;
} else {
pinctrl_pm_select_default_state(priv->device);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 5884a7d..4502cde 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -43,6 +43,42 @@ static const struct of_device_id stmmac_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, stmmac_dt_ids);
+
+static int stmmac_validate_mcast_bins(int mcast_bins)
+{
+ int x = mcast_bins;
+ switch (x) {
+ case 0:
+ case HASH_TABLE_SIZE:
+ case 128:
+ case 256:
+ break;
+ default:
+ x = HASH_TABLE_SIZE;
+ pr_info("Hash table entries set to unexpected value %d",
+ mcast_bins);
+ break;
+ }
+ return x;
+}
+
+static int stmmac_validate_ucast_entries(int ucast_entries)
+{
+ int x = ucast_entries;
+ switch (x) {
+ case 32:
+ case 64:
+ case 128:
+ break;
+ default:
+ x = 32;
+ pr_info("Unicast table entries set to unexpected value %d\n",
+ ucast_entries);
+ break;
+ }
+ return x;
+}
+
#ifdef CONFIG_OF
static int stmmac_probe_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat,
@@ -107,6 +143,13 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
*/
plat->maxmtu = JUMBO_LEN;
+ /* Set default value for multicast hash bins */
+ plat->multicast_filter_bins = HASH_TABLE_SIZE;
+
+ /* Set default value for unicast filter entries */
+ plat->unicast_filter_entries = GMAC_MAX_PERFECT_ADDRESSES;
+
+
/*
* Currently only the properties needed on SPEAr600
* are provided. All other properties should be added
@@ -123,6 +166,14 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
* are clearly MTUs
*/
of_property_read_u32(np, "max-frame-size", &plat->maxmtu);
+ of_property_read_u32(np, "snps,multicast-filter-bins",
+ &plat->multicast_filter_bins);
+ of_property_read_u32(np, "snps,perfect-filter-entries",
+ &plat->unicast_filter_entries);
+ plat->unicast_filter_entries = stmmac_validate_ucast_entries(
+ plat->unicast_filter_entries);
+ plat->multicast_filter_bins = stmmac_validate_mcast_bins(
+ plat->multicast_filter_bins);
plat->has_gmac = 1;
plat->pmt = 1;
}
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 6f27d4f..cd63851 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -112,6 +112,8 @@ struct plat_stmmacenet_data {
int riwt_off;
int max_speed;
int maxmtu;
+ int multicast_filter_bins;
+ int unicast_filter_entries;
void (*fix_mac_speed)(void *priv, unsigned int speed);
void (*bus_setup)(void __iomem *ioaddr);
void *(*setup)(struct platform_device *pdev);
--
1.7.9.5
^ permalink raw reply related
* [PATCH net-next 0/2] stmmac: Add extended multicast filtering for
From: Vince Bridgers @ 2014-01-31 20:15 UTC (permalink / raw)
To: devicetree, netdev
Cc: peppe.cavallaro, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, dinguyen, rayagond, vbridgers2013
These patches add and correct multicast address filtering for the Altera
Cyclone 5 SOC, and configuration parameters for multicast and perfect
filtering capabilities of a particular Synopsys EMAC.
Filtering has been put through regression testing for the Altera C5 SOC,
but not for other implementations. This implementation extends the filter
programming by examining the device characteristics and using either the
current set_multicast function or the new extended function that supports
all possible multicast filter configurations for the Synopsys EMAC. Review
comments are welcome.
Thanks
Vince Bridgers (2):
dts: Add bindings for multicast hash bins and perfect filter entries
stmmac: add extended set multicast filter & devicetree options
Documentation/devicetree/bindings/net/stmmac.txt | 6 +
drivers/net/ethernet/stmicro/stmmac/common.h | 42 +++--
drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 5 +-
.../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 161 +++++++++++++++++---
.../net/ethernet/stmicro/stmmac/dwmac100_core.c | 29 ++--
.../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 36 ++---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 51 +++++++
include/linux/stmmac.h | 2 +
9 files changed, 267 insertions(+), 71 deletions(-)
--
1.7.9.5
^ permalink raw reply
* Re: BUG ip_dst_cache (Not tainted): Poison overwritten
From: Eric Dumazet @ 2014-01-31 20:57 UTC (permalink / raw)
To: Tommi Rantala; +Cc: netdev, Dave Jones, trinity, LKML
In-Reply-To: <CA+ydwtrWCgi=v7v=8yjNMV37Aa4ua9zbqYM5_uUdQrLSQt+VEw@mail.gmail.com>
On Fri, 2014-01-31 at 22:11 +0200, Tommi Rantala wrote:
> Hello,
>
> Hit this while fuzzing v3.13-9218-g0e47c96 with trinity in a qemu
> virtual machine.
>
> Tommi
Hi Tommi
Could you please try the following fix ?
I'll send an official patch in a couple of hours
There are two bugs :
One dst leak, and one plain bug, as rt initial NULL
value might be scratched.
net/ipv4/ip_tunnel.c | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index bd28f386bd02..bc6acdcb7625 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -101,27 +101,21 @@ static void tunnel_dst_reset_all(struct ip_tunnel *t)
__tunnel_dst_set(per_cpu_ptr(t->dst_cache, i), NULL);
}
-static struct dst_entry *tunnel_dst_get(struct ip_tunnel *t)
+static struct dst_entry *tunnel_dst_check(struct ip_tunnel *t, u32 cookie)
{
struct dst_entry *dst;
rcu_read_lock();
dst = rcu_dereference(this_cpu_ptr(t->dst_cache)->dst);
- if (dst)
+ if (dst) {
+ if (dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
+ rcu_read_unlock();
+ tunnel_dst_reset(t);
+ return NULL;
+ }
dst_hold(dst);
- rcu_read_unlock();
- return dst;
-}
-
-static struct dst_entry *tunnel_dst_check(struct ip_tunnel *t, u32 cookie)
-{
- struct dst_entry *dst = tunnel_dst_get(t);
-
- if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
- tunnel_dst_reset(t);
- return NULL;
}
-
+ rcu_read_unlock();
return dst;
}
@@ -584,7 +578,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
struct flowi4 fl4;
u8 tos, ttl;
__be16 df;
- struct rtable *rt = NULL; /* Route to the other host */
+ struct rtable *rt; /* Route to the other host */
unsigned int max_headroom; /* The extra header space needed */
__be32 dst;
int err;
@@ -657,8 +651,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
init_tunnel_flow(&fl4, protocol, dst, tnl_params->saddr,
tunnel->parms.o_key, RT_TOS(tos), tunnel->parms.link);
- if (connected)
- rt = (struct rtable *)tunnel_dst_check(tunnel, 0);
+ rt = (connected) ? (struct rtable *)tunnel_dst_check(tunnel, 0) : NULL;
if (!rt) {
rt = ip_route_output_key(tunnel->net, &fl4);
^ permalink raw reply related
* Re: kmem_cache_alloc panic in 3.10+
From: David Rientjes @ 2014-01-31 21:19 UTC (permalink / raw)
To: dormando
Cc: Alexei Starovoitov, Eric Dumazet, netdev,
linux-kernel@vger.kernel.org, Alexei Starovoitov
In-Reply-To: <alpine.DEB.2.10.1401301951060.5516@dinf>
On Thu, 30 Jan 2014, dormando wrote:
> > > I really wonder... it looks like a possible in SLUB. (might be already
> > > fixed)
> > >
> > > Could you try using SLAB instead ?
> >
> > try config_slub_debug_on=y ? it should catch double free and other things.
> >
>
> Any slowdowns/issues with that?
CONFIG_SLUB_DEBUG_ON will definitely be slower but can help to identify
any possible corruption issues.
I'm wondering if you have CONFIG_MEMCG enabled and are actually allocating
slab in a non-root memcg? What does /proc/self/cgroup say?
^ permalink raw reply
* Re: [PATCH 01/34] bnx2: Use pci_enable_msix_range()
From: David Miller @ 2014-01-31 21:30 UTC (permalink / raw)
To: agordeev; +Cc: linux-kernel, mchan, netdev, linux-pci
In-Reply-To: <434a34e01c353441131204edef36126a95e8928a.1391172839.git.agordeev@redhat.com>
Please submit this patch series when the net-next tree opens back up,
I'm only accepting bug fixes at this time.
Also, please always provide a proper "00/NN" openning posting for a
patch series, that gives background and high level information about
what your patch series is trying to achieve and how it achieves it.
That way people reviewing the patches know what to expect, and why,
and I have exactly one posting to reply to if I apply the whole
series.
Thank you.
^ permalink raw reply
* [PATCH v2 1/2] dt: Document a compatible entry for MDIO ethernet Phys
From: Jason Gunthorpe @ 2014-01-31 21:50 UTC (permalink / raw)
To: Rob Herring
Cc: Grant Likely, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA
This describes a compatible entry of the form:
ethernet-phy-idAAAA,BBBB
Which is modelled after the PCI structured compatible entry
(pciVVVV,DDDD.SSSS.ssss.RR)
If present the OF core will be able to use this information to
directly create the correct phy without auto probing the bus.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
Documentation/devicetree/bindings/net/phy.txt | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
diff --git a/Documentation/devicetree/bindings/net/phy.txt b/Documentation/devicetree/bindings/net/phy.txt
index 7cd18fb..989122c 100644
--- a/Documentation/devicetree/bindings/net/phy.txt
+++ b/Documentation/devicetree/bindings/net/phy.txt
@@ -23,10 +23,18 @@ Optional Properties:
assume clause 22. The compatible list may also contain other
elements.
+ If the phy's identifier is known then the list may contain an entry
+ of the form: "ethernet-phy-idAAAA.BBBB" where
+ AAAA - The value of the 16 bit Phy Identifier 1 register as
+ 4 hex digits. This is the chip vendor OUI bits 3:18
+ BBBB - The value of the 16 bit Phy Identifier 2 register as
+ 4 hex digits. This is the chip vendor OUI bits 19:24,
+ followed by 10 bits of a vendor specific ID.
+
Example:
ethernet-phy@0 {
- compatible = "ethernet-phy-ieee802.3-c22";
+ compatible = "ethernet-phy-id0141.0e90", "ethernet-phy-ieee802.3-c22";
linux,phandle = <2452000>;
interrupt-parent = <40000>;
interrupts = <35 1>;
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ 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