* Re: [PATCH net-next v3] ipv6: make unsolicited report intervals configurable for mld
From: David Miller @ 2013-08-14 0:09 UTC (permalink / raw)
To: hannes; +Cc: netdev, xiyou.wangcong, william.manley, bcrl, yoshfuji
In-Reply-To: <20130813230346.GA16264@order.stressinduktion.org>
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Wed, 14 Aug 2013 01:03:46 +0200
> Commit cab70040dfd95ee32144f02fade64f0cb94f31a0 ("net: igmp:
> Reduce Unsolicited report interval to 1s when using IGMPv3") and
> 2690048c01f32bf45d1c1e1ab3079bc10ad2aea7 ("net: igmp: Allow user-space
> configuration of igmp unsolicited report interval") by William Manley made
> igmp unsolicited report intervals configurable per interface and corrected
> the interval of unsolicited igmpv3 report messages resendings to 1s.
>
> Same needs to be done for IPv6:
>
> MLDv1 (RFC2710 7.10.): 10 seconds
> MLDv2 (RFC3810 9.11.): 1 second
>
> Both intervals are configurable via new procfs knobs
> mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval.
>
> (also added .force_mld_version to ipv6_devconf_dflt to bring structs in
> line without semantic changes)
>
> v2:
> a) Joined documentation update for IPv4 and IPv6 MLD/IGMP
> unsolicited_report_interval procfs knobs.
> b) incorporate stylistic feedback from William Manley
>
> v3:
> a) add new DEVCONF_* values to the end of the enum (thanks to David
> Miller)
>
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> Cc: William Manley <william.manley@youview.com>
> Cc: Benjamin LaHaise <bcrl@kvack.org>
> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ethernet/arc/arc_emac - fix NAPI "work > weight" warning
From: David Miller @ 2013-08-14 0:01 UTC (permalink / raw)
To: Alexey.Brodkin
Cc: netdev, Vineet.Gupta1, Mischa.Jonker, arnd, grant.likely,
rob.herring, paul.gortmaker, linux-kernel
In-Reply-To: <1376399076-9320-1-git-send-email-abrodkin@synopsys.com>
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Date: Tue, 13 Aug 2013 17:04:36 +0400
> Initially I improperly set a boundary for maximum number of input
> packets to process on NAPI poll ("work") so it might be more than
> expected amount ("weight").
>
> This was really harmless but seeing WARN_ON_ONCE on every device boot is
> not nice. So trivial fix ("<" instead of "<=") is here.
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net] ip_tunnel: Do not use inner ip-header-id for tunnel ip-header-id.
From: David Miller @ 2013-08-13 23:53 UTC (permalink / raw)
To: pshelar; +Cc: netdev, jrajahalme, aatteka
In-Reply-To: <1376383266-6623-1-git-send-email-pshelar@nicira.com>
From: Pravin B Shelar <pshelar@nicira.com>
Date: Tue, 13 Aug 2013 01:41:06 -0700
> Using inner-id for tunnel id is not safe in some rare cases.
> E.g. packets coming from multiple sources entering same tunnel
> can have same id. Therefore on tunnel packet receive we
> could have packets from two different stream but with same
> source and dst IP with same ip-id which could confuse ip packet
> reassembly.
>
> Following patch reverts optimization from commit
> 490ab08127 (IP_GRE: Fix IP-Identification.)
>
> CC: Jarno Rajahalme <jrajahalme@nicira.com>
> CC: Ansis Atteka <aatteka@nicira.com>
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/3] net/usb/r8152: support aggregation
From: David Miller @ 2013-08-13 23:41 UTC (permalink / raw)
To: oneukum; +Cc: hayeswang, netdev, linux-kernel, linux-usb
In-Reply-To: <1376407030.3033.13.camel@linux-fkkt.site>
From: Oliver Neukum <oneukum@suse.de>
Date: Tue, 13 Aug 2013 17:17:10 +0200
> On Tue, 2013-08-13 at 20:32 +0800, hayeswang wrote:
>> Oliver Neukum [mailto:oneukum@suse.de]
>> > Sent: Tuesday, August 13, 2013 4:49 PM
>> > To: Hayeswang
>> > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
>> > linux-usb@vger.kernel.org
>> > Subject: Re: [PATCH net-next 1/3] net/usb/r8152: support aggregation
>> >
>> [...]
>> > > + len_used = 0;
>> > > + rx_desc = agg->head;
>> > > + rx_data = agg->head;
>> > > + smp_wmb();
>> > > + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK;
>> > > + len_used += sizeof(struct rx_desc) + pkt_len;
>> > > +
>> > > + while (urb->actual_length >= len_used) {
>> > > + if (pkt_len < ETH_ZLEN)
>> > > + break;
>> > > +
>> > > + pkt_len -= 4; /* CRC */
>> > > + rx_data += sizeof(struct rx_desc);
>> > > +
>> > > + skb = netdev_alloc_skb_ip_align(netdev,
>> > > pkt_len);
>> > > + if (!skb) {
>> > > + stats->rx_dropped++;
>> > > + break;
>> > > + }
>> > > + memcpy(skb->data, rx_data, pkt_len);
>> > > + skb_put(skb, pkt_len);
>> > > + skb->protocol = eth_type_trans(skb, netdev);
>> > > + netif_rx(skb);
>> > > + stats->rx_packets++;
>> > > + stats->rx_bytes += pkt_len;
>> > > +
>> > > + rx_data = rx_agg_align(rx_data +
>> > pkt_len + 4);
>> > > + rx_desc = (struct rx_desc *)rx_data;
>> > > + smp_wmb();
>> >
>> > Against what is the memory barrier?
>>
>> Excuse me. I don't understand your question. Do you mean the function should not
>> be used here?
>
> I don't understand what problem the function is supposed to fix. As long
> as I don't understand it I cannot say for sure whether it is correct.
> There seems no obvious reason for a memory barrier, but there may be a
> hidden reason I don't see.
Hayes, when Oliver asks you "Against what is the memory barrier?" he is asking
you which memory operations you are trying to order.
You do not explain this in your commit message, nor do you explain it with a
suitable comment. This is not acceptable.
It is absolutely critical, that any time you add a memory barrier, you add a
comment above the new memory barrier explaining exactly what the barrier is
trying to achieve.
In fact, this is required by our coding standards.
^ permalink raw reply
* Re: [PATCH net] xfrm: introduce helper for safe determination of mtu
From: David Miller @ 2013-08-13 23:39 UTC (permalink / raw)
To: hannes; +Cc: netdev, steffen.klassert
In-Reply-To: <20130813023558.GD27385@order.stressinduktion.org>
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Tue, 13 Aug 2013 04:35:58 +0200
> skb->sk socket can be of AF_INET or AF_INET6 address family. Thus we
> always have to make sure we a referring to the correct interpretation
> of skb->sk.
>
> We only depend on header defines to query the mtu, so we don't introduce
> a new dependency to ipv6 by this change.
>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
This also looks fine to me, Steffen please review and pick it up.
^ permalink raw reply
* Re: [PATCH net-next v2] xfrm: make local error reporting more robust
From: David Miller @ 2013-08-13 23:35 UTC (permalink / raw)
To: hannes; +Cc: steffen.klassert, eric.dumazet, netdev, vi0oss
In-Reply-To: <20130813015644.GC27385@order.stressinduktion.org>
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Tue, 13 Aug 2013 03:56:44 +0200
> On Mon, Aug 12, 2013 at 07:54:14AM +0200, Steffen Klassert wrote:
>> On Sat, Aug 10, 2013 at 06:16:29PM +0200, Hannes Frederic Sowa wrote:
>> >
>> > Seems skb->encapsulated helps, but I still have to wire it up for the ipv6
>> > tunnels.
>> >
>> > I just prototyped this patch, but I fear I now introduced a dependency
>> > from core xfrm to ipv6, which I would like to have prevented (this would
>> > even happen if I put xfrm_local_error in a header file). Is this actually
>> > a problem? I fear so. The other way would be to put the local_error
>> > handler as function pointers somewhere reachable from struct sock.
>> >
>>
>> Maybe we should put a local_error() function pointer to struct
>> xfrm_state_afinfo and call it via inner_mode->afinfo->local_error().
>>
>> This should always call the right local_error function and we
>> would not need to touch generic networking code to fix it.
>
> Sorry, had to do a v2, because I missed two more unsafe skb->sk dereferences.
> I will post a further one (unsafe determination of mtu) as a seperate patch
> (needs its own commit message).
>
> [PATCH net-next v2] xfrm: make local error reporting more robust
FWIW, this looks fine to me, and I hope Steffen will take care of
it soon.
^ permalink raw reply
* Re: [PATCH net-next] bonding: lacp_port_id setting for 802.3ad
From: Krisztian Ivancso @ 2013-08-13 23:34 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: Ding Tianhong, netdev
In-Reply-To: <19765.1376418334@death.nxdomain>
On 08/13/2013 08:25 PM, Jay Vosburgh wrote:
> Krisztian Ivancso <github-ivan@ivancso.net> wrote:
>
>> On 08/13/2013 11:39 AM, Ding Tianhong wrote:
>>> On 2013/8/13 17:20, Krisztian Ivancso wrote:
>>>> On 08/13/2013 03:07 AM, Ding Tianhong wrote:
>>>>> On 2013/8/12 19:19, Krisztian Ivancso wrote:
>>>>>> >From 472fffa5a8f170daed9e4cc677af8e2560b86be2 Mon Sep 17 00:00:00 2001
>>>>>> From: Krisztian Ivancso <github-ivan@ivancso.net>
>>>>>> Date: Sun, 11 Aug 2013 20:30:44 +0200
>>>>>> Subject: [PATCH net-next] bonding: lacp_port_id setting for 802.3ad ports
>>>
>>> ok, for example: the bonding has four slave, slave1 and slave2 aggregation to 1 group,
>>> and slave3 and slave4 aggregtion to 2 group, how you distinguish the 1 and 2 group by initialize id.
>>
>> this is not possible, because all slave have to be a member of the same
>> aggregation group.
>
> Just on the above point, bonding can group slaves into multiple
> aggregators, but only one aggregator will be active at any given time.
>
> To answer the question, the four slaves would each be given
> unique port IDs that do not conflict.
>
>> i think we misunderstood each other.
>>
>> here is a new example:
>> - switch1 is a switch with a configured lag with two members ports
>> (member1 and member2)
>> - two linux (linux1 and linux2) box with a configured bonding device
>> (bond0) with the same MAC set in both box and one
>> slave on each
>> - lacp_port_id is set to 10 in linux1 and 20 in linux2
>>
>> you can attach the slave from both linux boxes to the same
>> lag on switch1. (slave from linux1 to port member1 and
>> slave from linux2 to port member2 on switch1)
>>
>> port id must be unique within a system.
>> bonding implementation set a unique system id for every bonding device
>> which is derived from MAC of one of the slave interfaces.
>>
>> if we use the current bonding implementation second linux box can't be
>> a member on switch1 because port id is 1 in both linux bonding device.
>>
>> if we can set different starting port id for bonding in different boxes
>> the second box can be a member also.
>
> I understand what you're trying to do here (permit multiple
> instances of bonding on different systems to connect to a single
> aggregator on a switch), and I don't really have a problem with it in
> general.
>
> I do have some comments:
>
> First, altering the lacp_port_id (via sysfs) should only be
> permitted when there are no slaves in the bond, otherwise the
> /proc/net/bonding/bond0 output for the first port id will not match the
> actual first port id value assigned to the slaves. As a practical
> matter, altering lacp_port_id while slaves are present in the bond has
> no effect until all slaves are released and the first new slave is
> added, so this is not reducing functionality.
>
> Second, the lacp_port_id is global across all bonds created
> within the loaded module, and so multiple bonds will all use the same
> starting value. Setting the lacp_port_id via sysfs has no effect, as it
> alters a per-bond value, bond->params.lacp_port_id, that is never
> actually used to set the port ID of a first slave in bond_enslave.
>
> The global default value should only be used to initialize the
> per-bond value when a bond is created, and that per-bond value should be
> used when setting the port id in bond_enslave(). The per-bond value is
> already displayed in /proc/net/bonding/bond0, and is the value modified
> by the sysfs functions
>
> Third, consider adding the port ID to the 803.2ad section in
> bond_info_show_slave.
Thanks for these great comments. I'll soon fix sysfs related bug and
rework patch.
>
> Lastly, I think this should be tested against systems other than
> Cisco to insure that it really interoperates with, for example,
> Juniper's methodology for spanning an aggregator across physical
> chassis. I'm not sure why it wouldn't, but once new functionality
> becomes part of the kernel, changing it in non-backwards compatible ways
> is difficult.
I agree. I try to test it with devices from other manufacturers.
^ permalink raw reply
* Re: [PATCH] rtnetlink: rtnl_bridge_getlink: Call nlmsg_find_attr() with ifinfomsg header
From: David Miller @ 2013-08-13 23:31 UTC (permalink / raw)
To: vyasevic; +Cc: stephen, netdev, bridge, ast, linux-kernel
In-Reply-To: <520ABBFD.7080004@redhat.com>
From: Vlad Yasevich <vyasevic@redhat.com>
Date: Tue, 13 Aug 2013 19:06:37 -0400
> ast explained it in his header message (Bridge VLAN kernel/iproute2
> incompatibility)
That's not a header message.
Header messages have a subject prefix of the form "[PATCH 0/N]".
If he had done this I wouldn't have had to ask such silly
questions.
^ permalink raw reply
* Re: [PATCH net-next] tcp: reset reordering est. selectively on timeout
From: David Miller @ 2013-08-13 23:08 UTC (permalink / raw)
To: ncardwell; +Cc: ycheng, edumazet, mattmathis, netdev
In-Reply-To: <CADVnQykaYF5xQJbv-m6d3xKMHSYZQVjmua2CqXkGdwdo_iqSwA@mail.gmail.com>
From: Neal Cardwell <ncardwell@google.com>
Date: Tue, 13 Aug 2013 00:16:57 -0400
> On Mon, Aug 12, 2013 at 7:41 PM, Yuchung Cheng <ycheng@google.com> wrote:
>> On timeout the TCP sender unconditionally reset the estimated
>> degree of network reordering (tp->reordering). This idea behind
>> is that the estimate is too large to trigger fast recovery
>> (e.g., due to a IP path change).
>>
>> But for example if the sender only had 2 packets outstanding,
>> then a timeout doesn't tell much about reordering. A sender that
>> learns about reordering on big writes and lose packets on small
>> writes will end up falsely retransmit again and again, especially
>> when reordering is more likely on big writes.
>>
>> Therefore the sender should only suspects tp->reordering is too
>> high if it could have gone into fast recovery with the (lower)
>> default estimate.
>>
>> Signed-off-by: Yuchung Cheng <ycheng@google.com>
>> ---
>> net/ipv4/tcp_input.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> Acked-by: Neal Cardwell <ncardwell@google.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] rtnetlink: rtnl_bridge_getlink: Call nlmsg_find_attr() with ifinfomsg header
From: Vlad Yasevich @ 2013-08-13 23:06 UTC (permalink / raw)
To: David Miller; +Cc: stephen, netdev, bridge, ast, linux-kernel
In-Reply-To: <20130813.155443.1789890841731289313.davem@davemloft.net>
On 08/13/2013 06:54 PM, David Miller wrote:
> From: Vlad Yasevich <vyasevic@redhat.com>
> Date: Mon, 12 Aug 2013 15:57:29 -0400
>
>> On 08/12/2013 12:30 PM, Asbjoern Sloth Toennesen wrote:
>>> Fix the iproute2 command `bridge vlan show`, after switching from
>>> rtgenmsg to ifinfomsg.
>>>
>>> Signed-off-by: Asbjoern Sloth Toennesen <ast@fiberby.net>
>>
>>
>> Thanks.. I've still been using an older iproute version and didn't
>> see this.
>>
>>
>> Reviewed-by: Vlad Yasevich <vyasevich@gmail.com>
>
> What introduced this regression?
>
ast explained it in his header message (Bridge VLAN kernel/iproute2
incompatibility)
-vlad
^ permalink raw reply
* Re: [PATCH net v5 0/5] bnx2x: fixes
From: David Miller @ 2013-08-13 23:04 UTC (permalink / raw)
To: dmitry; +Cc: netdev, eilong
In-Reply-To: <1376349903-3461-1-git-send-email-dmitry@broadcom.com>
From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Tue, 13 Aug 2013 02:24:58 +0300
> Please consider applying the series of bnx2x fixes to net:
> * statistics may cause FW assert
> * missing fairness configuration in DCB flow
> * memory leak in sriov related part
> * Illegal PTE access
> * Pagefault crash in shutdown flow with cnic
Series applied, thanks.
^ permalink raw reply
* [PATCH net-next v3] ipv6: make unsolicited report intervals configurable for mld
From: Hannes Frederic Sowa @ 2013-08-13 23:03 UTC (permalink / raw)
To: netdev; +Cc: xiyou.wangcong, william.manley, bcrl, yoshfuji, davem
Commit cab70040dfd95ee32144f02fade64f0cb94f31a0 ("net: igmp:
Reduce Unsolicited report interval to 1s when using IGMPv3") and
2690048c01f32bf45d1c1e1ab3079bc10ad2aea7 ("net: igmp: Allow user-space
configuration of igmp unsolicited report interval") by William Manley made
igmp unsolicited report intervals configurable per interface and corrected
the interval of unsolicited igmpv3 report messages resendings to 1s.
Same needs to be done for IPv6:
MLDv1 (RFC2710 7.10.): 10 seconds
MLDv2 (RFC3810 9.11.): 1 second
Both intervals are configurable via new procfs knobs
mldv1_unsolicited_report_interval and mldv2_unsolicited_report_interval.
(also added .force_mld_version to ipv6_devconf_dflt to bring structs in
line without semantic changes)
v2:
a) Joined documentation update for IPv4 and IPv6 MLD/IGMP
unsolicited_report_interval procfs knobs.
b) incorporate stylistic feedback from William Manley
v3:
a) add new DEVCONF_* values to the end of the enum (thanks to David
Miller)
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: William Manley <william.manley@youview.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
Documentation/networking/ip-sysctl.txt | 18 ++++++++++++++++++
include/linux/ipv6.h | 2 ++
include/uapi/linux/ipv6.h | 2 ++
net/ipv6/addrconf.c | 25 +++++++++++++++++++++++++
net/ipv6/mcast.c | 17 ++++++++++++++---
5 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 36be26b..debfe85 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1039,7 +1039,15 @@ disable_policy - BOOLEAN
disable_xfrm - BOOLEAN
Disable IPSEC encryption on this interface, whatever the policy
+igmpv2_unsolicited_report_interval - INTEGER
+ The interval in milliseconds in which the next unsolicited
+ IGMPv1 or IGMPv2 report retransmit will take place.
+ Default: 10000 (10 seconds)
+igmpv3_unsolicited_report_interval - INTEGER
+ The interval in milliseconds in which the next unsolicited
+ IGMPv3 report retransmit will take place.
+ Default: 1000 (1 seconds)
tag - INTEGER
Allows you to write a number, which can be used as required.
@@ -1331,6 +1339,16 @@ ndisc_notify - BOOLEAN
1 - Generate unsolicited neighbour advertisements when device is brought
up or hardware address changes.
+mldv1_unsolicited_report_interval - INTEGER
+ The interval in milliseconds in which the next unsolicited
+ MLDv1 report retransmit will take place.
+ Default: 10000 (10 seconds)
+
+mldv2_unsolicited_report_interval - INTEGER
+ The interval in milliseconds in which the next unsolicited
+ MLDv2 report retransmit will take place.
+ Default: 1000 (1 second)
+
icmp/*:
ratelimit - INTEGER
Limit the maximal rates for sending ICMPv6 packets.
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 850e95b..77a4784 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -19,6 +19,8 @@ struct ipv6_devconf {
__s32 rtr_solicit_interval;
__s32 rtr_solicit_delay;
__s32 force_mld_version;
+ __s32 mldv1_unsolicited_report_interval;
+ __s32 mldv2_unsolicited_report_interval;
#ifdef CONFIG_IPV6_PRIVACY
__s32 use_tempaddr;
__s32 temp_valid_lft;
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index 4bda4cf..d07ac69 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -160,6 +160,8 @@ enum {
DEVCONF_ACCEPT_DAD,
DEVCONF_FORCE_TLLAO,
DEVCONF_NDISC_NOTIFY,
+ DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
+ DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
DEVCONF_MAX
};
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 7fd8572..ad12f7c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -177,6 +177,8 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
.accept_redirects = 1,
.autoconf = 1,
.force_mld_version = 0,
+ .mldv1_unsolicited_report_interval = 10 * HZ,
+ .mldv2_unsolicited_report_interval = HZ,
.dad_transmits = 1,
.rtr_solicits = MAX_RTR_SOLICITATIONS,
.rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
@@ -211,6 +213,9 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
.accept_ra = 1,
.accept_redirects = 1,
.autoconf = 1,
+ .force_mld_version = 0,
+ .mldv1_unsolicited_report_interval = 10 * HZ,
+ .mldv2_unsolicited_report_interval = HZ,
.dad_transmits = 1,
.rtr_solicits = MAX_RTR_SOLICITATIONS,
.rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
@@ -4179,6 +4184,10 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
array[DEVCONF_RTR_SOLICIT_DELAY] =
jiffies_to_msecs(cnf->rtr_solicit_delay);
array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version;
+ array[DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL] =
+ jiffies_to_msecs(cnf->mldv1_unsolicited_report_interval);
+ array[DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL] =
+ jiffies_to_msecs(cnf->mldv2_unsolicited_report_interval);
#ifdef CONFIG_IPV6_PRIVACY
array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr;
array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft;
@@ -4862,6 +4871,22 @@ static struct addrconf_sysctl_table
.mode = 0644,
.proc_handler = proc_dointvec,
},
+ {
+ .procname = "mldv1_unsolicited_report_interval",
+ .data =
+ &ipv6_devconf.mldv1_unsolicited_report_interval,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_ms_jiffies,
+ },
+ {
+ .procname = "mldv2_unsolicited_report_interval",
+ .data =
+ &ipv6_devconf.mldv2_unsolicited_report_interval,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_ms_jiffies,
+ },
#ifdef CONFIG_IPV6_PRIVACY
{
.procname = "use_tempaddr",
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index db25b8e..6c76df9 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -108,7 +108,6 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
struct inet6_dev *idev);
-#define IGMP6_UNSOLICITED_IVAL (10*HZ)
#define MLD_QRV_DEFAULT 2
#define MLD_V1_SEEN(idev) (dev_net((idev)->dev)->ipv6.devconf_all->force_mld_version == 1 || \
@@ -129,6 +128,18 @@ int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF;
pmc != NULL; \
pmc = rcu_dereference(pmc->next))
+static int unsolicited_report_interval(struct inet6_dev *idev)
+{
+ int iv;
+
+ if (MLD_V1_SEEN(idev))
+ iv = idev->cnf.mldv1_unsolicited_report_interval;
+ else
+ iv = idev->cnf.mldv2_unsolicited_report_interval;
+
+ return iv > 0 ? iv : 1;
+}
+
int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
{
struct net_device *dev = NULL;
@@ -2158,7 +2169,7 @@ static void igmp6_join_group(struct ifmcaddr6 *ma)
igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT);
- delay = net_random() % IGMP6_UNSOLICITED_IVAL;
+ delay = net_random() % unsolicited_report_interval(ma->idev);
spin_lock_bh(&ma->mca_lock);
if (del_timer(&ma->mca_timer)) {
@@ -2325,7 +2336,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire,
(unsigned long)idev);
idev->mc_qrv = MLD_QRV_DEFAULT;
- idev->mc_maxdelay = IGMP6_UNSOLICITED_IVAL;
+ idev->mc_maxdelay = unsolicited_report_interval(idev);
idev->mc_v1_seen = 0;
write_unlock_bh(&idev->lock);
}
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH V2 0/4] Enable bus master till the FLR completes for Chelsio T4
From: Bjorn Helgaas @ 2013-08-13 23:00 UTC (permalink / raw)
To: Casey Leedom
Cc: Vipul Pandya, linux-pci@vger.kernel.org, tomreu, divy, dm,
nirranjan, eilong, netdev
In-Reply-To: <520AAADF.7080801@chelsio.com>
On Tue, Aug 13, 2013 at 3:53 PM, Casey Leedom <leedom@chelsio.com> wrote:
>
> On 08/12/13 14:17, Bjorn Helgaas wrote:
>>
>> On Tue, Aug 6, 2013 at 4:18 AM, Vipul Pandya <vipul@chelsio.com> wrote:
>>>
>>> This patch series adds device specific reset method for Chelsio T4
>>> adapters.
>>>
>>> ...
>>
>> Applied to my "next" branch for v3.12, thanks!
>>
>
> Thanks Bjorn! Do you have an idea when these commits will hit Linus'
> repository and what their git commit IDs will be? We have a customer using
> SLES11sp2 who needs this and once the commits hit Linus' repository we'll
> need to send a request to Novell to pull the change sets into SLES11sp2.
They should appear in Linus' repository a few days after the v3.11
release, which will likely be in the first half of September.
The commit IDs should be the same as those in my repo, which you can
see here: http://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/vipul-chelsio-reset-v2
Bjorn
^ permalink raw reply
* Re: pull request: wireless-next 2013-08-12
From: David Miller @ 2013-08-13 22:59 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20130812195347.GE27408@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 12 Aug 2013 15:53:50 -0400
> This is a batch of updates intended for 3.12. It is mostly driver
> stuff, although Johannes Berg and Simon Wunderlich make a good
> showing with mac80211 bits (particularly some work on 5/10 MHz
> channel support).
>
> The usual suspects are mostly represented. There are lots of updates
> to iwlwifi, ath9k, ath10k, mwifiex, rt2x00, wil6210, as usual.
> The bcma bus gets some love this time, as do cw1200, iwl4965, and a
> few other bits here and there. I don't think there is much unusual
> here, FWIW.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* RE: [PATCH v2 0/3] enic: This patchset adds support for Cisco Low Latency NIC
From: Neel Patel (neepatel) @ 2013-08-13 22:48 UTC (permalink / raw)
To: David Miller
Cc: netdev@vger.kernel.org, Upinder Malhi (umalhi),
Nishank Trivedi (nistrive), Christian Benvenuti (benve)
In-Reply-To: <20130813.153935.1753135227585754595.davem@davemloft.net>
Sorry, but I only sent them once.
I don't know why this is happening.
-----Original Message-----
From: David Miller [mailto:davem@davemloft.net]
Sent: Tuesday, August 13, 2013 3:40 PM
To: Neel Patel (neepatel)
Cc: netdev@vger.kernel.org; Upinder Malhi (umalhi); Nishank Trivedi (nistrive); Christian Benvenuti (benve)
Subject: Re: [PATCH v2 0/3] enic: This patchset adds support for Cisco Low Latency NIC
Why do you send your patches out two times, every time you post them?
^ permalink raw reply
* Re: [PATCH] rtnetlink: rtnl_bridge_getlink: Call nlmsg_find_attr() with ifinfomsg header
From: David Miller @ 2013-08-13 22:54 UTC (permalink / raw)
To: vyasevic; +Cc: ast, stephen, netdev, bridge, linux-kernel
In-Reply-To: <52093E29.5010604@redhat.com>
From: Vlad Yasevich <vyasevic@redhat.com>
Date: Mon, 12 Aug 2013 15:57:29 -0400
> On 08/12/2013 12:30 PM, Asbjoern Sloth Toennesen wrote:
>> Fix the iproute2 command `bridge vlan show`, after switching from
>> rtgenmsg to ifinfomsg.
>>
>> Signed-off-by: Asbjoern Sloth Toennesen <ast@fiberby.net>
>
>
> Thanks.. I've still been using an older iproute version and didn't
> see this.
>
>
> Reviewed-by: Vlad Yasevich <vyasevich@gmail.com>
What introduced this regression?
^ permalink raw reply
* Re: [PATCH net-next v2] ipv6: make unsolicited report intervals configurable for mld
From: David Miller @ 2013-08-13 22:52 UTC (permalink / raw)
To: hannes; +Cc: netdev, xiyou.wangcong, william.manley, bcrl, yoshfuji
In-Reply-To: <20130812112817.GC23241@order.stressinduktion.org>
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Mon, 12 Aug 2013 13:28:17 +0200
> diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
> index 4bda4cf..315f133 100644
> --- a/include/uapi/linux/ipv6.h
> +++ b/include/uapi/linux/ipv6.h
> @@ -147,6 +147,8 @@ enum {
> DEVCONF_MAX_DESYNC_FACTOR,
> DEVCONF_MAX_ADDRESSES,
> DEVCONF_FORCE_MLD_VERSION,
> + DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
> + DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
> DEVCONF_ACCEPT_RA_DEFRTR,
> DEVCONF_ACCEPT_RA_PINFO,
> DEVCONF_ACCEPT_RA_RTR_PREF,
Since these these values are in an UAPI header, and thus exported to userspace,
you can't add new enumeration values in the middle. Otherwise you'll change
the existing enumerations, which could break userspace.
You'll have to add these new values to the end.
^ permalink raw reply
* Re: [PATCH v2 0/3] enic: This patchset adds support for Cisco Low Latency NIC
From: David Miller @ 2013-08-13 22:39 UTC (permalink / raw)
To: neepatel; +Cc: netdev, umalhi, nistrive, benve
In-Reply-To: <1376432265-5497-1-git-send-email-neepatel@cisco.com>
Why do you send your patches out two times, every time you post them?
^ permalink raw reply
* Re: [PATCH][net-next v2] gianfar: Add flow control support
From: David Miller @ 2013-08-13 22:29 UTC (permalink / raw)
To: claudiu.manoil; +Cc: netdev, bhutchings, ljaenicke
In-Reply-To: <1376304806-8504-1-git-send-email-claudiu.manoil@freescale.com>
From: Claudiu Manoil <claudiu.manoil@freescale.com>
Date: Mon, 12 Aug 2013 13:53:26 +0300
> eTSEC has Rx and Tx flow control capabilities that may be enabled
> through MACCFG1[Rx_Flow, Tx_Flow] bits. These bits must not be set
> however when eTSEC is operated in Half-Duplex mode. Unfortunately,
> the driver currently sets these bits unconditionally.
> This patch adds the proper handling of the PAUSE frame capability
> register bits by implementing the ethtool -A interface. When pause
> autoneg is enabled, the controller uses the phy's capability to
> negotiate PAUSE frame settings with the link partner and reconfigures
> its Rx_Flow and Tx_Flow settings to match the capabilities of the
> link partner. If pause autoneg is off, the PAUSE frame generation
> may be forced manually (ethtool -A). Flow control is disabled by
> default now.
> This implementation is inspired by the tg3 driver.
>
> Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
> Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH] myri10ge: Update MAINTAINERS
From: David Miller @ 2013-08-13 22:25 UTC (permalink / raw)
To: hykim; +Cc: netdev
In-Reply-To: <1376299202-30017-1-git-send-email-hykim@myri.com>
From: Hyong-Youb Kim <hykim@myri.com>
Date: Mon, 12 Aug 2013 02:20:02 -0700
> Remove Andrew Gallatin, as he is no longer with Myricom. Add
> Hyong-Youb Kim as the new maintainer. Update the website URL.
>
> Signed-off-by: Hyong-Youb Kim <hykim@myri.com>
Applied.
^ permalink raw reply
* Re: [PATCH net] be2net: Clear any capability flags that driver is not interested in.
From: David Miller @ 2013-08-13 22:22 UTC (permalink / raw)
To: sarveshwar.bandi; +Cc: netdev
In-Reply-To: <208f9dff-8e74-4a44-bd94-6c79342e6a73@CMEXHTCAS1.ad.emulex.com>
From: <sarveshwar.bandi@emulex.com>
Date: Mon, 12 Aug 2013 11:21:09 +0530
> From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
>
> It is possible for some versions of firmware to advertise capabilities that driver
> is not ready to handle. This may lead to controller stall. Clear all flags that driver
> is not interested in.
>
> Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
This is so ugly and hard to understand.
The issue is that the capabilities come from an external entity, in
be_cmd_get_func_config().
So that's the place where you should clear the bits that the drive
doesn't understand.
Also, put the new macro into a sane place like a header file close
to the existing individual BE_IF_FLAGS_* defines. And name it sanely,
something like "BE_IF_FLAGS_ALL".
^ permalink raw reply
* Re: [PATCH] r8169: fix invalid register dump
From: Francois Romieu @ 2013-08-13 22:20 UTC (permalink / raw)
To: Peter Wu; +Cc: netdev, nic_swsd
In-Reply-To: <1376426265-30353-1-git-send-email-lekensteyn@gmail.com>
Peter Wu <lekensteyn@gmail.com> :
[...]
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index b5eb419..28af01c 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -1897,12 +1897,17 @@ static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs,
[...]
> - memcpy_fromio(p, tp->mmio_addr, regs->len);
> + for (i = 0; i < regs->len - 4; i += 4)
> + memcpy_fromio(bytes + i, tp->mmio_addr + i, 4);
regs->len is u32. regs->len - 4 should not underflow on normal situation but
it's a bit sloppy.
--
Ueimor
^ permalink raw reply
* Re: [PATCH net] skge: dma_sync the whole receive buffer
From: Stephen Hemminger @ 2013-08-13 22:20 UTC (permalink / raw)
To: David Miller; +Cc: pomidorabelisima, netdev
In-Reply-To: <20130813.150955.1471100759610399160.davem@davemloft.net>
On Tue, 13 Aug 2013 15:09:55 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Sat, 10 Aug 2013 15:02:07 -0700
>
> > The DMA sync should sync the whole receive buffer, not just
> > part of it. Fixes log messages dma_sync_check.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
> Applied, but I really suspect that your "check DMA mapping errors"
> patch has added a serious regression. A regression much worse than
> the bug you were trying to fix with that change.
I am retesting with hardware, will have answer tonight.
^ permalink raw reply
* [PATCH v2 3/3] drivers/net: enic: Generate notification of hardware crash
From: Neel Patel @ 2013-08-13 22:19 UTC (permalink / raw)
To: netdev; +Cc: Neel Patel
In-Reply-To: <1376432381-5546-1-git-send-email-neepatel@cisco.com>
This patch generates a hardware crash notification (NETDEV_REBOOT)
during reset. After a hardware crash, ENIC resets all its resources
including queue pair filters programmed by USNIC. USNIC registers for
this notification, and on receiving it, reprograms the queue pair
filters.
Signed-off-by: Neel Patel <neepatel@cisco.com>
Signed-off-by: Nishank Trivedi <nistrive@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
drivers/net/ethernet/cisco/enic/enic.h | 2 +-
drivers/net/ethernet/cisco/enic/enic_main.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic.h b/drivers/net/ethernet/cisco/enic/enic.h
index cacca29..be16731 100644
--- a/drivers/net/ethernet/cisco/enic/enic.h
+++ b/drivers/net/ethernet/cisco/enic/enic.h
@@ -32,7 +32,7 @@
#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION "2.1.1.39"
+#define DRV_VERSION "2.1.1.43"
#define DRV_COPYRIGHT "Copyright 2008-2013 Cisco Systems, Inc"
#define ENIC_BARS_MAX 6
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 7f8891b..bcf15b1 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1743,6 +1743,7 @@ static void enic_reset(struct work_struct *work)
enic_dev_set_ig_vlan_rewrite_mode(enic);
enic_open(enic->netdev);
spin_unlock(&enic->enic_api_lock);
+ call_netdevice_notifiers(NETDEV_REBOOT, enic->netdev);
rtnl_unlock();
}
--
1.8.4-rc0
^ permalink raw reply related
* [PATCH v2 1/3] drivers/net: enic: Adding support for Cisco Low Latency NIC
From: Neel Patel @ 2013-08-13 22:19 UTC (permalink / raw)
To: netdev; +Cc: Neel Patel
In-Reply-To: <1376432381-5546-1-git-send-email-neepatel@cisco.com>
This patch,
- Adds new firmware commands for the new Cisco Low Latency NIC
(aka. USNIC).
- Enables descriptor prefetch on the hardware. This feature
reduces latency for small packet transmit.
Signed-off-by: Neel Patel <neepatel@cisco.com>
Signed-off-by: Nishank Trivedi <nistrive@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
drivers/net/ethernet/cisco/enic/enic.h | 2 +-
drivers/net/ethernet/cisco/enic/enic_res.h | 9 +-
drivers/net/ethernet/cisco/enic/vnic_dev.c | 5 +
drivers/net/ethernet/cisco/enic/vnic_dev.h | 1 +
drivers/net/ethernet/cisco/enic/vnic_devcmd.h | 176 +++++++++++++++++++++++++-
drivers/net/ethernet/cisco/enic/vnic_rq.c | 5 +-
drivers/net/ethernet/cisco/enic/vnic_rq.h | 5 +-
drivers/net/ethernet/cisco/enic/vnic_wq.c | 3 -
drivers/net/ethernet/cisco/enic/vnic_wq.h | 86 ++++++++++++-
9 files changed, 275 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic.h b/drivers/net/ethernet/cisco/enic/enic.h
index 2e37c63..75e842d 100644
--- a/drivers/net/ethernet/cisco/enic/enic.h
+++ b/drivers/net/ethernet/cisco/enic/enic.h
@@ -33,7 +33,7 @@
#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
#define DRV_VERSION "2.1.1.39"
-#define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc"
+#define DRV_COPYRIGHT "Copyright 2008-2013 Cisco Systems, Inc"
#define ENIC_BARS_MAX 6
diff --git a/drivers/net/ethernet/cisco/enic/enic_res.h b/drivers/net/ethernet/cisco/enic/enic_res.h
index 25be273..69f60af 100644
--- a/drivers/net/ethernet/cisco/enic/enic_res.h
+++ b/drivers/net/ethernet/cisco/enic/enic_res.h
@@ -47,6 +47,9 @@ static inline void enic_queue_wq_desc_ex(struct vnic_wq *wq,
int offload_mode, int cq_entry, int sop, int eop, int loopback)
{
struct wq_enet_desc *desc = vnic_wq_next_desc(wq);
+ u8 desc_skip_cnt = 1;
+ u8 compressed_send = 0;
+ u64 wrid = 0;
wq_enet_desc_enc(desc,
(u64)dma_addr | VNIC_PADDR_TARGET,
@@ -59,7 +62,8 @@ static inline void enic_queue_wq_desc_ex(struct vnic_wq *wq,
(u16)vlan_tag,
(u8)loopback);
- vnic_wq_post(wq, os_buf, dma_addr, len, sop, eop);
+ vnic_wq_post(wq, os_buf, dma_addr, len, sop, eop, desc_skip_cnt,
+ (u8)cq_entry, compressed_send, wrid);
}
static inline void enic_queue_wq_desc_cont(struct vnic_wq *wq,
@@ -120,6 +124,7 @@ static inline void enic_queue_rq_desc(struct vnic_rq *rq,
dma_addr_t dma_addr, unsigned int len)
{
struct rq_enet_desc *desc = vnic_rq_next_desc(rq);
+ u64 wrid = 0;
u8 type = os_buf_index ?
RQ_ENET_TYPE_NOT_SOP : RQ_ENET_TYPE_ONLY_SOP;
@@ -127,7 +132,7 @@ static inline void enic_queue_rq_desc(struct vnic_rq *rq,
(u64)dma_addr | VNIC_PADDR_TARGET,
type, (u16)len);
- vnic_rq_post(rq, os_buf, os_buf_index, dma_addr, len);
+ vnic_rq_post(rq, os_buf, os_buf_index, dma_addr, len, wrid);
}
struct enic;
diff --git a/drivers/net/ethernet/cisco/enic/vnic_dev.c b/drivers/net/ethernet/cisco/enic/vnic_dev.c
index 97455c5..1b436b3 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_dev.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_dev.c
@@ -970,6 +970,11 @@ err_out:
return NULL;
}
+struct pci_dev *vnic_dev_get_pdev(struct vnic_dev *vdev)
+{
+ return vdev->pdev;
+}
+
int vnic_dev_init_prov2(struct vnic_dev *vdev, u8 *buf, u32 len)
{
u64 a0, a1 = len;
diff --git a/drivers/net/ethernet/cisco/enic/vnic_dev.h b/drivers/net/ethernet/cisco/enic/vnic_dev.h
index f3d9b79..e670029 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_dev.h
+++ b/drivers/net/ethernet/cisco/enic/vnic_dev.h
@@ -127,6 +127,7 @@ int vnic_dev_set_ig_vlan_rewrite_mode(struct vnic_dev *vdev,
struct vnic_dev *vnic_dev_register(struct vnic_dev *vdev,
void *priv, struct pci_dev *pdev, struct vnic_dev_bar *bar,
unsigned int num_bars);
+struct pci_dev *vnic_dev_get_pdev(struct vnic_dev *vdev);
int vnic_dev_init_prov2(struct vnic_dev *vdev, u8 *buf, u32 len);
int vnic_dev_enable2(struct vnic_dev *vdev, int active);
int vnic_dev_enable2_done(struct vnic_dev *vdev, int *status);
diff --git a/drivers/net/ethernet/cisco/enic/vnic_devcmd.h b/drivers/net/ethernet/cisco/enic/vnic_devcmd.h
index 23d5552..b9a0d78 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_devcmd.h
+++ b/drivers/net/ethernet/cisco/enic/vnic_devcmd.h
@@ -281,11 +281,25 @@ enum vnic_devcmd_cmd {
* 0 if no VIF-CONFIG-INFO TLV was ever received. */
CMD_CONFIG_INFO_GET = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_ALL, 44),
+ /* INT13 API: (u64)a0=paddr to vnic_int13_params struct
+ * (u32)a1=INT13_CMD_xxx
+ */
+ CMD_INT13_ALL = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 45),
+
+ /* Set default vlan:
+ * in: (u16)a0=new default vlan
+ * (u16)a1=zero for overriding vlan with param a0,
+ * non-zero for resetting vlan to the default
+ * out: (u16)a0=old default vlan
+ */
+ CMD_SET_DEFAULT_VLAN = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_ALL, 46),
+
/* init_prov_info2:
* Variant of CMD_INIT_PROV_INFO, where it will not try to enable
* the vnic until CMD_ENABLE2 is issued.
* (u64)a0=paddr of vnic_devcmd_provinfo
- * (u32)a1=sizeof provision info */
+ * (u32)a1=sizeof provision info
+ */
CMD_INIT_PROV_INFO2 = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 47),
/* enable2:
@@ -339,16 +353,57 @@ enum vnic_devcmd_cmd {
CMD_INTR_COAL_CONVERT = _CMDC(_CMD_DIR_READ, _CMD_VTYPE_ALL, 50),
/*
- * cmd_set_mac_addr
- * set mac address
+ * Set the predefined mac address as default
* in:
* (u48)a0 = mac addr
- *
*/
CMD_SET_MAC_ADDR = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 55),
+
+ /* Update the provisioning info of the given VIF
+ * (u64)a0=paddr of vnic_devcmd_provinfo
+ * (u32)a1=sizeof provision info
+ */
+ CMD_PROV_INFO_UPDATE = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 56),
+
+ /* Add a filter.
+ * in: (u64) a0= filter address
+ * (u32) a1= size of filter
+ * out: (u32) a0=filter identifier
+ */
+ CMD_ADD_FILTER = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_ENET, 58),
+
+ /* Delete a filter.
+ * in: (u32) a0=filter identifier
+ */
+ CMD_DEL_FILTER = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 59),
+
+ /* Enable a Queue Pair in User space NIC
+ * in: (u32) a0=Queue Pair number
+ * (u32) a1= command
+ */
+ CMD_QP_ENABLE = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 60),
+
+ /* Disable a Queue Pair in User space NIC
+ * in: (u32) a0=Queue Pair number
+ * (u32) a1= command
+ */
+ CMD_QP_DISABLE = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 61),
+
+ /* Stats dump Queue Pair in User space NIC
+ * in: (u32) a0=Queue Pair number
+ * (u64) a1=host buffer addr for status dump
+ * (u32) a2=length of the buffer
+ */
+ CMD_QP_STATS_DUMP = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 62),
+
+ /* Clear stats for Queue Pair in User space NIC
+ * in: (u32) a0=Queue Pair number
+ */
+ CMD_QP_STATS_CLEAR = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 63),
};
/* CMD_ENABLE2 flags */
+#define CMD_ENABLE2_STANDBY 0x0
#define CMD_ENABLE2_ACTIVE 0x1
/* flags for CMD_OPEN */
@@ -364,6 +419,9 @@ enum vnic_devcmd_cmd {
#define CMD_PFILTER_PROMISCUOUS 0x08
#define CMD_PFILTER_ALL_MULTICAST 0x10
+/* Commands for CMD_QP_ENABLE/CM_QP_DISABLE */
+#define CMD_QP_RQWQ 0x0
+
/* rewrite modes for CMD_IG_VLAN_REWRITE_MODE */
#define IG_VLAN_REWRITE_MODE_DEFAULT_TRUNK 0
#define IG_VLAN_REWRITE_MODE_UNTAG_DEFAULT_VLAN 1
@@ -390,6 +448,7 @@ enum vnic_devcmd_error {
ERR_EMAXRES = 10,
ERR_ENOTSUPPORTED = 11,
ERR_EINPROGRESS = 12,
+ ERR_MAX
};
/*
@@ -435,6 +494,115 @@ struct vnic_devcmd_provinfo {
u8 data[0];
};
+/* These are used in flags field of different filters to denote
+ * valid fields used.
+ */
+#define FILTER_FIELD_VALID(fld) (1 << (fld - 1))
+
+#define FILTER_FIELDS_USNIC ( \
+ FILTER_FIELD_VALID(1) | \
+ FILTER_FIELD_VALID(2) | \
+ FILTER_FIELD_VALID(3) | \
+ FILTER_FIELD_VALID(4))
+
+#define FILTER_FIELDS_IPV4_5TUPLE ( \
+ FILTER_FIELD_VALID(1) | \
+ FILTER_FIELD_VALID(2) | \
+ FILTER_FIELD_VALID(3) | \
+ FILTER_FIELD_VALID(4) | \
+ FILTER_FIELD_VALID(5))
+
+#define FILTER_FIELDS_MAC_VLAN ( \
+ FILTER_FIELD_VALID(1) | \
+ FILTER_FIELD_VALID(2))
+
+#define FILTER_FIELD_USNIC_VLAN FILTER_FIELD_VALID(1)
+#define FILTER_FIELD_USNIC_ETHTYPE FILTER_FIELD_VALID(2)
+#define FILTER_FIELD_USNIC_PROTO FILTER_FIELD_VALID(3)
+#define FILTER_FIELD_USNIC_ID FILTER_FIELD_VALID(4)
+
+struct filter_usnic_id {
+ u32 flags;
+ u16 vlan;
+ u16 ethtype;
+ u8 proto_version;
+ u32 usnic_id;
+} __packed;
+
+#define FILTER_FIELD_5TUP_PROTO FILTER_FIELD_VALID(1)
+#define FILTER_FIELD_5TUP_SRC_AD FILTER_FIELD_VALID(2)
+#define FILTER_FIELD_5TUP_DST_AD FILTER_FIELD_VALID(3)
+#define FILTER_FIELD_5TUP_SRC_PT FILTER_FIELD_VALID(4)
+#define FILTER_FIELD_5TUP_DST_PT FILTER_FIELD_VALID(5)
+
+/* Enums for the protocol field. */
+enum protocol_e {
+ PROTO_UDP = 0,
+ PROTO_TCP = 1,
+};
+
+struct filter_ipv4_5tuple {
+ u32 flags;
+ u32 protocol;
+ u32 src_addr;
+ u32 dst_addr;
+ u16 src_port;
+ u16 dst_port;
+} __packed;
+
+#define FILTER_FIELD_VMQ_VLAN FILTER_FIELD_VALID(1)
+#define FILTER_FIELD_VMQ_MAC FILTER_FIELD_VALID(2)
+
+struct filter_mac_vlan {
+ u32 flags;
+ u16 vlan;
+ u8 mac_addr[6];
+} __packed;
+
+/* Specifies the filter_action type. */
+enum {
+ FILTER_ACTION_RQ_STEERING = 0,
+ FILTER_ACTION_MAX
+};
+
+struct filter_action {
+ u32 type;
+ union {
+ u32 rq_idx;
+ } u;
+} __packed;
+
+/* Specifies the filter type. */
+enum filter_type {
+ FILTER_USNIC_ID = 0,
+ FILTER_IPV4_5TUPLE = 1,
+ FILTER_MAC_VLAN = 2,
+ FILTER_MAX
+};
+
+struct filter {
+ u32 type;
+ union {
+ struct filter_usnic_id usnic;
+ struct filter_ipv4_5tuple ipv4;
+ struct filter_mac_vlan mac_vlan;
+ } u;
+} __packed;
+
+enum {
+ CLSF_TLV_FILTER = 0,
+ CLSF_TLV_ACTION = 1,
+};
+
+/* Maximum size of buffer to CMD_ADD_FILTER */
+#define FILTER_MAX_BUF_SIZE 100
+
+struct filter_tlv {
+ u_int32_t type;
+ u_int32_t length;
+ u_int32_t val[0];
+};
+
/*
* Writing cmd register causes STAT_BUSY to get set in status register.
* When cmd completes, STAT_BUSY will be cleared.
diff --git a/drivers/net/ethernet/cisco/enic/vnic_rq.c b/drivers/net/ethernet/cisco/enic/vnic_rq.c
index 7e1488f..36a2ed6 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_rq.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_rq.c
@@ -30,12 +30,9 @@
static int vnic_rq_alloc_bufs(struct vnic_rq *rq)
{
struct vnic_rq_buf *buf;
- struct vnic_dev *vdev;
unsigned int i, j, count = rq->ring.desc_count;
unsigned int blks = VNIC_RQ_BUF_BLKS_NEEDED(count);
- vdev = rq->vdev;
-
for (i = 0; i < blks; i++) {
rq->bufs[i] = kzalloc(VNIC_RQ_BUF_BLK_SZ(count), GFP_ATOMIC);
if (!rq->bufs[i])
@@ -141,7 +138,7 @@ void vnic_rq_init(struct vnic_rq *rq, unsigned int cq_index,
unsigned int error_interrupt_enable,
unsigned int error_interrupt_offset)
{
- u32 fetch_index;
+ u32 fetch_index = 0;
/* Use current fetch_index as the ring starting point */
fetch_index = ioread32(&rq->ctrl->fetch_index);
diff --git a/drivers/net/ethernet/cisco/enic/vnic_rq.h b/drivers/net/ethernet/cisco/enic/vnic_rq.h
index 2056586..ee7bc95 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_rq.h
+++ b/drivers/net/ethernet/cisco/enic/vnic_rq.h
@@ -72,6 +72,7 @@ struct vnic_rq_buf {
unsigned int len;
unsigned int index;
void *desc;
+ uint64_t wr_id;
};
struct vnic_rq {
@@ -110,7 +111,8 @@ static inline unsigned int vnic_rq_next_index(struct vnic_rq *rq)
static inline void vnic_rq_post(struct vnic_rq *rq,
void *os_buf, unsigned int os_buf_index,
- dma_addr_t dma_addr, unsigned int len)
+ dma_addr_t dma_addr, unsigned int len,
+ uint64_t wrid)
{
struct vnic_rq_buf *buf = rq->to_use;
@@ -118,6 +120,7 @@ static inline void vnic_rq_post(struct vnic_rq *rq,
buf->os_buf_index = os_buf_index;
buf->dma_addr = dma_addr;
buf->len = len;
+ buf->wr_id = wrid;
buf = buf->next;
rq->to_use = buf;
diff --git a/drivers/net/ethernet/cisco/enic/vnic_wq.c b/drivers/net/ethernet/cisco/enic/vnic_wq.c
index 5e0d7a2..3e6b8d5 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_wq.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_wq.c
@@ -30,12 +30,9 @@
static int vnic_wq_alloc_bufs(struct vnic_wq *wq)
{
struct vnic_wq_buf *buf;
- struct vnic_dev *vdev;
unsigned int i, j, count = wq->ring.desc_count;
unsigned int blks = VNIC_WQ_BUF_BLKS_NEEDED(count);
- vdev = wq->vdev;
-
for (i = 0; i < blks; i++) {
wq->bufs[i] = kzalloc(VNIC_WQ_BUF_BLK_SZ(count), GFP_ATOMIC);
if (!wq->bufs[i])
diff --git a/drivers/net/ethernet/cisco/enic/vnic_wq.h b/drivers/net/ethernet/cisco/enic/vnic_wq.h
index 7dd937a..b655667 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_wq.h
+++ b/drivers/net/ethernet/cisco/enic/vnic_wq.h
@@ -58,6 +58,10 @@ struct vnic_wq_buf {
unsigned int index;
int sop;
void *desc;
+ uint64_t wr_id; /* Cookie */
+ uint8_t cq_entry; /* Gets completion event from hw */
+ uint8_t desc_skip_cnt; /* Num descs to occupy */
+ uint8_t compressed_send; /* Both hdr and payload in one desc */
};
/* Break the vnic_wq_buf allocations into blocks of 32/64 entries */
@@ -100,16 +104,94 @@ static inline void *vnic_wq_next_desc(struct vnic_wq *wq)
return wq->to_use->desc;
}
+#define PI_LOG2_CACHE_LINE_SIZE 5
+#define PI_INDEX_BITS 12
+#define PI_INDEX_MASK ((1U << PI_INDEX_BITS) - 1)
+#define PI_PREFETCH_LEN_MASK ((1U << PI_LOG2_CACHE_LINE_SIZE) - 1)
+#define PI_PREFETCH_LEN_OFF 16
+#define PI_PREFETCH_ADDR_BITS 43
+#define PI_PREFETCH_ADDR_MASK ((1ULL << PI_PREFETCH_ADDR_BITS) - 1)
+#define PI_PREFETCH_ADDR_OFF 21
+
+/* How many cache lines are touched by buffer (addr, len). */
+static inline unsigned int num_cache_lines_touched(dma_addr_t addr,
+ unsigned int len)
+{
+ const unsigned long mask = PI_PREFETCH_LEN_MASK;
+ const unsigned long laddr = (unsigned long)addr;
+ unsigned long lines, equiv_len;
+ /* A. If addr is aligned, our solution is just to round up len to the
+ * next boundary.
+ *
+ * e.g. addr = 0, len = 48
+ * +--------------------+
+ * |XXXXXXXXXXXXXXXXXXXX| 32-byte cacheline a
+ * +--------------------+
+ * |XXXXXXXXXX | cacheline b
+ * +--------------------+
+ *
+ * B. If addr is not aligned, however, we may use an extra
+ * cacheline. e.g. addr = 12, len = 22
+ *
+ * +--------------------+
+ * | XXXXXXXXXXXXX|
+ * +--------------------+
+ * |XX |
+ * +--------------------+
+ *
+ * Our solution is to make the problem equivalent to case A
+ * above by adding the empty space in the first cacheline to the length:
+ * unsigned long len;
+ *
+ * +--------------------+
+ * |eeeeeeeXXXXXXXXXXXXX| "e" is empty space, which we add to len
+ * +--------------------+
+ * |XX |
+ * +--------------------+
+ */
+ equiv_len = len + (laddr & mask);
+
+ /* Now we can just round up this len to the next 32-byte boundary. */
+ lines = (equiv_len + mask) & (~mask);
+
+ /* Scale bytes -> cachelines. */
+ return lines >> PI_LOG2_CACHE_LINE_SIZE;
+}
+
+static inline u64 vnic_cached_posted_index(dma_addr_t addr,
+ unsigned int len, unsigned int index)
+{
+ unsigned int num_cache_lines = num_cache_lines_touched(addr, len);
+ /* Wish we could avoid a branch here. We could have separate
+ * vnic_wq_post() and vinc_wq_post_inline(), the latter
+ * only supporting < 1k (2^5 * 2^5) sends, I suppose. This would
+ * eliminate the if (eop) branch as well.
+ */
+ if (num_cache_lines > PI_PREFETCH_LEN_MASK)
+ num_cache_lines = 0;
+ return (index & PI_INDEX_MASK) |
+ ((num_cache_lines & PI_PREFETCH_LEN_MASK)
+ << PI_PREFETCH_LEN_OFF) |
+ (((addr >> PI_LOG2_CACHE_LINE_SIZE) &
+ PI_PREFETCH_ADDR_MASK) << PI_PREFETCH_ADDR_OFF);
+}
+
static inline void vnic_wq_post(struct vnic_wq *wq,
void *os_buf, dma_addr_t dma_addr,
- unsigned int len, int sop, int eop)
+ unsigned int len, int sop, int eop,
+ uint8_t desc_skip_cnt, uint8_t cq_entry,
+ uint8_t compressed_send, uint64_t wrid)
{
struct vnic_wq_buf *buf = wq->to_use;
buf->sop = sop;
+ buf->cq_entry = cq_entry;
+ buf->compressed_send = compressed_send;
+ buf->desc_skip_cnt = desc_skip_cnt;
buf->os_buf = eop ? os_buf : NULL;
buf->dma_addr = dma_addr;
buf->len = len;
+ buf->wr_id = wrid;
buf = buf->next;
if (eop) {
@@ -123,7 +205,7 @@ static inline void vnic_wq_post(struct vnic_wq *wq,
}
wq->to_use = buf;
- wq->ring.desc_avail--;
+ wq->ring.desc_avail -= desc_skip_cnt;
}
static inline void vnic_wq_service(struct vnic_wq *wq,
--
1.8.4-rc0
^ 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