* Re: [PATCH] net: update the usage of CHECKSUM_UNNECESSARY
From: Ben Hutchings @ 2012-05-10 0:05 UTC (permalink / raw)
To: Michael S. Tsirkin, David Miller; +Cc: Yi Zou, netdev, devel, jeffrey.t.kirsher
In-Reply-To: <20120509060308.GA13522@redhat.com>
On Wed, 2012-05-09 at 09:03 +0300, Michael S. Tsirkin wrote:
> On Tue, May 08, 2012 at 07:20:58PM +0100, Ben Hutchings wrote:
> > On Tue, 2012-05-08 at 20:48 +0300, Michael S. Tsirkin wrote:
> > > On Mon, Mar 19, 2012 at 02:12:41PM -0700, Yi Zou wrote:
> > > > As suggested by Ben, this adds the clarification on the usage of
> > > > CHECKSUM_UNNECESSARY on the outgoing patch. Also add the usage
> > > > description of NETIF_F_FCOE_CRC and CHECKSUM_UNNECESSARY
> > > > for the kernel FCoE protocol driver.
> > > >
> > > > This is a follow-up to the following:
> > > > http://patchwork.ozlabs.org/patch/147315/
> > > >
> > > > Signed-off-by: Yi Zou <yi.zou@intel.com>
> > > > Cc: Ben Hutchings <bhutchings@solarflare.com>
> > > > Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > > > Cc: www.Open-FCoE.org <devel@open-fcoe.org>
> > > > ---
> > > >
> > > > include/linux/skbuff.h | 7 +++++++
> > > > 1 files changed, 7 insertions(+), 0 deletions(-)
> > > >
> > > > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> > > > index 8dc8257..a2b9953 100644
> > > > --- a/include/linux/skbuff.h
> > > > +++ b/include/linux/skbuff.h
> > > > @@ -94,6 +94,13 @@
> > > > * about CHECKSUM_UNNECESSARY. 8)
> > > > * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
> > > > *
> > > > + * UNNECESSARY: device will do per protocol specific csum. Protocol drivers
> > > > + * that do not want net to perform the checksum calculation should use
> > > > + * this flag in their outgoing skbs.
> > > > + * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC
> > > > + * offload. Correspondingly, the FCoE protocol driver
> > > > + * stack should use CHECKSUM_UNNECESSARY.
> > > > + *
> > > > * Any questions? No questions, good. --ANK
> > > > */
> > > >
> > >
> > > So just to make sure I understand, you never get
> > > UNNECESSARY packets on tx unless you declared NETIF_F_FCOE_CRC?
> > >
> > > Maybe the comment says this somehow but could not figure it out.
> >
> > That's what should happen now. In future CHECKSUM_UNNECESSARY could be
> > used on output by other protocols which don't use TCP/IP-style
> > checksums, but always dependent on the output device supporting the
> > relevant offload feature.
> >
> > Ben.
>
> Isn't there another case: a device passes UNNECESSARY in on rx,
> and the skb is forwarded to another device?
> For example it is handled this way by tun, giving a nice
> performance boost for VMs, see 10a8d94a95742bb15b4e617ee9884bb4381362be
Hmm... I thought UNNECESSARY was supposed to be replaced by NONE on
output, but I don't see where that would happen. Which would mean we
had an undocumented case here, and now we have ambiguity. :-(
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH] ehea: fix losing of NEQ events when one event occurred early
From: Thadeu Lima de Souza Cascardo @ 2012-05-10 0:10 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Thadeu Lima de Souza Cascardo
The NEQ interrupt is only triggered when there was no previous pending
interrupt. If we request irq handling after an interrupt has occurred,
we will never get an interrupt until we call H_RESET_EVENTS.
Events seem to be cleared when we first register the NEQ. So, when we
requested irq handling right after registering it, a possible race with
an interrupt was much less likely. Now, there is a chance we may lose
this race and never get any events.
The fix here is to poll and acknowledge any events that might have
happened right after registering the irq handler.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index c9069a2..f088e59 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -3335,6 +3335,9 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
goto out_shutdown_ports;
}
+ /* Handle any events that might be pending. */
+ tasklet_hi_schedule(&adapter->neq_tasklet);
+
ret = 0;
goto out;
--
1.7.4.4
^ permalink raw reply related
* Re: [NET_NEXT RFC PATCH 3/3] ixgbe: added reg_ops file to debugfs
From: Ben Hutchings @ 2012-05-10 0:18 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Catherine Sullivan, netdev
In-Reply-To: <20120509161449.43704ea7@nehalam.linuxnetplumber.net>
On Wed, 2012-05-09 at 16:14 -0700, Stephen Hemminger wrote:
> On Wed, 09 May 2012 16:09:50 -0700
> Catherine Sullivan <catherine.sullivan@intel.com> wrote:
>
> > Added the reg_ops file to debugfs with commands to read and write
> > a register to give users the ability to read and write individual
> > registers on the fly.
> >
> > Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
> > ---
> >
> > drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 112 ++++++++++++++++++++++
> > 1 files changed, 112 insertions(+), 0 deletions(-)
> >
>
> Aren't these registers already in ethtool?
ethtool register access is read-only and would be very heavy-weight for
interactive debugging. Not sure this is the best interface to
read/write registers, but it's certainly not redundant.
> You are also allowing write without any security checking.
The file permissions are set to 0600 so it's root-only.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] netlink: connector: implement cn_netlink_reply
From: Ben Hutchings @ 2012-05-10 0:20 UTC (permalink / raw)
To: Alban Crequy
Cc: Evgeniy Polyakov, netdev, Vincent Sanders,
Javier Martinez Canillas, Rodrigo Moya
In-Reply-To: <1336574243-12063-1-git-send-email-alban.crequy@collabora.co.uk>
On Wed, 2012-05-09 at 15:37 +0100, Alban Crequy wrote:
> In a connector callback, it was not possible to reply to a message only to a
> sender. This patch implements cn_netlink_reply(). It uses the connector socket
> to send an unicast netlink message back to the sender.
[...]
We try to avoid adding functions with no users. You'll need to submit
the code that's intended to use this as well.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] ehea: fix losing of NEQ events when one event occurred early
From: David Miller @ 2012-05-10 0:29 UTC (permalink / raw)
To: cascardo; +Cc: netdev
In-Reply-To: <1336608618-31497-1-git-send-email-cascardo@linux.vnet.ibm.com>
From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Date: Wed, 9 May 2012 21:10:18 -0300
> + /* Handle any events that might be pending. */
> + tasklet_hi_schedule(&adapter->neq_tasklet);
> +
>
> ret = 0;
These extra empty lines are completely unnecessary, please remove
them.
^ permalink raw reply
* Re: [PATCH 08/14] batman-adv: ignore protocol packets if the interface did not enable this protocol
From: David Miller @ 2012-05-10 0:41 UTC (permalink / raw)
To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
lindner_marek-LWAfsSFWpa4
In-Reply-To: <1336561976-16088-9-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Wed, 9 May 2012 13:12:50 +0200
> + /* did we receive a B.A.T.M.A.N. IV OGM packet on an interface
> + * that does not have B.A.T.M.A.N. IV enabled ? */
Needs to be:
/* did we receive a B.A.T.M.A.N. IV OGM packet on an interface
* that does not have B.A.T.M.A.N. IV enabled ?
*/
^ permalink raw reply
* Re: [PATCH 11/14] batman-adv: Adding hard_iface specific sysfs wrapper macros for UINT
From: David Miller @ 2012-05-10 0:43 UTC (permalink / raw)
To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
lindner_marek-LWAfsSFWpa4
In-Reply-To: <1336561976-16088-12-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Wed, 9 May 2012 13:12:53 +0200
> + /**
> + * Mark the forwarded packet when it is not coming from our best
> + * next hop. We still need to forward the packet for our neighbor
> + * link quality detection to work in case the packet originated
> + * from a single hop neighbor. Otherwise we can simply drop the
> + * ogm.
> + */
Start comments with "/*" not "/**", and properly indent these lines.
^ permalink raw reply
* Re: [PATCH 09/14] batman-adv: refactoring API: find generalized name for bat_ogm_update_mac callback
From: David Miller @ 2012-05-10 0:42 UTC (permalink / raw)
To: ordex; +Cc: netdev, b.a.t.m.a.n, lindner_marek
In-Reply-To: <1336561976-16088-10-git-send-email-ordex@autistici.org>
From: Antonio Quartulli <ordex@autistici.org>
Date: Wed, 9 May 2012 13:12:51 +0200
> + /* (re-)init mac addresses of the protocol information
> + * belonging to this hard-interface */
Needs to be:
/* (re-)init mac addresses of the protocol information
* belonging to this hard-interface
*/
^ permalink raw reply
* Re: [PATCH 07/14] batman-adv: split neigh_new function into generic and batman iv specific parts
From: David Miller @ 2012-05-10 0:41 UTC (permalink / raw)
To: ordex; +Cc: netdev, b.a.t.m.a.n, lindner_marek
In-Reply-To: <1336561976-16088-8-git-send-email-ordex@autistici.org>
From: Antonio Quartulli <ordex@autistici.org>
Date: Wed, 9 May 2012 13:12:49 +0200
> From: Marek Lindner <lindner_marek@yahoo.de>
>
> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
The namespace pollution of the batman-adv code needs to improve,
and I'm putting my foot down starting with this change.
If you have a static function which is therefore private to a
source file, name it whatever you want.
But once it gets exported out of that file, you have to give it
an appropriate name. Probably with a "batman_adv_" prefix or
similar.
Otherwise, for one thing, if this code is statically built into
the tree it can conflict with symbol names elsewhere and break
the build.
^ permalink raw reply
* Re: [PATCH] netlink: connector: implement cn_netlink_reply
From: Evgeniy Polyakov @ 2012-05-10 0:45 UTC (permalink / raw)
To: Ben Hutchings
Cc: Alban Crequy, netdev, Vincent Sanders, Javier Martinez Canillas,
Rodrigo Moya
In-Reply-To: <1336609248.2499.20.camel@bwh-desktop.uk.solarflarecom.com>
On Thu, May 10, 2012 at 01:20:48AM +0100, Ben Hutchings (bhutchings@solarflare.com) wrote:
> On Wed, 2012-05-09 at 15:37 +0100, Alban Crequy wrote:
> > In a connector callback, it was not possible to reply to a message only to a
> > sender. This patch implements cn_netlink_reply(). It uses the connector socket
> > to send an unicast netlink message back to the sender.
> [...]
>
> We try to avoid adding functions with no users. You'll need to submit
> the code that's intended to use this as well.
I have no objection against this patch, but as correctly stated it is
useless without users. Alban, what is the code you want this
functionality to be used in? Do you plan to submit it? Can you submit
this change in the patch with your code?
--
Evgeniy Polyakov
^ permalink raw reply
* FW: PROBLEM: VLAN LRO issue
From: Steven Liu (劉人豪) @ 2012-05-10 1:01 UTC (permalink / raw)
To: netdev@vger.kernel.org
Hi Sir,
I found the issue about VLAN LRO feature and below is bug description and patch for your reference, thanks.
[1.] One line summary of the problem:
VLAN LRO issue
[2.] Full description of the problem/report:
LRO implementation cannot handle VLAN tagged packets correctly.
It uses correct packet length when creating new LRO session, but uses wrong packet length when putting following packets into exist LRO session.
[3.] Keywords (i.e., modules, networking, kernel):
Networking
[4.] Kernel version (from /proc/version):
Linux-3.4-rc3 and below
[5.] Output of Oops.. message (if applicable) with symbolic information
resolved (see Documentation/oops-tracing.txt) System is still working, but cannot speed up VLAN tagged traffic.
[X.] Other notes, patches, fixes, workarounds:
We have to apply below patch to fix this issue.
--- linux-3.4-rc3/net/ipv4/inet_lro.orig 2012-05-08 20:09:44.810366089 +0800
+++ linux-3.4-rc3/net/ipv4/inet_lro.c 2012-05-08 20:09:33.331679419 +0800
@@ -353,7 +353,7 @@ static int __lro_proc_skb(struct net_lro
if (lro_desc->tcp_next_seq != ntohl(tcph->seq))
goto out2;
- if (lro_tcp_ip_check(iph, tcph, skb->len, lro_desc))
+ if (lro_tcp_ip_check(iph, tcph, skb->len - vlan_hdr_len, lro_desc))
goto out2;
lro_add_packet(lro_desc, skb, iph, tcph);
Regards,
Steven
************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
^ permalink raw reply
* Re: [PATCH 00/13] net: Add and use ether_addr_equal
From: David Miller @ 2012-05-10 1:21 UTC (permalink / raw)
To: joe
Cc: coreteam, netdev, bridge, linux-wireless, linux-kernel,
linux-bluetooth, netfilter, netfilter-devel
In-Reply-To: <cover.1336538937.git.joe@perches.com>
From: Joe Perches <joe@perches.com>
Date: Tue, 8 May 2012 21:56:44 -0700
> Add a boolean function to test 2 ethernet addresses for equality
> Convert compare_ether_addr uses to ether_addr_equal
This series looks great, I'll apply all of it.
Thanks Joe.
That case you didn't convert in mac80211 is probably the
bug Johannes was talking about which started this whole
discussion.
^ permalink raw reply
* Re: [PATCH V3 Resend 09/12] net/stmmac: Remove conditional compilation of clk code
From: David Miller @ 2012-05-10 1:22 UTC (permalink / raw)
To: viresh.kumar
Cc: andrew, mturquette, sshtylyov, netdev, spear-devel, linux-kernel,
w.sang, viresh.linux, peppe.cavallaro, linux, akpm, jgarzik,
linux-arm-kernel, LW
In-Reply-To: <8e66b900fe5ee10c8db93d2f12c912e3dfb0708f.1336448639.git.viresh.kumar@st.com>
From: Viresh Kumar <viresh.kumar@st.com>
Date: Tue, 8 May 2012 09:22:36 +0530
> With addition of dummy clk_*() calls for non CONFIG_HAVE_CLK cases in clk.h,
> there is no need to have clk code enclosed in #ifdef CONFIG_HAVE_CLK, #endif
> macros.
>
> This also fixes error paths of probe(), as a goto is required in this patch.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH v4 2/2] macvtap: restore vlan header on user read
From: David Miller @ 2012-05-10 1:24 UTC (permalink / raw)
To: mst; +Cc: basil.gor, ebiederm, netdev
In-Reply-To: <20120508192806.GB28536@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Tue, 8 May 2012 22:28:06 +0300
> On Fri, May 04, 2012 at 12:55:24PM +0400, Basil Gor wrote:
>> Ethernet vlan header is not on the packet and kept in the skb->vlan_tci
>> when it comes from lower dev. This patch inserts vlan header in user
>> buffer during skb copy on user read.
>>
>> Signed-off-by: Basil Gor <basil.gor@gmail.com>
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> Eric, ack?
Eric please review these two patches.
^ permalink raw reply
* Re: FW: PROBLEM: VLAN LRO issue
From: Eric Dumazet @ 2012-05-10 1:25 UTC (permalink / raw)
To: Steven Liu (劉人豪); +Cc: netdev@vger.kernel.org
In-Reply-To: <599E416D1C5C994980C45977191D726906AB2FE86E@MTKMBS03.mediatek.inc>
On Thu, 2012-05-10 at 09:01 +0800, Steven Liu (劉人豪) wrote:
> Hi Sir,
>
> I found the issue about VLAN LRO feature and below is bug description and patch for your reference, thanks.
>
> [1.] One line summary of the problem:
> VLAN LRO issue
>
> [2.] Full description of the problem/report:
> LRO implementation cannot handle VLAN tagged packets correctly.
> It uses correct packet length when creating new LRO session, but uses wrong packet length when putting following packets into exist LRO session.
>
> [3.] Keywords (i.e., modules, networking, kernel):
> Networking
>
> [4.] Kernel version (from /proc/version):
> Linux-3.4-rc3 and below
>
> [5.] Output of Oops.. message (if applicable) with symbolic information
> resolved (see Documentation/oops-tracing.txt) System is still working, but cannot speed up VLAN tagged traffic.
>
> [X.] Other notes, patches, fixes, workarounds:
> We have to apply below patch to fix this issue.
>
> --- linux-3.4-rc3/net/ipv4/inet_lro.orig 2012-05-08 20:09:44.810366089 +0800
> +++ linux-3.4-rc3/net/ipv4/inet_lro.c 2012-05-08 20:09:33.331679419 +0800
> @@ -353,7 +353,7 @@ static int __lro_proc_skb(struct net_lro
> if (lro_desc->tcp_next_seq != ntohl(tcph->seq))
> goto out2;
>
> - if (lro_tcp_ip_check(iph, tcph, skb->len, lro_desc))
> + if (lro_tcp_ip_check(iph, tcph, skb->len - vlan_hdr_len, lro_desc))
> goto out2;
>
> lro_add_packet(lro_desc, skb, iph, tcph);
>
Hi
This looks like a good fix, could you please submit an official patch ?
Documentation/SubmittingPatches
^ permalink raw reply
* Re: [PATCH 00/13] net: Add and use ether_addr_equal
From: Joe Perches @ 2012-05-10 1:48 UTC (permalink / raw)
To: David Miller, Julia Lawall
Cc: coreteam, netdev, bridge, linux-wireless, linux-kernel,
linux-bluetooth, netfilter, netfilter-devel
In-Reply-To: <20120509.212110.437114897180819434.davem@davemloft.net>
On Wed, 2012-05-09 at 21:21 -0400, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Tue, 8 May 2012 21:56:44 -0700
>
> > Add a boolean function to test 2 ethernet addresses for equality
> > Convert compare_ether_addr uses to ether_addr_equal
>
> This series looks great, I'll apply all of it.
coccinelle is a nifty, better sed, tool. Thanks Julia et al.
> That case you didn't convert in mac80211 is probably the
> bug Johannes was talking about which started this whole
> discussion.
Looks like it.
Do you want a similar patch/patches for drivers/net?
If I break it out by nominal driver/maintainer,
it'll be a highish number of low density patches.
$ git grep -w compare_ether_addr drivers/net | wc -l
59
$ git grep -w -l compare_ether_addr drivers/net | wc -l
31
Maybe just a single patch?
Also the compare_ether_addr_64bits function is
still used a couple dozen times. Maybe another
patch for those? ether_addr_equal_64bits?
^ permalink raw reply
* Re: [PATCH 00/13] net: Add and use ether_addr_equal
From: David Miller @ 2012-05-10 1:53 UTC (permalink / raw)
To: joe
Cc: coreteam, linux-bluetooth, netdev, bridge, linux-wireless,
linux-kernel, julia.lawall, netfilter, netfilter-devel
In-Reply-To: <1336614484.1905.19.camel@joe2Laptop>
From: Joe Perches <joe@perches.com>
Date: Wed, 09 May 2012 18:48:04 -0700
> Maybe just a single patch?
Yes, I think high density on this one, it's extremely
mechanical.
> Also the compare_ether_addr_64bits function is
> still used a couple dozen times. Maybe another
> patch for those? ether_addr_equal_64bits?
Use your best judgment.
^ permalink raw reply
* pull request: sfc 2012-05-09
From: Ben Hutchings @ 2012-05-10 2:06 UTC (permalink / raw)
To: David Miller; +Cc: linux-net-drivers, netdev
The following changes since commit 477206a018f902895bfcd069dd820bfe94c187b1:
r8169: fix unsigned int wraparound with TSO (2012-05-08 19:34:10 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc.git sfc-3.4
(commit 3132d2827d92c2ee47fdf4dbec75bba0a2f291cb)
This fixes a regression introduced since Linux 3.3 which will result in
a crash on load in certain configurations.
Ben.
Ben Hutchings (1):
sfc: Fix division by zero when using one RX channel and no SR-IOV
drivers/net/ethernet/sfc/efx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH net] sfc: Fix division by zero when using one RX channel and no SR-IOV
From: Ben Hutchings @ 2012-05-10 2:08 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1336615595.2499.24.camel@bwh-desktop.uk.solarflarecom.com>
If RSS is disabled on the PF (efx->n_rx_channels == 1) we try to set
up the indirection table so that VFs can use it, setting
efx->rss_spread = efx_vf_size(efx). But if SR-IOV was disabled at
compile time, this evaluates to 0 and we end up dividing by zero when
initialising the table.
I considered changing the fallback definition of efx_vf_size() to
return 1, but its value is really meaningless if we are not going to
enable VFs. Therefore add a condition of efx_sriov_wanted(efx) in
efx_probe_interrupts().
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/sfc/efx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 3cbfbff..4a00053 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1349,7 +1349,7 @@ static int efx_probe_interrupts(struct efx_nic *efx)
}
/* RSS might be usable on VFs even if it is disabled on the PF */
- efx->rss_spread = (efx->n_rx_channels > 1 ?
+ efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ?
efx->n_rx_channels : efx_vf_size(efx));
return 0;
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* pull request: sfc-next 2012-05-09
From: Ben Hutchings @ 2012-05-10 2:26 UTC (permalink / raw)
To: David Miller; +Cc: linux-net-drivers, netdev
[-- Attachment #1: Type: text/plain, Size: 1997 bytes --]
The following changes since commit 2e7d21c54adbab6d10481eddc685328f89bb6389:
e1000e: Fix merge conflict (net->net-next) (2012-05-09 12:06:39 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next.git for-davem
(commit ba62b2a8608ca52234fc8bea27bfebbdc4f98c2e)
1. A fix for recovery from some hardware failure modes, by Stuart Hodgson.
2. Reduction of RX jitter, by David Riddoch.
3. ethtool interface and implementation for reading plug-in modules, mostly by
Stuart Hodgson.
4. A minor fix to PCI device cleanup.
Ben.
Ben Hutchings (3):
sfc: Fix missing cleanup in failure path of efx_pci_probe()
ethtool: Split ethtool_get_eeprom() to allow for additional EEPROM accessors
sfc: Implement module EEPROM access for SFE4002 and SFN4112F
David Riddoch (2):
sfc: Fill RX rings completely full, rather than to 95% full
sfc: By default refill RX rings as soon as space for a batch
Stuart Hodgson (3):
sfc: Do not attempt to flush queues if DMA is disabled
ethtool: Extend the ethtool API to obtain plugin module eeprom data
sfc: Added support for new ethtool APIs for obtaining module eeprom
drivers/net/ethernet/sfc/efx.c | 36 +++++++++------
drivers/net/ethernet/sfc/ethtool.c | 35 +++++++++++++++
drivers/net/ethernet/sfc/mcdi_phy.c | 76 +++++++++++++++++++++++++++++++++
drivers/net/ethernet/sfc/net_driver.h | 8 ++-
drivers/net/ethernet/sfc/qt202x_phy.c | 33 ++++++++++++++
drivers/net/ethernet/sfc/rx.c | 31 ++++++-------
include/linux/ethtool.h | 33 ++++++++++++++
net/core/ethtool.c | 71 +++++++++++++++++++++++++++---
8 files changed, 282 insertions(+), 41 deletions(-)
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* [PATCH net-next 1/8] sfc: Do not attempt to flush queues if DMA is disabled
From: Ben Hutchings @ 2012-05-10 2:27 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1336616799.2499.32.camel@bwh-desktop.uk.solarflarecom.com>
efx_nic_fatal_interrupt() disables DMA before scheduling a reset.
After this, we need not and *cannot* flush queues.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/sfc/efx.c | 33 +++++++++++++++++++--------------
1 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 3cbfbff..5cc58a3 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -656,25 +656,30 @@ static void efx_stop_datapath(struct efx_nic *efx)
struct efx_channel *channel;
struct efx_tx_queue *tx_queue;
struct efx_rx_queue *rx_queue;
+ struct pci_dev *dev = efx->pci_dev;
int rc;
EFX_ASSERT_RESET_SERIALISED(efx);
BUG_ON(efx->port_enabled);
- rc = efx_nic_flush_queues(efx);
- if (rc && EFX_WORKAROUND_7803(efx)) {
- /* Schedule a reset to recover from the flush failure. The
- * descriptor caches reference memory we're about to free,
- * but falcon_reconfigure_mac_wrapper() won't reconnect
- * the MACs because of the pending reset. */
- netif_err(efx, drv, efx->net_dev,
- "Resetting to recover from flush failure\n");
- efx_schedule_reset(efx, RESET_TYPE_ALL);
- } else if (rc) {
- netif_err(efx, drv, efx->net_dev, "failed to flush queues\n");
- } else {
- netif_dbg(efx, drv, efx->net_dev,
- "successfully flushed all queues\n");
+ /* Only perform flush if dma is enabled */
+ if (dev->is_busmaster) {
+ rc = efx_nic_flush_queues(efx);
+
+ if (rc && EFX_WORKAROUND_7803(efx)) {
+ /* Schedule a reset to recover from the flush failure. The
+ * descriptor caches reference memory we're about to free,
+ * but falcon_reconfigure_mac_wrapper() won't reconnect
+ * the MACs because of the pending reset. */
+ netif_err(efx, drv, efx->net_dev,
+ "Resetting to recover from flush failure\n");
+ efx_schedule_reset(efx, RESET_TYPE_ALL);
+ } else if (rc) {
+ netif_err(efx, drv, efx->net_dev, "failed to flush queues\n");
+ } else {
+ netif_dbg(efx, drv, efx->net_dev,
+ "successfully flushed all queues\n");
+ }
}
efx_for_each_channel(channel, efx) {
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH net-next 2/8] sfc: Fix missing cleanup in failure path of efx_pci_probe()
From: Ben Hutchings @ 2012-05-10 2:28 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1336616799.2499.32.camel@bwh-desktop.uk.solarflarecom.com>
We need to clear the private data pointer in the PCI device.
Also reorder cleanup in efx_pci_remove() for symmetry.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/sfc/efx.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 5cc58a3..8253d21 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2497,8 +2497,8 @@ static void efx_pci_remove(struct pci_dev *pci_dev)
efx_fini_io(efx);
netif_dbg(efx, drv, efx->net_dev, "shutdown successful\n");
- pci_set_drvdata(pci_dev, NULL);
efx_fini_struct(efx);
+ pci_set_drvdata(pci_dev, NULL);
free_netdev(efx->net_dev);
};
@@ -2700,6 +2700,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
fail2:
efx_fini_struct(efx);
fail1:
+ pci_set_drvdata(pci_dev, NULL);
WARN_ON(rc > 0);
netif_dbg(efx, drv, efx->net_dev, "initialisation failed. rc=%d\n", rc);
free_netdev(net_dev);
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH net-next 3/8] sfc: Fill RX rings completely full, rather than to 95% full
From: Ben Hutchings @ 2012-05-10 2:28 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1336616799.2499.32.camel@bwh-desktop.uk.solarflarecom.com>
From: David Riddoch <driddoch@solarflare.com>
There was no runtime control of the fast_fill_limit in any case, so purged
that field.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/sfc/net_driver.h | 3 ---
drivers/net/ethernet/sfc/rx.c | 15 ++++-----------
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index f0385e1..eaca447 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -252,8 +252,6 @@ struct efx_rx_page_state {
* @max_fill: RX descriptor maximum fill level (<= ring size)
* @fast_fill_trigger: RX descriptor fill level that will trigger a fast fill
* (<= @max_fill)
- * @fast_fill_limit: The level to which a fast fill will fill
- * (@fast_fill_trigger <= @fast_fill_limit <= @max_fill)
* @min_fill: RX descriptor minimum non-zero fill level.
* This records the minimum fill level observed when a ring
* refill was triggered.
@@ -274,7 +272,6 @@ struct efx_rx_queue {
int removed_count;
unsigned int max_fill;
unsigned int fast_fill_trigger;
- unsigned int fast_fill_limit;
unsigned int min_fill;
unsigned int min_overfill;
unsigned int alloc_page_count;
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 763fa2f..254fec8 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -78,11 +78,6 @@ static int rx_alloc_method = RX_ALLOC_METHOD_AUTO;
*/
static unsigned int rx_refill_threshold = 90;
-/* This is the percentage fill level to which an RX queue will be refilled
- * when the "RX refill threshold" is reached.
- */
-static unsigned int rx_refill_limit = 95;
-
/*
* RX maximum head room required.
*
@@ -342,7 +337,7 @@ static void efx_recycle_rx_buffer(struct efx_channel *channel,
* efx_fast_push_rx_descriptors - push new RX descriptors quickly
* @rx_queue: RX descriptor queue
* This will aim to fill the RX descriptor queue up to
- * @rx_queue->@fast_fill_limit. If there is insufficient atomic
+ * @rx_queue->@max_fill. If there is insufficient atomic
* memory to do so, a slow fill will be scheduled.
*
* The caller must provide serialisation (none is used here). In practise,
@@ -367,7 +362,7 @@ void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue)
rx_queue->min_fill = fill_level;
}
- space = rx_queue->fast_fill_limit - fill_level;
+ space = rx_queue->max_fill - fill_level;
if (space < EFX_RX_BATCH)
goto out;
@@ -375,7 +370,7 @@ void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue)
"RX queue %d fast-filling descriptor ring from"
" level %d to level %d using %s allocation\n",
efx_rx_queue_index(rx_queue), fill_level,
- rx_queue->fast_fill_limit,
+ rx_queue->max_fill,
channel->rx_alloc_push_pages ? "page" : "skb");
do {
@@ -681,7 +676,7 @@ int efx_probe_rx_queue(struct efx_rx_queue *rx_queue)
void efx_init_rx_queue(struct efx_rx_queue *rx_queue)
{
struct efx_nic *efx = rx_queue->efx;
- unsigned int max_fill, trigger, limit;
+ unsigned int max_fill, trigger;
netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev,
"initialising RX queue %d\n", efx_rx_queue_index(rx_queue));
@@ -695,11 +690,9 @@ void efx_init_rx_queue(struct efx_rx_queue *rx_queue)
/* Initialise limit fields */
max_fill = efx->rxq_entries - EFX_RXD_HEAD_ROOM;
trigger = max_fill * min(rx_refill_threshold, 100U) / 100U;
- limit = max_fill * min(rx_refill_limit, 100U) / 100U;
rx_queue->max_fill = max_fill;
rx_queue->fast_fill_trigger = trigger;
- rx_queue->fast_fill_limit = limit;
/* Set up RX descriptor ring */
rx_queue->enabled = true;
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH net-next 4/8] sfc: By default refill RX rings as soon as space for a batch
From: Ben Hutchings @ 2012-05-10 2:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
In-Reply-To: <1336616799.2499.32.camel@bwh-desktop.uk.solarflarecom.com>
From: David Riddoch <driddoch@solarflare.com>
Previously we refilled with much larger batches, which caused large latency
spikes. We now have many more much much smaller spikes!
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/ethernet/sfc/rx.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 254fec8..243e91f 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -76,7 +76,7 @@ static int rx_alloc_method = RX_ALLOC_METHOD_AUTO;
/* This is the percentage fill level below which new RX descriptors
* will be added to the RX descriptor ring.
*/
-static unsigned int rx_refill_threshold = 90;
+static unsigned int rx_refill_threshold;
/*
* RX maximum head room required.
@@ -363,8 +363,7 @@ void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue)
}
space = rx_queue->max_fill - fill_level;
- if (space < EFX_RX_BATCH)
- goto out;
+ EFX_BUG_ON_PARANOID(space < EFX_RX_BATCH);
netif_vdbg(rx_queue->efx, rx_status, rx_queue->efx->net_dev,
"RX queue %d fast-filling descriptor ring from"
@@ -676,7 +675,7 @@ int efx_probe_rx_queue(struct efx_rx_queue *rx_queue)
void efx_init_rx_queue(struct efx_rx_queue *rx_queue)
{
struct efx_nic *efx = rx_queue->efx;
- unsigned int max_fill, trigger;
+ unsigned int max_fill, trigger, max_trigger;
netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev,
"initialising RX queue %d\n", efx_rx_queue_index(rx_queue));
@@ -689,7 +688,14 @@ void efx_init_rx_queue(struct efx_rx_queue *rx_queue)
/* Initialise limit fields */
max_fill = efx->rxq_entries - EFX_RXD_HEAD_ROOM;
- trigger = max_fill * min(rx_refill_threshold, 100U) / 100U;
+ max_trigger = max_fill - EFX_RX_BATCH;
+ if (rx_refill_threshold != 0) {
+ trigger = max_fill * min(rx_refill_threshold, 100U) / 100U;
+ if (trigger > max_trigger)
+ trigger = max_trigger;
+ } else {
+ trigger = max_trigger;
+ }
rx_queue->max_fill = max_fill;
rx_queue->fast_fill_trigger = trigger;
@@ -739,5 +745,5 @@ MODULE_PARM_DESC(rx_alloc_method, "Allocation method used for RX buffers");
module_param(rx_refill_threshold, uint, 0444);
MODULE_PARM_DESC(rx_refill_threshold,
- "RX descriptor ring fast/slow fill threshold (%)");
+ "RX descriptor ring refill threshold (%)");
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH net-next 5/8] ethtool: Split ethtool_get_eeprom() to allow for additional EEPROM accessors
From: Ben Hutchings @ 2012-05-10 2:30 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers, Yaniv Rosner
In-Reply-To: <1336616799.2499.32.camel@bwh-desktop.uk.solarflarecom.com>
We want to support reading module (SFP+, XFP, ...) EEPROMs as well as
NIC EEPROMs. They will need a different command number and driver
operation, but the structure and arguments will be the same and so we
can share most of the code here.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
net/core/ethtool.c | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index beacdd9..ca7698f 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -751,18 +751,17 @@ static int ethtool_get_link(struct net_device *dev, char __user *useraddr)
return 0;
}
-static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr)
+static int ethtool_get_any_eeprom(struct net_device *dev, void __user *useraddr,
+ int (*getter)(struct net_device *,
+ struct ethtool_eeprom *, u8 *),
+ u32 total_len)
{
struct ethtool_eeprom eeprom;
- const struct ethtool_ops *ops = dev->ethtool_ops;
void __user *userbuf = useraddr + sizeof(eeprom);
u32 bytes_remaining;
u8 *data;
int ret = 0;
- if (!ops->get_eeprom || !ops->get_eeprom_len)
- return -EOPNOTSUPP;
-
if (copy_from_user(&eeprom, useraddr, sizeof(eeprom)))
return -EFAULT;
@@ -771,7 +770,7 @@ static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr)
return -EINVAL;
/* Check for exceeding total eeprom len */
- if (eeprom.offset + eeprom.len > ops->get_eeprom_len(dev))
+ if (eeprom.offset + eeprom.len > total_len)
return -EINVAL;
data = kmalloc(PAGE_SIZE, GFP_USER);
@@ -782,7 +781,7 @@ static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr)
while (bytes_remaining > 0) {
eeprom.len = min(bytes_remaining, (u32)PAGE_SIZE);
- ret = ops->get_eeprom(dev, &eeprom, data);
+ ret = getter(dev, &eeprom, data);
if (ret)
break;
if (copy_to_user(userbuf, data, eeprom.len)) {
@@ -803,6 +802,17 @@ static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr)
return ret;
}
+static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr)
+{
+ const struct ethtool_ops *ops = dev->ethtool_ops;
+
+ if (!ops->get_eeprom || !ops->get_eeprom_len)
+ return -EOPNOTSUPP;
+
+ return ethtool_get_any_eeprom(dev, useraddr, ops->get_eeprom,
+ ops->get_eeprom_len(dev));
+}
+
static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr)
{
struct ethtool_eeprom eeprom;
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ 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