* Re: [PATCH] net: sctp: find the correct highest_new_tsn in sack
From: Neil Horman @ 2013-11-22 11:56 UTC (permalink / raw)
To: Chang Xiangzhong; +Cc: vyasevich, davem, linux-sctp, netdev, linux-kernel
In-Reply-To: <1385070988-29554-1-git-send-email-changxiangzhong@gmail.com>
On Thu, Nov 21, 2013 at 10:56:28PM +0100, Chang Xiangzhong wrote:
> Function sctp_check_transmitted(transport t, ...) would iterate all of
> transport->transmitted queue and looking for the highest __newly__ acked tsn.
> The original algorithm would depend on the order of the assoc->transport_list
> (in function sctp_outq_sack line 1215 - 1226). The result might not be the
> expected due to the order of the tranport_list.
>
> Solution: checking if the exising is smaller than the new one before assigning
>
> Signed-off-by: Chang Xiangzhong <changxiangzhong@gmail.com>
> ---
> net/sctp/outqueue.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index ef9e2bb..1b494fa 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -1397,7 +1397,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,
> */
> if (!tchunk->tsn_gap_acked) {
> tchunk->tsn_gap_acked = 1;
> - *highest_new_tsn_in_sack = tsn;
> + if (TSN_lt(*highest_new_tsn_in_sack, tsn))
> + *highest_new_tsn_in_sack = tsn;
> bytes_acked += sctp_data_size(tchunk);
> if (!tchunk->transport)
> migrate_bytes += sctp_data_size(tchunk);
> --
> 1.8.4.3
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* ™FINANCIAL PROBLEMS SOLUTION™
From: BESIKTAS FINANCE FIRM @ 2013-11-22 11:57 UTC (permalink / raw)
To: Recipients
WE offer all kinds of Loans with a comfortable Repayment Scheme at Loan Interest rates of 3% per annual at our Record Three (3) days Loan Approval Guaranteed. Contact us now at besiktasfinancefirm1@besiktas.ws or Phone:-+447014226036 for all your Financial Worries Solutions.
^ permalink raw reply
* Re: [PATCH] net: sctp: set chunk->tsn_gap_acked at the end of cycle
From: Neil Horman @ 2013-11-22 12:10 UTC (permalink / raw)
To: Chang Xiangzhong; +Cc: vyasevich, davem, linux-sctp, netdev, linux-kernel
In-Reply-To: <1385106589-402-1-git-send-email-changxiangzhong@gmail.com>
On Fri, Nov 22, 2013 at 08:49:49AM +0100, Chang Xiangzhong wrote:
> tsn_gap_acked is an important state flag in chunk, which indicates if the
> chunk has been acked in gap reports before. SFR-CACC algorithm depends on this
> variable. So set this at the end of each iteration, otherwise the SFR-CACC
> algorithm would never be toggled.
>
> Signed-off-by: Chang Xiangzhong <changxiangzhong@gmail.com>
> ---
> net/sctp/outqueue.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 1b494fa..bff828c 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -1396,7 +1396,6 @@ static void sctp_check_transmitted(struct sctp_outq *q,
> * while DATA was outstanding).
> */
> if (!tchunk->tsn_gap_acked) {
> - tchunk->tsn_gap_acked = 1;
> if (TSN_lt(*highest_new_tsn_in_sack, tsn))
> *highest_new_tsn_in_sack = tsn;
> bytes_acked += sctp_data_size(tchunk);
> @@ -1460,6 +1459,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,
> */
> list_add_tail(lchunk, &tlist);
> }
> +
> + tchunk->tsn_gap_acked = 1;
> } else {
> if (tchunk->tsn_gap_acked) {
> pr_debug("%s: receiver reneged on data TSN:0x%x\n",
> --
> 1.8.4.3
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* [ANNOUNCE] iptables 1.4.21 release
From: Pablo Neira Ayuso @ 2013-11-22 12:12 UTC (permalink / raw)
To: netfilter-devel; +Cc: netdev, netfilter, netfilter-announce, lwn
[-- Attachment #1: Type: text/plain, Size: 872 bytes --]
Hi!
The Netfilter project proudly presents:
iptables 1.4.21
iptables is the userspace command line program used to configure the
Linux packet filtering ruleset. It is targeted towards system administrators.
Since Network Address Translation is also configured from the packet filter
ruleset, iptables is used for this, too. The iptables package also includes
ip6tables. ip6tables is used for configuring the IPv6 packet filter.
This release includes fixes and a couple of new features:
* --nowildcard option for xt_socket, available since Linux kernel 3.11,
from Eric Dumazet.
* SYNPROXY support, available since Linux kernel 3.12, from Patrick McHardy.
See ChangeLog that comes attached to this email for more details.
You can download it from:
http://www.netfilter.org/projects/iptables/downloads.html
ftp://ftp.netfilter.org/pub/iptables/
Have fun!
[-- Attachment #2: changes-iptables-1.4.21.txt --]
[-- Type: text/plain, Size: 1719 bytes --]
Eric Dumazet (1):
xt_socket: add --nowildcard flag
Florian Westphal (3):
extensions: libxt_socket: update man page
doc: add libnetfilter_queue pointer to libxt_NFQUEUE.man
doc: merge ip6table man pages into ipv4 ones
Jozsef Kadlecsik (1):
extensions: libxt_set, libxt_SET: check the set family too
Kevin Cernekee (1):
ip6tables: Use consistent exit code for EAGAIN
Laurence J. Lane (8):
iptables: libxt_hashlimit.man: correct address
iptables: libxt_conntrack.man extraneous commas
iptables: libip(6)t_REJECT.man default icmp types
iptables: iptables-xm1.1 correct man section
iptables: libxt_recent.{c,man} dead URL
iptables: libxt_string.man add examples
extensions: libxt_LOG: use generic syslog reference in manpage
iptables: extensions/GNUMakefile.in use CPPFLAGS
Lutz Jaenicke (1):
iptables: correctly reference generated file
Pablo Neira Ayuso (7):
Merge branch 'stable-1.4.20'
Merge branch 'stable-1.4.20'
ip[6]tables: fix incorrect alignment in commands_v_options
build: add software version to manpage first line at configure stage
extensions: libxt_cluster: add note on arptables-jf
utils: nfsynproxy: fix error while compiling the BPF filter
iptables 1.4.21 release
Patrick McHardy (2):
extensions: add SYNPROXY extension
utils: add nfsynproxy tool
Phil Oester (4):
iptables: state match incompatibilty across versions
libxtables: xtables_ipmask_to_numeric incorrect with non-CIDR masks
iptables: improve chain name validation
iptables: spurious error in load_extension
stephen hemminger (1):
xtables: trivial spelling fix
^ permalink raw reply
* FEC performance degradation on iMX28 with forced link media
From: Hector Palacios @ 2013-11-22 12:40 UTC (permalink / raw)
To: netdev@vger.kernel.org; +Cc: fabio.estevam@freescale.com, Marek Vasut
Hello,
When forcing the Ethernet PHY link media with ethtool/mii-tool on the i.MX28 I've seen
important performance degradation as the packet size increases.
On the target:
# mii-tool eth0 -F 10baseT-FD
# netpipe
On the host:
# netpipe -h <target-ip> -n 1
...
44: 1024 bytes 1 times --> 6.56 Mbps in 1191.00 usec
45: 1027 bytes 1 times --> 6.56 Mbps in 1193.52 usec
46: 1533 bytes 1 times --> 0.60 Mbps in 19600.54 usec
47: 1536 bytes 1 times --> 0.46 Mbps in 25262.52 usec
48: 1539 bytes 1 times --> 0.57 Mbps in 20745.54 usec
49: 2045 bytes 1 times --> 0.74 Mbps in 20971.95 usec
...
On loop 46, as the packet size exceeds the MTU (1500) performance falls from 6.56Mbps
to 0.60Mbps.
Going back to 100baseTX-FD, but still forced (autonegotiation off), the same occurs:
On the target:
# mii-tool eth0 -F 100baseTx-FD
# netpipe
On the host:
# netpipe -h <target-ip> -n 1
...
58: 6141 bytes 1 times --> 39.74 Mbps in 1179.03 usec
59: 6144 bytes 1 times --> 41.83 Mbps in 1120.51 usec
60: 6147 bytes 1 times --> 41.39 Mbps in 1133.03 usec
61: 8189 bytes 1 times --> 6.36 Mbps in 9823.94 usec
62: 8192 bytes 1 times --> 6.56 Mbps in 9521.46 usec
63: 8195 bytes 1 times --> 6.56 Mbps in 9532.99 usec
...
only this time it happens with a larger packet size (8189 bytes).
With autonegotiation on, performance is ok and does not suffer these drops.
I've reproduced this on the mx28evk board but it also happens in my hardware, with
different PHY on v3.10.
I also tried on an old v2.6.35 kernel and the issue was reproducible as well, though
it happened with larger packet sizes than it happens with v3.10:
...
75: 32771 bytes 1 times --> 49.64 Mbps in 5036.50 usec
76: 49149 bytes 1 times --> 46.18 Mbps in 8120.48 usec
77: 49152 bytes 1 times --> 43.30 Mbps in 8660.46 usec
78: 49155 bytes 1 times --> 40.10 Mbps in 9351.46 usec
79: 65533 bytes 1 times --> 2.03 Mbps in 246061.04 usec
80: 65536 bytes 1 times --> 2.21 Mbps in 226516.50 usec
81: 65539 bytes 1 times --> 1.45 Mbps in 344196.46 usec
...
Could there be any issue with packet fragmentation?
I tried the same on imx6sabresd but here the issue is not reproducible. I don't know
if the higher CPU frequency might be hiding the problem, though.
Any idea about what can make the difference between forcing media vs autonegotiation?
Best regards,
--
Hector Palacios
^ permalink raw reply
* [ANNOUNCE] ulogd 2.0.3 release
From: Eric Leblond @ 2013-11-22 13:04 UTC (permalink / raw)
To: netfilter-devel; +Cc: netdev, netfilter, netfilter-announce, lwn
[-- Attachment #1.1: Type: text/plain, Size: 987 bytes --]
Hi!
The Netfilter project proudly presents:
ulogd 2.0.3
ulogd is a userspace logging daemon for netfilter/iptables related
logging. This includes per-packet logging of security violations,
per-packet logging for accounting, per-flow logging and flexible
user-defined accounting.
ulogd 2.0.3 features major improvements in the database output:
* Optional backlog system to avoid event loss in case of database
downtime
* Optional running mode where acquisition is made in one thread
and queries to databases are made in separate threads
See ChangeLog that comes attached to this email for more details.
Thanks to Chris Boot, Ilya Tumaykin, Ulrich Weber and Victor Julien for
their contributions to this release of ulogd.
You can download it from:
http://www.netfilter.org/projects/ulogd/downloads.html
ftp://ftp.netfilter.org/pub/ulogd/
Have fun!
--
Eric Leblond <eric@regit.org>
Blog: https://home.regit.org/
[-- Attachment #1.2: changes-ulogd-2.0.3.txt --]
[-- Type: text/plain, Size: 1351 bytes --]
Chris Boot (3):
ulogd: Perform nice() before giving up root
ulogd: Implement PID file writing
ulogd: ulogd_inppkt_NFLOG: close nflog handle after unbinding
Eric Leblond (17):
nfct: use timestamp of conntrack object.
ulogd: change verbosity of a message
ulogd: display stack during configuration
postgresql: add sanity checking
mysql: add sanity checking
sqlite3: add sanity checking
db: store data in memory during database downtime
db: suppress field in db structure
db: use offset instead of direct pointer.
db: add ring buffer for DB query
db: disable SIGHUP if ring buffer is used.
db: db ring has precedence over backlog.
Improve pid file handling.
pgsql: add var to specify arbitrary conn params
ulogd.conf: add missing quote.
ulogd: use daemon() function
Set release number to 2.0.3.
Ilya Tumaykin (1):
Fix automagic support of dbi, pcap and sqlite3
Pablo Neira Ayuso (2):
ulogd: close logfile description in the exit path of parent process
Revert "ulogd: close logfile description in the exit path of parent process"
Ulrich Weber (1):
nfct: make NFCT packet counter/length 64 bit
Victor Julien (1):
Exec libmnl config check only if nfacct is enabled
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH net RESEND] bonding: don't change to 802.3ad mode while ARP monitoring is running
From: Nikolay Aleksandrov @ 2013-11-22 13:36 UTC (permalink / raw)
To: Andy Gospodarek, Dan Williams, David Miller
Cc: dingtianhong, fubar, vfalico, netdev
In-Reply-To: <528ACD8A.1010409@greyhouse.net>
On 11/19/2013 03:31 AM, Andy Gospodarek wrote:
> On 11/18/2013 05:50 PM, Dan Williams wrote:
>> On Mon, 2013-11-18 at 15:48 -0500, David Miller wrote:
>>> From: Dan Williams <dcbw@redhat.com>
>>> Date: Mon, 18 Nov 2013 11:44:42 -0600
>>>
>>>> On Sat, 2013-11-16 at 14:30 +0800, Ding Tianhong wrote:
>>>>> Because the ARP monitoring is not support for 802.3ad, but I still
>>>>> could change the mode to 802.3ad from ab mode while ARP monitoring
>>>>> is running, it is incorrect.
>>>>>
>>>>> So add a check for 802.3ad in bonding_store_mode to fix the problem,
>>>>> and make a new macro BOND_NO_USES_ARP() to simplify the code.
>>>> Instead of failing, couldn't the code stop ARP monitoring and allow the
>>>> mode change? This is similar to setting miimon, which disables ARP
>>>> monitoring, or setting ARP monitoring, which disables miimon.
>>>>
>>>> if (new_value && bond->params.arp_interval) {
>>>> pr_info("%s: MII monitoring cannot be used with ARP monitoring.
>>>> Disabling ARP monitoring...\n",
>>>> bond->dev->name);
>>>> bond->params.arp_interval = 0;
>>>> if (bond->params.arp_validate)
>>>> bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
>>>> }
>>>>
>>>> Bond mode is the most important bond option, so it seems like it should
>>>> override any of the other sub-options. I know the code doesn't do this
>>>> now, but maybe instead of the patch you propose, it would be nicer to
>>>> allow the mode change instead?
>>> I agree with Dan, if other mode changes behave this way (by dropping the
>>> incompatible feature) we should make 802.3ad do so as well at the very
>>> least for consistency.
>> Currently ALB and TLB modes will fail if arp_interval > 0, so Ding's
>> patch is technically correct.
>>
>> Instead, I'm proposing that 'mode' trumps all, and if the user changes
>> the mode, conflicting values should be cleared or reset. Otherwise
>> userspace has to duplicate a lot of kernel logic/validation. For
>> example:
>>
>> 1) set mode to ROUNDROBIN
>> 2) set arp_interval
>> 3) set mode to ALB or TLB
>> 4) FAIL - incompatible with arp_interval
>> 5) ok, set arp_interval to zero
>> 6) set mode to ALB or TLB
>> 7) SUCCESS
>>
>> Wouldn't it be nice if the kernel handled clearing arp_interval for us,
>> since it knows that arp_interval is incompatible with ALB/TLB...
>>
>> Could be done separately. I have no objection to Ding's patch other
>> than "life could be even better".
>>
>> Dan
> Nik was actually planning to work on a pretty significant rewrite of the code
> that handles setting and clearing of different config options, but I have not
> seen him chime in on this thread yet.
>
> Nik, anything you can share on this or are you still a bit away from coming up
> with a design and implementation?
>
Oops sorry, it seems I've missed this thread and saw it just now. I'm working on
the new option code, but it's far from ready yet. I personally don't mind for
such patch to go in *now*, I can always re-work it once net-next opens up.
Cheers,
Nik
^ permalink raw reply
* Re: [PATCH net v2] bonding: disable arp and enable mii monitoring when bond change to no uses arp mode
From: Nikolay Aleksandrov @ 2013-11-22 13:55 UTC (permalink / raw)
To: Ding Tianhong, Andy Gospodarek, Dan Williams, David Miller
Cc: fubar, vfalico, netdev
In-Reply-To: <528EBD96.2090706@huawei.com>
On 11/22/2013 03:12 AM, Ding Tianhong wrote:
> Because the ARP monitoring is not support for 802.3ad, but I still
> could change the mode to 802.3ad from ab mode while ARP monitoring
> is running, it is incorrect.
>
> So add a check for 802.3ad in bonding_store_mode to fix the problem,
> and make a new macro BOND_NO_USES_ARP() to simplify the code.
>
> v2: according to the Dan Williams's suggestion, bond mode is the most
> important bond option, it should override any of the other sub-options.
> So when the mode is changed, the conficting values should be cleared
> or reset, otherwise the user has to duplicate more operations to modify
> the logic. I disable the arp and enable mii monitoring when the bond mode
> is changed to AB, TB and 8023AD if the arp interval is true.
>
> Suggested-by: Dan Williams <dcbw@redhat.com>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> ---
> drivers/net/bonding/bond_options.c | 13 +++++++++----
> drivers/net/bonding/bonding.h | 5 +++++
> 2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
> index 9a5223c..04364f7a 100644
> --- a/drivers/net/bonding/bond_options.c
> +++ b/drivers/net/bonding/bond_options.c
> @@ -45,10 +45,15 @@ int bond_option_mode_set(struct bonding *bond, int mode)
> return -EPERM;
> }
>
> - if (BOND_MODE_IS_LB(mode) && bond->params.arp_interval) {
> - pr_err("%s: %s mode is incompatible with arp monitoring.\n",
> - bond->dev->name, bond_mode_tbl[mode].modename);
> - return -EINVAL;
> + if (BOND_NO_USES_ARP(mode) && bond->params.arp_interval) {
> + pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n",
> + bond->dev->name, bond_mode_tbl[mode].modename);
> + /* disable arp monitoring */
> + bond->params.arp_interval = 0;
> + /* set miimon to default value */
> + bond->params.miimon = 100;
> + pr_info("%s: Setting MII monitoring interval to %d.\n",
> + bond->dev->name, bond->params.miimon);
> }
>
Maybe define the "default" miimon value somewhere ? A value of 100 for miimon is
used repeatedly in bond_check_params() as well, it'd be nice to give it a name,
e.g. I had to grep around to see why you chose 100 to be that value.
> /* don't cache arp_validate between modes */
> diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
> index ca31286..a310fb5 100644
> --- a/drivers/net/bonding/bonding.h
> +++ b/drivers/net/bonding/bonding.h
> @@ -55,6 +55,11 @@
> ((mode) == BOND_MODE_TLB) || \
> ((mode) == BOND_MODE_ALB))
>
> +#define BOND_NO_USES_ARP(mode) \
> + (((mode) == BOND_MODE_8023AD) || \
> + ((mode) == BOND_MODE_TLB) || \
> + ((mode) == BOND_MODE_ALB))
> +
> #define TX_QUEUE_OVERRIDE(mode) \
> (((mode) == BOND_MODE_ACTIVEBACKUP) || \
> ((mode) == BOND_MODE_ROUNDROBIN))
>
One small note, you can save a few lines in bond_sysfs.c if you switch
the check in bonding_store_arp_interval() to the new macro BOND_NO_USES_ARP()
as it's identical.
Cheers,
Nik
^ permalink raw reply
* Re: [PATCH net v2] bonding: disable arp and enable mii monitoring when bond change to no uses arp mode
From: Ding Tianhong @ 2013-11-22 14:12 UTC (permalink / raw)
To: Nikolay Aleksandrov, Andy Gospodarek, Dan Williams, David Miller
Cc: fubar, vfalico, netdev
In-Reply-To: <528F6247.2080007@redhat.com>
On 2013/11/22 21:55, Nikolay Aleksandrov wrote:
> On 11/22/2013 03:12 AM, Ding Tianhong wrote:
>> Because the ARP monitoring is not support for 802.3ad, but I still
>> could change the mode to 802.3ad from ab mode while ARP monitoring
>> is running, it is incorrect.
>>
>> So add a check for 802.3ad in bonding_store_mode to fix the problem,
>> and make a new macro BOND_NO_USES_ARP() to simplify the code.
>>
>> v2: according to the Dan Williams's suggestion, bond mode is the most
>> important bond option, it should override any of the other sub-options.
>> So when the mode is changed, the conficting values should be cleared
>> or reset, otherwise the user has to duplicate more operations to modify
>> the logic. I disable the arp and enable mii monitoring when the bond mode
>> is changed to AB, TB and 8023AD if the arp interval is true.
>>
>> Suggested-by: Dan Williams <dcbw@redhat.com>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>> ---
>> drivers/net/bonding/bond_options.c | 13 +++++++++----
>> drivers/net/bonding/bonding.h | 5 +++++
>> 2 files changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>> index 9a5223c..04364f7a 100644
>> --- a/drivers/net/bonding/bond_options.c
>> +++ b/drivers/net/bonding/bond_options.c
>> @@ -45,10 +45,15 @@ int bond_option_mode_set(struct bonding *bond, int mode)
>> return -EPERM;
>> }
>>
>> - if (BOND_MODE_IS_LB(mode) && bond->params.arp_interval) {
>> - pr_err("%s: %s mode is incompatible with arp monitoring.\n",
>> - bond->dev->name, bond_mode_tbl[mode].modename);
>> - return -EINVAL;
>> + if (BOND_NO_USES_ARP(mode) && bond->params.arp_interval) {
>> + pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n",
>> + bond->dev->name, bond_mode_tbl[mode].modename);
>> + /* disable arp monitoring */
>> + bond->params.arp_interval = 0;
>> + /* set miimon to default value */
>> + bond->params.miimon = 100;
>> + pr_info("%s: Setting MII monitoring interval to %d.\n",
>> + bond->dev->name, bond->params.miimon);
>> }
>>
> Maybe define the "default" miimon value somewhere ? A value of 100 for miimon is
> used repeatedly in bond_check_params() as well, it'd be nice to give it a name,
> e.g. I had to grep around to see why you chose 100 to be that value.
>
yes, I get it from bond_check_params(), I think it is time to give it a new name, MIIMON_DEFAULT_VALUE = 100.
>> /* don't cache arp_validate between modes */
>> diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
>> index ca31286..a310fb5 100644
>> --- a/drivers/net/bonding/bonding.h
>> +++ b/drivers/net/bonding/bonding.h
>> @@ -55,6 +55,11 @@
>> ((mode) == BOND_MODE_TLB) || \
>> ((mode) == BOND_MODE_ALB))
>>
>> +#define BOND_NO_USES_ARP(mode) \
>> + (((mode) == BOND_MODE_8023AD) || \
>> + ((mode) == BOND_MODE_TLB) || \
>> + ((mode) == BOND_MODE_ALB))
>> +
>> #define TX_QUEUE_OVERRIDE(mode) \
>> (((mode) == BOND_MODE_ACTIVEBACKUP) || \
>> ((mode) == BOND_MODE_ROUNDROBIN))
>>
> One small note, you can save a few lines in bond_sysfs.c if you switch
> the check in bonding_store_arp_interval() to the new macro BOND_NO_USES_ARP()
> as it's identical.
>
> Cheers,
> Nik
good idea.
Regards.
Ding
>
>
> .
>
^ permalink raw reply
* Re: [PATCH] sctp: Restore 'resent' bit to avoid retransmitted chunks for RTT measurements
From: Vlad Yasevich @ 2013-11-22 14:18 UTC (permalink / raw)
To: Xufeng Zhang, nhorman; +Cc: davem, linux-sctp, netdev, linux-kernel
In-Reply-To: <1385109031-4246-1-git-send-email-xufeng.zhang@windriver.com>
On 11/22/2013 03:30 AM, Xufeng Zhang wrote:
> From: Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
>
> Currently retransmitted DATA chunks could also be used for
> RTT measurements since there are no flag to identify whether
> the transmitted DATA chunk is a new one or a retransmitted one.
> This problem is introduced by commit ae19c5486 ("sctp: remove
> 'resent' bit from the chunk") which inappropriately removed the
> 'resent' bit completely, instead of doing this, we should set
> the resent bit only for the retransmitted DATA chunks.
>
> Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
> ---
> include/net/sctp/structs.h | 1 +
> net/sctp/output.c | 23 +++++++++++++----------
> net/sctp/outqueue.c | 3 +++
> net/sctp/sm_make_chunk.c | 1 +
> 4 files changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
> index 2174d8d..ea0ca5f 100644
> --- a/include/net/sctp/structs.h
> +++ b/include/net/sctp/structs.h
> @@ -629,6 +629,7 @@ struct sctp_chunk {
> #define SCTP_NEED_FRTX 0x1
> #define SCTP_DONT_FRTX 0x2
> __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */
> + resent:1, /* Has this chunk ever been resent. */
> has_tsn:1, /* Does this chunk have a TSN yet? */
> has_ssn:1, /* Does this chunk have a SSN yet? */
> singleton:1, /* Only chunk in the packet? */
> diff --git a/net/sctp/output.c b/net/sctp/output.c
> index e650978..32c214d 100644
> --- a/net/sctp/output.c
> +++ b/net/sctp/output.c
> @@ -467,17 +467,20 @@ int sctp_packet_transmit(struct sctp_packet *packet)
> list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) {
> list_del_init(&chunk->list);
> if (sctp_chunk_is_data(chunk)) {
> - /* 6.3.1 C4) When data is in flight and when allowed
> - * by rule C5, a new RTT measurement MUST be made each
> - * round trip. Furthermore, new RTT measurements
> - * SHOULD be made no more than once per round-trip
> - * for a given destination transport address.
> - */
> -
> - if (!tp->rto_pending) {
> - chunk->rtt_in_progress = 1;
> - tp->rto_pending = 1;
> + if (!chunk->resent) {
> + /* 6.3.1 C4) When data is in flight and when allowed
> + * by rule C5, a new RTT measurement MUST be made each
> + * round trip. Furthermore, new RTT measurements
> + * SHOULD be made no more than once per round-trip
> + * for a given destination transport address.
> + */
> +
> + if (!tp->rto_pending) {
Could be combined as
if (!chunk->resent && !tp->rto_pending) {
> + chunk->rtt_in_progress = 1;
> + tp->rto_pending = 1;
> + }
> }
> +
> has_data = 1;
> }
>
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 94df758..70f4f56 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -446,6 +446,8 @@ void sctp_retransmit_mark(struct sctp_outq *q,
> transport->rto_pending = 0;
> }
>
> + chunk->resent = 1;
> +
> /* Move the chunk to the retransmit queue. The chunks
> * on the retransmit queue are always kept in order.
> */
> @@ -1375,6 +1377,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
> * instance).
> */
> if (!tchunk->tsn_gap_acked &&
> + !tchunk->resent &&
> tchunk->rtt_in_progress) {
> tchunk->rtt_in_progress = 0;
> rtt = jiffies - tchunk->sent_at;
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index fe69032..8fe89f8 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -1321,6 +1321,7 @@ struct sctp_chunk *sctp_chunkify(struct sk_buff *skb,
> INIT_LIST_HEAD(&retval->list);
> retval->skb = skb;
> retval->asoc = (struct sctp_association *)asoc;
> + retval->resent = 0;
Not needed due to zeroed out malloc.
-vlad
> retval->singleton = 1;
>
> retval->fast_retransmit = SCTP_CAN_FRTX;
>
^ permalink raw reply
* Re: [PATCH] net: sctp: set chunk->tsn_gap_acked at the end of cycle
From: Vlad Yasevich @ 2013-11-22 14:27 UTC (permalink / raw)
To: Chang Xiangzhong, nhorman, davem; +Cc: linux-sctp, netdev, linux-kernel
In-Reply-To: <1385106589-402-1-git-send-email-changxiangzhong@gmail.com>
On 11/22/2013 02:49 AM, Chang Xiangzhong wrote:
> tsn_gap_acked is an important state flag in chunk, which indicates if the
> chunk has been acked in gap reports before.
Actually, this bit indicates simply that the chunk has been acked. It
doesn't state whether it's been acked in a gap report or via cumulative tsn.
> SFR-CACC algorithm depends on this
> variable. So set this at the end of each iteration, otherwise the SFR-CACC
> algorithm would never be toggled.
>
> Signed-off-by: Chang Xiangzhong <changxiangzhong@gmail.com>
> ---
> net/sctp/outqueue.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 1b494fa..bff828c 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -1396,7 +1396,6 @@ static void sctp_check_transmitted(struct sctp_outq *q,
> * while DATA was outstanding).
> */
> if (!tchunk->tsn_gap_acked) {
> - tchunk->tsn_gap_acked = 1;
> if (TSN_lt(*highest_new_tsn_in_sack, tsn))
> *highest_new_tsn_in_sack = tsn;
> bytes_acked += sctp_data_size(tchunk);
> @@ -1460,6 +1459,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,
> */
> list_add_tail(lchunk, &tlist);
> }
> +
> + tchunk->tsn_gap_acked = 1;
The current code will set the state if it hasn't been set yet. Why is
this needed?
Now there is an issue with tracking highest_new_tsn_in_sack. The spec
is a little vague on this, but the highest_new_tsn_in_sack only supposed
to track tsns that have not been resent. If a tsn has been reneged, and
then sent again, it is not considered 'new' thus should not count
toward highest_new_tsn_in_sack. We currently do not track this right.
-vlad
-vlad
> } else {
> if (tchunk->tsn_gap_acked) {
> pr_debug("%s: receiver reneged on data TSN:0x%x\n",
>
^ permalink raw reply
* [PATCH net v3] bonding: disable arp and enable mii monitoring when bond change to no uses arp mode
From: Ding Tianhong @ 2013-11-22 14:28 UTC (permalink / raw)
To: Andy Gospodarek, Dan Williams, David Miller
Cc: fubar, nikolay, vfalico, netdev
In-Reply-To: <528ACD8A.1010409@greyhouse.net>
Because the ARP monitoring is not support for 802.3ad, but I still
could change the mode to 802.3ad from ab mode while ARP monitoring
is running, it is incorrect.
So add a check for 802.3ad in bonding_store_mode to fix the problem,
and make a new macro BOND_NO_USES_ARP() to simplify the code.
v2: according to the Dan Williams's suggestion, bond mode is the most
important bond option, it should override any of the other sub-options.
So when the mode is changed, the conficting values should be cleared
or reset, otherwise the user has to duplicate more operations to modify
the logic. I disable the arp and enable mii monitoring when the bond mode
is changed to AB, TB and 8023AD if the arp interval is true.
v3: according to the Nik's suggestion, the default value of miimon should need
a name, there is several place to use it, and the bond_store_arp_interval()
could use micro BOND_NO_USES_ARP to make the code more simpify.
Suggested-by: Dan Williams <dcbw@redhat.com>
Suggested-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/bonding/bond_main.c | 4 ++--
drivers/net/bonding/bond_options.c | 13 +++++++++----
drivers/net/bonding/bond_sysfs.c | 4 +---
drivers/net/bonding/bonding.h | 7 +++++++
4 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4dd5ee2..36eab0c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4110,7 +4110,7 @@ static int bond_check_params(struct bond_params *params)
if (!miimon) {
pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
pr_warning("Forcing miimon to 100msec\n");
- miimon = 100;
+ miimon = BOND_DEFAULT_MIIMON;
}
}
@@ -4147,7 +4147,7 @@ static int bond_check_params(struct bond_params *params)
if (!miimon) {
pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n");
pr_warning("Forcing miimon to 100msec\n");
- miimon = 100;
+ miimon = BOND_DEFAULT_MIIMON;
}
}
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 9a5223c..ea6f640 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -45,10 +45,15 @@ int bond_option_mode_set(struct bonding *bond, int mode)
return -EPERM;
}
- if (BOND_MODE_IS_LB(mode) && bond->params.arp_interval) {
- pr_err("%s: %s mode is incompatible with arp monitoring.\n",
- bond->dev->name, bond_mode_tbl[mode].modename);
- return -EINVAL;
+ if (BOND_NO_USES_ARP(mode) && bond->params.arp_interval) {
+ pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n",
+ bond->dev->name, bond_mode_tbl[mode].modename);
+ /* disable arp monitoring */
+ bond->params.arp_interval = 0;
+ /* set miimon to default value */
+ bond->params.miimon = BOND_DEFAULT_MIIMON;
+ pr_info("%s: Setting MII monitoring interval to %d.\n",
+ bond->dev->name, bond->params.miimon);
}
/* don't cache arp_validate between modes */
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 0ec2a7e..abf5e10 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -523,9 +523,7 @@ static ssize_t bonding_store_arp_interval(struct device *d,
ret = -EINVAL;
goto out;
}
- if (bond->params.mode == BOND_MODE_ALB ||
- bond->params.mode == BOND_MODE_TLB ||
- bond->params.mode == BOND_MODE_8023AD) {
+ if (BOND_NO_USES_ARP(bond->params.mode)) {
pr_info("%s: ARP monitoring cannot be used with ALB/TLB/802.3ad. Only MII monitoring is supported on %s.\n",
bond->dev->name, bond->dev->name);
ret = -EINVAL;
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index ca31286..a9f4f9f 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -35,6 +35,8 @@
#define BOND_MAX_ARP_TARGETS 16
+#define BOND_DEFAULT_MIIMON 100
+
#define IS_UP(dev) \
((((dev)->flags & IFF_UP) == IFF_UP) && \
netif_running(dev) && \
@@ -55,6 +57,11 @@
((mode) == BOND_MODE_TLB) || \
((mode) == BOND_MODE_ALB))
+#define BOND_NO_USES_ARP(mode) \
+ (((mode) == BOND_MODE_8023AD) || \
+ ((mode) == BOND_MODE_TLB) || \
+ ((mode) == BOND_MODE_ALB))
+
#define TX_QUEUE_OVERRIDE(mode) \
(((mode) == BOND_MODE_ACTIVEBACKUP) || \
((mode) == BOND_MODE_ROUNDROBIN))
--
1.8.0
^ permalink raw reply related
* Re: [PATCH net v3] vti: fix spd lookup: match plaintext pkt, not ipsec pkt
From: Christophe Gouault @ 2013-11-22 14:33 UTC (permalink / raw)
To: Steffen Klassert
Cc: David S. Miller, Herbert Xu, netdev, Saurabh Mohan,
Sergei Shtylyov, Eric Dumazet
In-Reply-To: <20131121121246.GD31491@secunet.com>
On 11/21/2013 01:12 PM, Steffen Klassert wrote:
> On Wed, Nov 06, 2013 at 09:05:53AM +0100, Christophe Gouault wrote:
>>
>> @@ -133,7 +134,13 @@ static int vti_rcv(struct sk_buff *skb)
>> * only match policies with this mark.
>> */
>> skb->mark = be32_to_cpu(tunnel->parms.o_key);
>> + /* The packet is decrypted, but not yet decapsulated.
>> + * Temporarily make network_header point to the inner header
>> + * for policy check.
>> + */
>> + skb_reset_network_header(skb);
>> ret = xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb);
>
> If we do it like this, we would do an input policy check even for
> packets that should be forwarded. I think that's a bit odd.
Admittedly, a forward policy check would be more appropriate for
forwarded traffic.
> If we really change to match plaintext traffic, we should do
> it like Fan Du proposed. Remove the policy check here and
> let the further layers do the policy enforcement. All we
> have to do is to set the skb mark, then the lookup should
> match the vti policy.
This solution sounds seductive, however, we must be careful because we
change the skb input device (from the physical interface to the vti
interface). So we are supposed to call skb_scrub_packet as is normally
done when decapsulating a packet from a tunnel. This will reset the skb
secpath and mark, and hence will compromise the deferred inbound policy
check.
> It is already clear that this packet was IPsec transformed
> when it enters vti_rcv, so deferring the policy check should
> be ok.
I had in mind to later support cross netns in vti interfaces like for
ipip tunnels (different netns for the decapsulated and encapsulated
packets). With the deferred inbound policy check, the SA and SP will not
be in the same netns, this will cause problems for the inbound policy check.
Best Regards,
Christophe
^ permalink raw reply
* Re: [PATCH] net: sched: tbf: fix an oops when a GSO packet cannot be enqueued
From: Eric Dumazet @ 2013-11-22 14:50 UTC (permalink / raw)
To: Yang Yingliang; +Cc: davem, netdev, ben, jpirko, jhs
In-Reply-To: <1385112446-15564-1-git-send-email-yangyingliang@huawei.com>
On Fri, 2013-11-22 at 17:27 +0800, Yang Yingliang wrote:
> It seems commit e43ac79a4b("sch_tbf: segment too big GSO packets")
> introduce this oops.
>
> When GSO mode is on, use the following command:
> tc qdisc add dev eth0 root handle 1: tbf latency 50ms burst 1KB rate 50mbit mtu 1KB
> iperf -c host -t 30
I think your patch is not needed, the stack trace point to a different
spot.
The issue should be fixed by :
http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=9d8506cc2d7ea1f911c72c100193a3677f6668c3
Could you check again ?
Thanks
^ permalink raw reply
* [PATCH 1/5] net: MOXA ART: clear TX descriptor length bits between sends
From: Jonas Jensen @ 2013-11-22 14:57 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-arm-kernel, linux-kernel, Jonas Jensen
Add TX_DESC1_BUF_SIZE_MASK to bits that are cleared, before the TX buffer
length is set. Failing to do so can cause the controller to drop dead
i.e. all TX interrupts stop, resulting in complete communication failure.
Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
Notes:
Applies to next-20131122
drivers/net/ethernet/moxa/moxart_ether.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
index cbd0133..3c14afd 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.c
+++ b/drivers/net/ethernet/moxa/moxart_ether.c
@@ -349,7 +349,8 @@ static int moxart_mac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
txdes1 = readl(desc + TX_REG_OFFSET_DESC1);
txdes1 |= TX_DESC1_LTS | TX_DESC1_FTS;
- txdes1 &= ~(TX_DESC1_FIFO_COMPLETE | TX_DESC1_INTR_COMPLETE);
+ txdes1 &= ~(TX_DESC1_FIFO_COMPLETE | TX_DESC1_INTR_COMPLETE |
+ TX_DESC1_BUF_SIZE_MASK);
txdes1 |= (len & TX_DESC1_BUF_SIZE_MASK);
writel(txdes1, desc + TX_REG_OFFSET_DESC1);
writel(TX_DESC0_DMA_OWN, desc + TX_REG_OFFSET_DESC0);
--
1.8.2.1
^ permalink raw reply related
* [PATCH 2/5] net: MOXA ART: connect to PHY and add ethtool support
From: Jonas Jensen @ 2013-11-22 14:57 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-arm-kernel, linux-kernel, Jonas Jensen
In-Reply-To: <1385132242-3204-1-git-send-email-jonas.jensen@gmail.com>
The kernel now has a MDIO bus driver and a phy_driver (RTL8201CP),
connect to this PHY using OF and add ethtool support.
Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
Notes:
Applies to next-20131122
drivers/net/ethernet/moxa/moxart_ether.c | 179 ++++++++++++++++++++++++++++++-
drivers/net/ethernet/moxa/moxart_ether.h | 1 +
2 files changed, 179 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
index 3c14afd..bcc6005 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.c
+++ b/drivers/net/ethernet/moxa/moxart_ether.c
@@ -26,9 +26,15 @@
#include <linux/of_irq.h>
#include <linux/crc32.h>
#include <linux/crc32c.h>
+#include <linux/phy.h>
+#include <linux/of_mdio.h>
#include "moxart_ether.h"
+#define DRV_NAME "moxart-ethernet"
+#define DRV_VERSION "0.2"
+#define MOXART_NUM_STATS 16
+
static inline void moxart_emac_write(struct net_device *ndev,
unsigned int reg, unsigned long value)
{
@@ -61,6 +67,145 @@ static int moxart_set_mac_address(struct net_device *ndev, void *addr)
return 0;
}
+static struct {
+ const char str[ETH_GSTRING_LEN];
+} ethtool_stats_keys[] = {
+ { "tx_ok_mcol_2to15" },
+ { "tx_ok_1col" },
+ { "rx_frame_pause" },
+ { "frame_align_err" },
+ { "err_col_late_16" },
+ { "err_col_16" },
+ { "rx_runt" },
+ { "late_col" },
+ { "crc_err" },
+ { "rx_ftl" },
+ { "rx_fifo_full" },
+ { "rx_col" },
+ { "rx_bcast" },
+ { "rx_mcast" },
+ { "rx_ok" },
+ { "tx_ok" },
+};
+
+static void moxart_get_drvinfo(struct net_device *ndev,
+ struct ethtool_drvinfo *info)
+{
+ strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
+ strlcpy(info->version, DRV_VERSION, sizeof(info->version));
+ strlcpy(info->bus_info, dev_name(&ndev->dev), sizeof(info->bus_info));
+ info->n_stats = MOXART_NUM_STATS;
+}
+
+static int moxart_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
+{
+ struct moxart_mac_priv_t *priv = netdev_priv(ndev);
+
+ if (!priv->phy_dev)
+ return -ENODEV;
+
+ return phy_ethtool_gset(priv->phy_dev, cmd);
+}
+
+static int moxart_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
+{
+ struct moxart_mac_priv_t *priv = netdev_priv(ndev);
+
+ if (!priv->phy_dev)
+ return -ENODEV;
+
+ return phy_ethtool_sset(priv->phy_dev, cmd);
+}
+
+static int moxart_nway_reset(struct net_device *ndev)
+{
+ struct moxart_mac_priv_t *priv = netdev_priv(ndev);
+
+ if (!priv->phy_dev)
+ return -EINVAL;
+
+ return genphy_restart_aneg(priv->phy_dev);
+}
+
+static void moxart_get_ethtool_stats(struct net_device *ndev,
+ struct ethtool_stats *estats,
+ u64 *tmp_stats)
+{
+ struct moxart_mac_priv_t *priv = netdev_priv(ndev);
+ u32 s;
+ int i = 0;
+
+ s = readl(priv->base + REG_TX_COL_COUNTER);
+ tmp_stats[i++] = s & 0xffff0000;
+ tmp_stats[i++] = s & 0x0000ffff;
+ s = readl(priv->base + REG_RPF_AEP_COUNTER);
+ tmp_stats[i++] = s & 0xffff0000;
+ tmp_stats[i++] = s & 0x0000ffff;
+ s = readl(priv->base + REG_XM_PG_COUNTER);
+ tmp_stats[i++] = s & 0xffff0000;
+ tmp_stats[i++] = s & 0x0000ffff;
+ s = readl(priv->base + REG_RUNT_TLC_COUNTER);
+ tmp_stats[i++] = s & 0xffff0000;
+ tmp_stats[i++] = s & 0x0000ffff;
+ s = readl(priv->base + REG_CRC_FTL_COUNTER);
+ tmp_stats[i++] = s & 0xffff0000;
+ tmp_stats[i++] = s & 0x0000ffff;
+ s = readl(priv->base + REG_RLC_RCC_COUNTER);
+ tmp_stats[i++] = s & 0xffff0000;
+ tmp_stats[i++] = s & 0x0000ffff;
+ tmp_stats[i++] = readl(priv->base + REG_BROC_COUNTER);
+ tmp_stats[i++] = readl(priv->base + REG_MULCA_COUNTER);
+ tmp_stats[i++] = readl(priv->base + REG_XP_COUNTER);
+ tmp_stats[i++] = readl(priv->base + REG_RP_COUNTER);
+}
+
+static int moxart_get_sset_count(struct net_device *netdev,
+ int string_set)
+{
+ switch (string_set) {
+ case ETH_SS_STATS:
+ return MOXART_NUM_STATS;
+ default:
+ return -EINVAL;
+ }
+}
+
+static void moxart_get_strings(struct net_device *dev, u32 stringset, u8 *data)
+{
+ switch (stringset) {
+ case ETH_SS_STATS:
+ memcpy(data, ðtool_stats_keys, sizeof(ethtool_stats_keys));
+ break;
+ default:
+ WARN_ON(1);
+ break;
+ }
+}
+
+static const struct ethtool_ops moxart_ethtool_ops = {
+ .set_settings = moxart_set_settings,
+ .get_settings = moxart_get_settings,
+ .get_drvinfo = moxart_get_drvinfo,
+ .nway_reset = moxart_nway_reset,
+ .get_link = ethtool_op_get_link,
+ .get_ethtool_stats = moxart_get_ethtool_stats,
+ .get_sset_count = moxart_get_sset_count,
+ .get_strings = moxart_get_strings,
+};
+
+static int moxart_do_ioctl(struct net_device *ndev, struct ifreq *ir, int cmd)
+{
+ struct moxart_mac_priv_t *priv = netdev_priv(ndev);
+
+ if (!netif_running(ndev))
+ return -EINVAL;
+
+ if (!priv->phy_dev)
+ return -ENODEV;
+
+ return phy_mii_ioctl(priv->phy_dev, ir, cmd);
+}
+
static void moxart_mac_free_memory(struct net_device *ndev)
{
struct moxart_mac_priv_t *priv = netdev_priv(ndev);
@@ -169,6 +314,10 @@ static int moxart_mac_open(struct net_device *ndev)
moxart_update_mac_address(ndev);
moxart_mac_setup_desc_ring(ndev);
moxart_mac_enable(ndev);
+
+ if (priv->phy_dev)
+ phy_start(priv->phy_dev);
+
netif_start_queue(ndev);
netdev_dbg(ndev, "%s: IMR=0x%x, MACCR=0x%x\n",
@@ -184,6 +333,9 @@ static int moxart_mac_stop(struct net_device *ndev)
napi_disable(&priv->napi);
+ if (priv->phy_dev)
+ phy_stop(priv->phy_dev);
+
netif_stop_queue(ndev);
/* disable all interrupts */
@@ -429,12 +581,22 @@ static struct net_device_ops moxart_netdev_ops = {
.ndo_set_mac_address = moxart_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_change_mtu = eth_change_mtu,
+ .ndo_do_ioctl = moxart_do_ioctl,
};
+static void moxart_adjust_link(struct net_device *ndev)
+{
+#ifdef DEBUG
+ struct moxart_mac_priv_t *priv = netdev_priv(ndev);
+
+ phy_print_status(priv->phy_dev);
+#endif
+}
+
static int moxart_mac_probe(struct platform_device *pdev)
{
struct device *p_dev = &pdev->dev;
- struct device_node *node = p_dev->of_node;
+ struct device_node *node = p_dev->of_node, *phy_node;
struct net_device *ndev;
struct moxart_mac_priv_t *priv;
struct resource *res;
@@ -455,6 +617,20 @@ static int moxart_mac_probe(struct platform_device *pdev)
priv = netdev_priv(ndev);
priv->ndev = ndev;
+ phy_node = of_parse_phandle(node, "phy-handle", 0);
+ if (!phy_node)
+ dev_err(p_dev, "of_parse_phandle failed\n");
+
+ if (phy_node) {
+ priv->phy_dev = of_phy_connect(priv->ndev, phy_node,
+ &moxart_adjust_link,
+ 0, PHY_INTERFACE_MODE_MII);
+ if (!priv->phy_dev) {
+ dev_err(p_dev, "of_phy_connect failed\n");
+ ret = -ENODEV;
+ }
+ }
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ndev->base_addr = res->start;
priv->base = devm_ioremap_resource(p_dev, res);
@@ -516,6 +692,7 @@ static int moxart_mac_probe(struct platform_device *pdev)
ndev->irq = irq;
SET_NETDEV_DEV(ndev, &pdev->dev);
+ SET_ETHTOOL_OPS(ndev, &moxart_ethtool_ops);
ret = register_netdev(ndev);
if (ret) {
diff --git a/drivers/net/ethernet/moxa/moxart_ether.h b/drivers/net/ethernet/moxa/moxart_ether.h
index 2be9280..193618e 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.h
+++ b/drivers/net/ethernet/moxa/moxart_ether.h
@@ -297,6 +297,7 @@ struct moxart_mac_priv_t {
unsigned int reg_imr;
struct napi_struct napi;
struct net_device *ndev;
+ struct phy_device *phy_dev;
dma_addr_t rx_base;
dma_addr_t rx_mapping[RX_DESC_NUM];
--
1.8.2.1
^ permalink raw reply related
* [PATCH 4/5] net: MOXA ART: generate random address
From: Jonas Jensen @ 2013-11-22 14:57 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-arm-kernel, linux-kernel, Jonas Jensen
In-Reply-To: <1385132242-3204-1-git-send-email-jonas.jensen@gmail.com>
The address register is zero:ed on boot, fill it with a randomly generated
address on probe.
Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
Notes:
Applies to next-20131122
drivers/net/ethernet/moxa/moxart_ether.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
index 08c3905..c02075a 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.c
+++ b/drivers/net/ethernet/moxa/moxart_ether.c
@@ -700,6 +700,12 @@ static int moxart_mac_probe(struct platform_device *pdev)
goto init_fail;
}
+ if (!is_valid_ether_addr(ndev->dev_addr)) {
+ eth_hw_addr_random(ndev);
+ netdev_info(ndev, "generated random MAC address %pM\n",
+ ndev->dev_addr);
+ }
+
netdev_dbg(ndev, "%s: IRQ=%d address=%pM\n",
__func__, ndev->irq, ndev->dev_addr);
--
1.8.2.1
^ permalink raw reply related
* [PATCH 3/5] net: MOXA ART: add IFF_LIVE_ADDR_CHANGE flag
From: Jonas Jensen @ 2013-11-22 14:57 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-arm-kernel, linux-kernel, Jonas Jensen
In-Reply-To: <1385132242-3204-1-git-send-email-jonas.jensen@gmail.com>
.ndo_set_mac_address hook callback already supports IFF_LIVE_ADDR_CHANGE
so add it to our flags.
Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
Notes:
Applies to next-20131122
drivers/net/ethernet/moxa/moxart_ether.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
index bcc6005..08c3905 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.c
+++ b/drivers/net/ethernet/moxa/moxart_ether.c
@@ -688,7 +688,7 @@ static int moxart_mac_probe(struct platform_device *pdev)
ether_setup(ndev);
ndev->netdev_ops = &moxart_netdev_ops;
netif_napi_add(ndev, &priv->napi, moxart_rx_poll, RX_DESC_NUM);
- ndev->priv_flags |= IFF_UNICAST_FLT;
+ ndev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE;
ndev->irq = irq;
SET_NETDEV_DEV(ndev, &pdev->dev);
--
1.8.2.1
^ permalink raw reply related
* [PATCH 5/5] net: MOXA ART: use eth_mac_addr()
From: Jonas Jensen @ 2013-11-22 14:57 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-arm-kernel, linux-kernel, Jonas Jensen
In-Reply-To: <1385132242-3204-1-git-send-email-jonas.jensen@gmail.com>
Replace boilerplate in moxart_set_mac_address() with eth_mac_addr().
Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
Notes:
Applies to next-20131122
drivers/net/ethernet/moxa/moxart_ether.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
index c02075a..9a11d34 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.c
+++ b/drivers/net/ethernet/moxa/moxart_ether.c
@@ -56,12 +56,7 @@ static void moxart_update_mac_address(struct net_device *ndev)
static int moxart_set_mac_address(struct net_device *ndev, void *addr)
{
- struct sockaddr *address = addr;
-
- if (!is_valid_ether_addr(address->sa_data))
- return -EADDRNOTAVAIL;
-
- memcpy(ndev->dev_addr, address->sa_data, ndev->addr_len);
+ eth_mac_addr(ndev, addr);
moxart_update_mac_address(ndev);
return 0;
--
1.8.2.1
^ permalink raw reply related
* [Doubt on Implict BUGs caused LRO] doubt about lro status in v3.12 of torvalds/linux.git
From: Yanfei Wang @ 2013-11-22 15:00 UTC (permalink / raw)
To: netdev, China Kernel, linux-kernel
Hi,
Compared to the earlier kernel version, I found that Large receive
offload(LRO) is obsolete in latest kernel, and that is verified from
other materials about Generic receive offload(GRO).
However, I also found some LRO header files and lro-related
functions referred by some drivers, and the lro-related function
definition is already removed at the same time!
TEST steps:
1. my git local db config as follow, url =
http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
2. git checkout v3.12 -b 3.12
3. cd net/ipv4,
[backyes@f14 ipv4]$ cat Makefile | grep lro
obj-$(CONFIG_INET_LRO) += inet_lro.o
[backyes@f14 ipv4]$ ls inet_*
inet_connection_sock.c inet_diag.c inet_fragment.c
inet_hashtables.c inet_timewait_sock.c
[backyes@f14 ipv4]$
Here, Makefile has inet_lro.o config, while the inet_lro.c is removed.
4. lro functions referred by some drivers, as follow,
[backyes@f14 linux]$ grep "inet_lro" * -r
drivers/net/ethernet/pasemi/pasemi_mac.c:#include <linux/inet_lro.h>
drivers/net/ethernet/pasemi/pasemi_mac_ethtool.c:#include <linux/inet_lro.h>
drivers/infiniband/hw/nes/nes_hw.c:#include <linux/inet_lro.h>
drivers/infiniband/hw/nes/nes_hw.h:#include <linux/inet_lro.h>
include/linux/inet_lro.h: * linux/include/linux/inet_lro.h
net/ipv4/Makefile:obj-$(CONFIG_INET_LRO) += inet_lro.o
so, I understand that the removal of LRO is not clean, which will
cause compiler error for some kernel config.
--
Best Regard!
Yanfei Wang
^ permalink raw reply
* Re: [PATCH 2/5] net: MOXA ART: connect to PHY and add ethtool support
From: Jonas Jensen @ 2013-11-22 15:20 UTC (permalink / raw)
To: netdev
Cc: davem, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Jonas Jensen
In-Reply-To: <1385132242-3204-2-git-send-email-jonas.jensen@gmail.com>
On 22 November 2013 15:57, Jonas Jensen <jonas.jensen@gmail.com> wrote:
> drivers/net/ethernet/moxa/moxart_ether.c | 179 ++++++++++++++++++++++++++++++-
> drivers/net/ethernet/moxa/moxart_ether.h | 1 +
> 2 files changed, 179 insertions(+), 1 deletion(-)
I see now I forgot to include the devicetree binding document.
I'll wait for comments.
Thanks,
Jonas
^ permalink raw reply
* [PATCH] sit: generate icmpv6 error when receiving icmpv4 error
From: Oussama Ghorbel @ 2013-11-22 15:23 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy
Cc: netdev, linux-kernel, Oussama Ghorbel, Oussama Ghorbel
Send icmpv6 error with type "destination unreachable" and code
"address unreachable" when receiving icmpv4 error and sufficient
data bytes are available
This patch enhances the compliance of sit tunnel with section 3.4 of
rfc 4213
Signed-off-by: Oussama Ghorbel <ghorbel@pivasoftware.com>
---
net/ipv6/sit.c | 44 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 38 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 21b25dd..0146c86 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -478,14 +478,44 @@ static void ipip6_tunnel_uninit(struct net_device *dev)
dev_put(dev);
}
+/* Generate icmpv6 with type/code ICMPV6_DEST_UNREACH/ICMPV6_ADDR_UNREACH
+ * if sufficient data bytes are available
+ */
+static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb)
+{
+ const struct iphdr *iph = (const struct iphdr *) skb->data;
+ struct rt6_info *rt;
+ struct sk_buff *skb2;
+
+ if (!pskb_may_pull(skb, iph->ihl * 4 + sizeof(struct ipv6hdr) + 8))
+ return 1;
+
+ skb2 = skb_clone(skb, GFP_ATOMIC);
+
+ if (!skb2)
+ return 1;
+
+ skb_dst_drop(skb2);
+ skb_pull(skb2, iph->ihl * 4);
+ skb_reset_network_header(skb2);
+
+ rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, NULL, 0, 0);
+
+ if (rt && rt->dst.dev)
+ skb2->dev = rt->dst.dev;
+
+ icmpv6_send(skb2, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0);
+
+ if (rt)
+ ip6_rt_put(rt);
+
+ kfree_skb(skb2);
+
+ return 0;
+}
static int ipip6_err(struct sk_buff *skb, u32 info)
{
-
-/* All the routers (except for Linux) return only
- 8 bytes of packet payload. It means, that precise relaying of
- ICMP in the real Internet is absolutely infeasible.
- */
const struct iphdr *iph = (const struct iphdr *)skb->data;
const int type = icmp_hdr(skb)->type;
const int code = icmp_hdr(skb)->code;
@@ -500,7 +530,6 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
case ICMP_DEST_UNREACH:
switch (code) {
case ICMP_SR_FAILED:
- case ICMP_PORT_UNREACH:
/* Impossible event. */
return 0;
default:
@@ -545,6 +574,9 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
goto out;
err = 0;
+ if (!ipip6_err_gen_icmpv6_unreach(skb))
+ goto out;
+
if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED)
goto out;
--
1.7.9.5
^ permalink raw reply related
* Re: [ovs-dev] [PATCH openvswitch] linux: Signal datapath that unaligned Netlink message can be received
From: Sergei Shtylyov @ 2013-11-22 15:41 UTC (permalink / raw)
To: Ben Pfaff; +Cc: Thomas Graf, jesse, dev, netdev
In-Reply-To: <20131121205208.GA24729@nicira.com>
Hello.
On 22-11-2013 0:52, Ben Pfaff wrote:
>>> Following commit (''netlink: Do not enforce alignment of last Netlink
>>> attribute''), signal the ability to receive unaligned Netlink messages
>>> to the datapath to enable utilization of zerocopy optimizations.
>>> Signed-off-by: Thomas Graf <tgraf@redhat.com>
>> [...]
>>> diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
>>> index 1dcf321..5c952bc 100644
>>> --- a/lib/dpif-linux.c
>>> +++ b/lib/dpif-linux.c
>> [...]
>>> @@ -1839,6 +1841,10 @@ dpif_linux_dp_to_ofpbuf(const struct dpif_linux_dp *dp, struct ofpbuf *buf)
>>> nl_msg_put_u32(buf, OVS_DP_ATTR_UPCALL_PID, *dp->upcall_pid);
>>> }
>>>
>>> + if (dp->user_features) {
>>> + nl_msg_put_u32(buf, OVS_DP_ATTR_USER_FEATURES, dp->user_features);
>>> + }
>>> +
>>
>> {} not needed here.
> This is Open vSwitch code,
I didn't put much attention at the file name or subject but the issue
seemed just too obvious...
> so it follows Open vSwitch coding style,
> which requires the {}.
Strange style. Oh well... :-)
WBR, Sergei
^ permalink raw reply
* Possible bit/byte conversion mistake in xfrm_state.c
From: Marksteiner, Stefan @ 2013-11-22 14:54 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 860 bytes --]
Hi folks,
I might have found a little bit/byte mistake in xfrm_state.c of
iproute2-3.11.0 (and also lower versions).
In line 169 the algorithm length is set correctly ("alg->alg_key_len =
len * 8;") in bits (as it is supposed by /usr/include/linux/xfrm.h, line
101), but later in line 496 the same value is read and added to a length
value in bytes ("len += alg.u.alg.alg_key_len;").
I'm not completetly sure, but I'm wondering if this might lead to errors
for algorithms with big key sizes (>2048 bits) for the key buffer
("char buf[RTA_BUF_SIZE]" in line 274) reserves only 2048 bytes of
memory (RTA_BUF_SIZE=2048). So taking bits for bytes, the following
memcopy operation may overwrite adjacent memory areas.
Can somebody verify if this is in fact an issue? Maybe I'm reading this
whole stuff wrong.
Cheers,
Stefan
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4282 bytes --]
^ permalink raw reply
* Problem with am335x (cpsw) MDIO state machine
From: Stefan Roese @ 2013-11-22 16:06 UTC (permalink / raw)
To: Mugunthan V N; +Cc: netdev@vger.kernel.org
Hi All!
I'm currently struggling with the MDIO interface of the am335x SoC. As
its state machine continuously communicates with the potentially
available PHY devices (0...31). To determine the link status etc. But
I'm trying to communicate with am SMSC9303 switch via this MDIO
interface. It has 32bit registers organized as 2 16bit registers. These
registers need to be accessed back-to-back. Without any other frame in
between. And this is often interrupted (disturbed) by these state
machines polling frames.
Has anyone ever tried to work in this SoC with this MDIO state machine
disabled? I tried this by clearing the ENABLE bit in the MDIOCONTROL
register after each transaction. But this doesn't seem to work
(resulting in timeouts etc)?
Has anybody ever tried anything like this?
Thanks,
Stefan
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox