* Re: [PATCH] sh_eth: add/use RMCR.RNC bit
From: Simon Horman @ 2013-10-16 0:34 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, nobuhiro.iwamatsu.yj, linux-sh, davem
In-Reply-To: <201310160229.58735.sergei.shtylyov@cogentembedded.com>
On Wed, Oct 16, 2013 at 02:29:58AM +0400, Sergei Shtylyov wrote:
> Declare 'enum EMCR_BIT' containing the single member for the RMCR.RNC bit and
> replace bare numbers in the driver by this mnemonic.
>
> Suggested-by: David Miller <davem@davemloft.net>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Thanks Sergei,
this seems to move things in the right direction.
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> This patch is against DaveM's 'net.git' repo but it intended for 'net-next.git'
> repo -- it's because 'net-next.git' doesn't contain the required Simon Horman's
> patch yet.
>
> drivers/net/ethernet/renesas/sh_eth.c | 6 +++---
> drivers/net/ethernet/renesas/sh_eth.h | 3 +++
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> Index: net/drivers/net/ethernet/renesas/sh_eth.c
> ===================================================================
> --- net.orig/drivers/net/ethernet/renesas/sh_eth.c
> +++ net/drivers/net/ethernet/renesas/sh_eth.c
> @@ -483,7 +483,7 @@ static struct sh_eth_cpu_data sh7757_dat
> .register_type = SH_ETH_REG_FAST_SH4,
>
> .eesipr_value = DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff,
> - .rmcr_value = 0x00000001,
> + .rmcr_value = RMCR_RNC,
>
> .tx_check = EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | EESR_RTO,
> .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE |
> @@ -561,7 +561,7 @@ static struct sh_eth_cpu_data sh7757_dat
> EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
> EESR_TDE | EESR_ECI,
> .fdr_value = 0x0000072f,
> - .rmcr_value = 0x00000001,
> + .rmcr_value = RMCR_RNC,
>
> .irq_flags = IRQF_SHARED,
> .apr = 1,
> @@ -689,7 +689,7 @@ static struct sh_eth_cpu_data r8a7740_da
> EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
> EESR_TDE | EESR_ECI,
> .fdr_value = 0x0000070f,
> - .rmcr_value = 0x00000001,
> + .rmcr_value = RMCR_RNC,
>
> .apr = 1,
> .mpr = 1,
> Index: net/drivers/net/ethernet/renesas/sh_eth.h
> ===================================================================
> --- net.orig/drivers/net/ethernet/renesas/sh_eth.h
> +++ net/drivers/net/ethernet/renesas/sh_eth.h
> @@ -321,6 +321,9 @@ enum TD_STS_BIT {
> #define TD_TFP (TD_TFP1|TD_TFP0)
>
> /* RMCR */
> +enum RMCR_BIT {
> + RMCR_RNC = 0x00000001,
> +};
> #define DEFAULT_RMCR_VALUE 0x00000000
>
> /* ECMR */
>
^ permalink raw reply
* Re: [RFC net-next] ipv6: Use destination address determined by IPVS
From: Eric Dumazet @ 2013-10-16 0:39 UTC (permalink / raw)
To: Simon Horman
Cc: YOSHIFUJI Hideaki / 吉藤英明, lvs-devel,
netdev, Julian Anastasov, Mark Brooks
In-Reply-To: <20131016002807.GM22321@verge.net.au>
On Wed, 2013-10-16 at 09:28 +0900, Simon Horman wrote:
> > I guess things like NFQUEUE could happen ?
>
> Could you expand a little?
This was to point that between IPVS and ipv6 stack we might have a
delay, and daddr was maybe pointed to a freed memory.
IP6CB only uses 24 bytes, so I think you would be safe adding 16 bytes.
^ permalink raw reply
* Re: [RFC net-next] ipv6: Use destination address determined by IPVS
From: Hannes Frederic Sowa @ 2013-10-16 0:53 UTC (permalink / raw)
To: Simon Horman
Cc: YOSHIFUJI Hideaki / 吉藤英明, lvs-devel,
netdev, Julian Anastasov, Mark Brooks
In-Reply-To: <1381881751-6719-1-git-send-email-horms@verge.net.au>
On Wed, Oct 16, 2013 at 09:02:31AM +0900, Simon Horman wrote:
> In v3.9 6fd6ce2056de2709 ("ipv6: Do not depend on rt->n in
> ip6_finish_output2()") changed the behaviour of ip6_finish_output2()
> such that it creates and uses a neigh entry if none is found.
> Subsequently the 'n' field was removed from struct rt6_info.
>
> Unfortunately my analysis is that in the case of IPVS direct routing this
> change leads to incorrect behaviour as in this case packets may be output
> to a destination other than where they would be output according to the
> route table. In particular, the destination address may actually be a local
> address and empirically a neighbour lookup seems to result in it becoming
> unreachable.
>
> This patch resolves the problem by providing the destination address
> determined by IPVS to ip6_finish_output2() in the skb callback. Although
> this seems to work I can see several problems with this approach:
>
> * It is rather ugly, stuffing an IPVS exception right in
> the middle of IPv6 code. The overhead could be eliminated for many users
> by using a staic key. But none the less it is not attractive.
>
> * The use of the skb callback is may not be valid
> as it crosses from IPVS to IPv6 code. A possible, though unpleasant,
> alternative is to add a new field to struct sk_buff.
>
> * This covers all IPv6 packets output by IPVS but actually
> only those output using IPVS Direct-Routing need this. One way to
> resolve this would be to add a more fine-grained ipvs_property to
> struct sk_buff.
Hmm, that reminds me on the following bug report which would be nice we could
solve in one go, too: http://www.spinics.net/lists/netdev/msg250785.html
Greetings,
Hannes
^ permalink raw reply
* Re: [PATCH] bridge: Correctly clamp MAX forward_delay when enabling STP
From: Herbert Xu @ 2013-10-16 0:56 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: netdev, Stephen Hemminger
In-Reply-To: <1381863465-27304-1-git-send-email-vyasevic@redhat.com>
On Tue, Oct 15, 2013 at 02:57:45PM -0400, Vlad Yasevich wrote:
> Commit be4f154d5ef0ca147ab6bcd38857a774133f5450
> bridge: Clamp forward_delay when enabling STP
> had a typo when attempting to clamp maximum forward delay.
>
> It is possible to set bridge_forward_delay to be higher then
> permitted maximum when STP is off. When turning STP on, the
> higher then allowed delay has to be clamed down to max value.
>
> CC: Herbert Xu <herbert@gondor.apana.org.au>
> CC: Stephen Hemminger <shemminger@vyatta.com>
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Good catch!
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCHv3 net] {xfrm, sctp} Stick to software crc32 even if hardware is capable of that
From: Vlad Yasevich @ 2013-10-16 1:05 UTC (permalink / raw)
To: Fan Du, nhorman; +Cc: steffen.klassert, davem, netdev
In-Reply-To: <1381828777-15894-1-git-send-email-fan.du@windriver.com>
On 10/15/2013 05:19 AM, Fan Du wrote:
> igb/ixgbe have hardware sctp checksum support, when this feature is enabled
> and also IPsec is armed to protect sctp traffic, ugly things happened as
> xfrm_output checks CHECKSUM_PARTIAL to do check sum operation(sum every thing
> up and pack the 16bits result in the checksum field). The result is fail
> establishment of sctp communication.
>
> Signed-off-by: Fan Du <fan.du@windriver.com>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Looks good to me.
-vlad
> ---
> v3:
> - Rename is_xfrm_armed by dst_xfrm
> - Move this funtion in include/net/dst.h
>
> v2:
> - Split v1 into two separate patches.
>
> ---
> include/net/dst.h | 12 ++++++++++++
> net/sctp/output.c | 3 ++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/dst.h b/include/net/dst.h
> index 211dcf1..44995c1 100644
> --- a/include/net/dst.h
> +++ b/include/net/dst.h
> @@ -478,10 +478,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net,
> {
> return dst_orig;
> }
> +
> +static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
> +{
> + return NULL;
> +}
> +
> #else
> struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
> const struct flowi *fl, struct sock *sk,
> int flags);
> +
> +/* skb attached with this dst needs transformation if dst->xfrm is valid */
> +static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
> +{
> + return dst->xfrm;
> +}
> #endif
>
> #endif /* _NET_DST_H */
> diff --git a/net/sctp/output.c b/net/sctp/output.c
> index 0ac3a65..24b3718 100644
> --- a/net/sctp/output.c
> +++ b/net/sctp/output.c
> @@ -536,7 +536,8 @@ int sctp_packet_transmit(struct sctp_packet *packet)
> * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
> */
> if (!sctp_checksum_disable) {
> - if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
> + if (!(dst->dev->features & NETIF_F_SCTP_CSUM) ||
> + (dst_xfrm(dst) != NULL)) {
> __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
>
> /* 3) Put the resultant value into the checksum field in the
>
^ permalink raw reply
* Re: [PATCHv3 net] {xfrm, sctp} Stick to software crc32 even if hardware is capable of that
From: Vlad Yasevich @ 2013-10-16 1:52 UTC (permalink / raw)
To: Fan Du, nhorman; +Cc: steffen.klassert, davem, netdev
In-Reply-To: <525DE666.10308@gmail.com>
On 10/15/2013 09:05 PM, Vlad Yasevich wrote:
> On 10/15/2013 05:19 AM, Fan Du wrote:
>> igb/ixgbe have hardware sctp checksum support, when this feature is
>> enabled
>> and also IPsec is armed to protect sctp traffic, ugly things happened as
>> xfrm_output checks CHECKSUM_PARTIAL to do check sum operation(sum
>> every thing
>> up and pack the 16bits result in the checksum field). The result is fail
>> establishment of sctp communication.
>>
>> Signed-off-by: Fan Du <fan.du@windriver.com>
>> Cc: Vlad Yasevich <vyasevich@gmail.com>
>> Cc: Neil Horman <nhorman@tuxdriver.com>
>> Cc: Steffen Klassert <steffen.klassert@secunet.com>
>> Acked-by: Vlad Yasevich <vyasevich@gmail.com>
>
> Looks good to me.
>
Just tryied applying this and looks like you based this on net-next.
This fixes a rather ugly bug when checksum offloading is done.
I am going to rebase this and re-submit for net.
-vlad
> -vlad
>
>> ---
>> v3:
>> - Rename is_xfrm_armed by dst_xfrm
>> - Move this funtion in include/net/dst.h
>>
>> v2:
>> - Split v1 into two separate patches.
>>
>> ---
>> include/net/dst.h | 12 ++++++++++++
>> net/sctp/output.c | 3 ++-
>> 2 files changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/net/dst.h b/include/net/dst.h
>> index 211dcf1..44995c1 100644
>> --- a/include/net/dst.h
>> +++ b/include/net/dst.h
>> @@ -478,10 +478,22 @@ static inline struct dst_entry
>> *xfrm_lookup(struct net *net,
>> {
>> return dst_orig;
>> }
>> +
>> +static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
>> +{
>> + return NULL;
>> +}
>> +
>> #else
>> struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry
>> *dst_orig,
>> const struct flowi *fl, struct sock *sk,
>> int flags);
>> +
>> +/* skb attached with this dst needs transformation if dst->xfrm is
>> valid */
>> +static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
>> +{
>> + return dst->xfrm;
>> +}
>> #endif
>>
>> #endif /* _NET_DST_H */
>> diff --git a/net/sctp/output.c b/net/sctp/output.c
>> index 0ac3a65..24b3718 100644
>> --- a/net/sctp/output.c
>> +++ b/net/sctp/output.c
>> @@ -536,7 +536,8 @@ int sctp_packet_transmit(struct sctp_packet *packet)
>> * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
>> */
>> if (!sctp_checksum_disable) {
>> - if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
>> + if (!(dst->dev->features & NETIF_F_SCTP_CSUM) ||
>> + (dst_xfrm(dst) != NULL)) {
>> __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
>>
>> /* 3) Put the resultant value into the checksum field in
>> the
>>
>
^ permalink raw reply
* Re: [PATCHv3 net] {xfrm, sctp} Stick to software crc32 even if hardware is capable of that
From: Fan Du @ 2013-10-16 1:58 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: nhorman, steffen.klassert, davem, netdev
In-Reply-To: <525DF141.6060302@gmail.com>
On 2013年10月16日 09:52, Vlad Yasevich wrote:
> On 10/15/2013 09:05 PM, Vlad Yasevich wrote:
>> On 10/15/2013 05:19 AM, Fan Du wrote:
>>> igb/ixgbe have hardware sctp checksum support, when this feature is
>>> enabled
>>> and also IPsec is armed to protect sctp traffic, ugly things happened as
>>> xfrm_output checks CHECKSUM_PARTIAL to do check sum operation(sum
>>> every thing
>>> up and pack the 16bits result in the checksum field). The result is fail
>>> establishment of sctp communication.
>>>
>>> Signed-off-by: Fan Du <fan.du@windriver.com>
>>> Cc: Vlad Yasevich <vyasevich@gmail.com>
>>> Cc: Neil Horman <nhorman@tuxdriver.com>
>>> Cc: Steffen Klassert <steffen.klassert@secunet.com>
>>> Acked-by: Vlad Yasevich <vyasevich@gmail.com>
>>
>> Looks good to me.
>>
>
> Just tryied applying this and looks like you based this on net-next.
> This fixes a rather ugly bug when checksum offloading is done.
> I am going to rebase this and re-submit for net.
:( Sorry for the inconvenience. Stable tree might hurts also.
--
浮沉随浪只记今朝笑
--fan
^ permalink raw reply
* [PATCH v4 net 0/3] sctp: Use software checksum under certain
From: Vlad Yasevich @ 2013-10-16 2:01 UTC (permalink / raw)
To: netdev; +Cc: linux-sctp, fan.du, Vlad Yasevich
There are some cards that support SCTP checksum offloading. When using
these cards with IPSec or forcing IP fragmentation of SCTP traffic,
the checksum is computed incorrectly due to the fact that xfrm and IP/IPv6
fragmentation code do not know that this is SCTP traffic and do not
know that checksum has to be computed differently.
To fix this, we let SCTP detect these conditions and perform software
checksum calculation.
Fan Du (1):
sctp: Use software crc32 checksum when xfrm transform will happen.
Vlad Yasevich (2):
net: dst: provide accessor function to dst->xfrm
sctp: Perform software checksum if packet has to be fragmented.
include/net/dst.h | 12 ++++++++++++
net/sctp/output.c | 3 ++-
2 files changed, 14 insertions(+), 1 deletion(-)
--
1.8.3.1
^ permalink raw reply
* [PATCH v4 net 1/3] net: dst: provide accessor function to dst->xfrm
From: Vlad Yasevich @ 2013-10-16 2:01 UTC (permalink / raw)
To: netdev; +Cc: linux-sctp, fan.du, Vlad Yasevich
In-Reply-To: <1381888891-31186-1-git-send-email-vyasevich@gmail.com>
dst->xfrm is conditionally defined. Provide accessor funtion that
is always available.
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
---
include/net/dst.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/net/dst.h b/include/net/dst.h
index 3bc4865..3c4c944 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -479,10 +479,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net,
{
return dst_orig;
}
+
+static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
+{
+ return NULL;
+}
+
#else
extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
const struct flowi *fl, struct sock *sk,
int flags);
+
+/* skb attached with this dst needs transformation if dst->xfrm is valid */
+static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
+{
+ return dst->xfrm;
+}
#endif
#endif /* _NET_DST_H */
--
1.8.3.1
^ permalink raw reply related
* [PATCH v4 net 2/3] sctp: Use software crc32 checksum when xfrm transform will happen.
From: Vlad Yasevich @ 2013-10-16 2:01 UTC (permalink / raw)
To: netdev; +Cc: linux-sctp, fan.du, Neil Horman, Steffen Klassert, Vlad Yasevich
In-Reply-To: <1381888891-31186-1-git-send-email-vyasevich@gmail.com>
From: Fan Du <fan.du@windriver.com>
igb/ixgbe have hardware sctp checksum support, when this feature is enabled
and also IPsec is armed to protect sctp traffic, ugly things happened as
xfrm_output checks CHECKSUM_PARTIAL to do checksum operation(sum every thing
up and pack the 16bits result in the checksum field). The result is fail
establishment of sctp communication.
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Fan Du <fan.du@windriver.com>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
---
net/sctp/output.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 0ac3a65..d35b54c 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -536,7 +536,8 @@ int sctp_packet_transmit(struct sctp_packet *packet)
* by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
*/
if (!sctp_checksum_disable) {
- if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
+ if (!(dst->dev->features & NETIF_F_SCTP_CSUM) ||
+ (dst_xfrm(dst) != NULL)) {
__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
/* 3) Put the resultant value into the checksum field in the
--
1.8.3.1
^ permalink raw reply related
* [PATCH v4 net 3/3] sctp: Perform software checksum if packet has to be fragmented.
From: Vlad Yasevich @ 2013-10-16 2:01 UTC (permalink / raw)
To: netdev; +Cc: linux-sctp, fan.du, Vlad Yasevich
In-Reply-To: <1381888891-31186-1-git-send-email-vyasevich@gmail.com>
IP/IPv6 fragmentation knows how to compute only TCP/UDP checksum.
This causes problems if SCTP packets has to be fragmented and
ipsummed has been set to PARTIAL due to checksum offload support.
This condition can happen when retransmitting after MTU discover,
or when INIT or other control chunks are larger then MTU.
Check for the rare fragmentation condition in SCTP and use software
checksum calculation in this case.
CC: Fan Du <fan.du@windriver.com>
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
---
net/sctp/output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sctp/output.c b/net/sctp/output.c
index d35b54c..3191373 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -537,7 +537,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
*/
if (!sctp_checksum_disable) {
if (!(dst->dev->features & NETIF_F_SCTP_CSUM) ||
- (dst_xfrm(dst) != NULL)) {
+ (dst_xfrm(dst) != NULL) || packet->ipfragok) {
__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
/* 3) Put the resultant value into the checksum field in the
--
1.8.3.1
^ permalink raw reply related
* Re: [RFC net-next] ipv6: Use destination address determined by IPVS
From: Simon Horman @ 2013-10-16 2:13 UTC (permalink / raw)
To: Eric Dumazet
Cc: YOSHIFUJI Hideaki / 吉藤英明, lvs-devel,
netdev, Julian Anastasov, Mark Brooks
In-Reply-To: <1381883949.2045.97.camel@edumazet-glaptop.roam.corp.google.com>
On Tue, Oct 15, 2013 at 05:39:09PM -0700, Eric Dumazet wrote:
> On Wed, 2013-10-16 at 09:28 +0900, Simon Horman wrote:
>
> > > I guess things like NFQUEUE could happen ?
> >
> > Could you expand a little?
>
> This was to point that between IPVS and ipv6 stack we might have a
> delay, and daddr was maybe pointed to a freed memory.
>
> IP6CB only uses 24 bytes, so I think you would be safe adding 16 bytes.
That does seem very promising but while implementing it
I hit a problem.
struct tcp_skb_cb includes a field of type struct inet6_skb_parm. And
expanding struct inet6_skb_parm by 16 bytes means that struct tcp_skb_cb is
now larger than 48 bytes and no longer fits in skb->cb.
Is it appropriate to grow skb->cb as the comment above struct tcp_skb_cb
suggests?
^ permalink raw reply
* Re: [PATCH V2] For for each TSN t being newly acked (Not only cumulatively, but also SELECTIVELY) cacc_saw_newack should be set to 1.
From: Vlad Yasevich @ 2013-10-16 2:13 UTC (permalink / raw)
To: Chang Xiangzhong; +Cc: nhorman, davem, linux-sctp, netdev, linux-kernel
In-Reply-To: <1381860784-16481-1-git-send-email-changxiangzhong@gmail.com>
On 10/15/2013 02:13 PM, Chang Xiangzhong wrote:
> Signed-off-by: Xiangzhong Chang <changxiangzhong@gmail.com>
Your proposed solution is very nice, but it does 2 things in one
patch.
1) It fixes the bug
2) It refactors the code to improve the flow.
While (2) is very nice, it needs a much more careful review.
Can you please split this into 2 patches? First patch can
make the code look like this:
if (sctp_acked(sack, tsn)) {
...
if (!tchunk->tsn_gap_acked) {
tchunk->tsn_gap_acked = 1;
*highest_new_tsn_in_sack = tsn;
bytes_acked += sctp_data_size(tchunk);
if (!tchunk->transport)
migrate_bytes += sctp_data_size(tchunk);
forward_progress = true;
/*
* SFR-CACC algorithm:
* 2) If the SACK contains gap acks
* and the flag CHANGEOVER_ACTIVE is
* set the receiver of the SACK MUST
* take the following action:
...
}
}
Then you can file a second patch to improve the flow/refactor the
function. You have to be very careful here though and be sure to
run through all the regression tests since you would be modifying
a very critcal part of the code.
Thanks
-vlad
> ---
> net/sctp/outqueue.c | 76 ++++++++++++++++++++++++---------------------------
> 1 file changed, 35 insertions(+), 41 deletions(-)
>
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 94df758..84ef3b8 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -1357,13 +1357,13 @@ static void sctp_check_transmitted(struct sctp_outq *q,
>
> tsn = ntohl(tchunk->subh.data_hdr->tsn);
> if (sctp_acked(sack, tsn)) {
> - /* If this queue is the retransmit queue, the
> - * retransmit timer has already reclaimed
> - * the outstanding bytes for this chunk, so only
> - * count bytes associated with a transport.
> - */
> - if (transport) {
> - /* If this chunk is being used for RTT
> + if (!tchunk->tsn_gap_acked) {
> + /* If this queue is the retransmit queue, the
> + * retransmit timer has already reclaimed
> + * the outstanding bytes for this chunk, so only
> + * count bytes associated with a transport.
> + *
> + * If this chunk is being used for RTT
> * measurement, calculate the RTT and update
> * the RTO using this value.
> *
> @@ -1374,28 +1374,44 @@ static void sctp_check_transmitted(struct sctp_outq *q,
> * first instance of the packet or a later
> * instance).
> */
> - if (!tchunk->tsn_gap_acked &&
> - tchunk->rtt_in_progress) {
> + if (transport && tchunk->rtt_in_progress) {
> tchunk->rtt_in_progress = 0;
> rtt = jiffies - tchunk->sent_at;
> sctp_transport_update_rto(transport,
> - rtt);
> + rtt);
> }
> - }
>
> - /* If the chunk hasn't been marked as ACKED,
> - * mark it and account bytes_acked if the
> - * chunk had a valid transport (it will not
> - * have a transport if ASCONF had deleted it
> - * while DATA was outstanding).
> - */
> - if (!tchunk->tsn_gap_acked) {
> + /* If the chunk hasn't been marked as ACKED,
> + * mark it and account bytes_acked if the
> + * chunk had a valid transport (it will not
> + * have a transport if ASCONF had deleted it
> + * while DATA was outstanding).
> + */
> tchunk->tsn_gap_acked = 1;
> *highest_new_tsn_in_sack = tsn;
> bytes_acked += sctp_data_size(tchunk);
> if (!tchunk->transport)
> migrate_bytes += sctp_data_size(tchunk);
> forward_progress = true;
> +
> + /* SFR-CACC algorithm:
> + * 2) If the SACK contains gap acks
> + * and the flag CHANGEOVER_ACTIVE is
> + * set the receiver of the SACK MUST
> + * take the following action:
> + *
> + * B) For each TSN t being acked that
> + * has not been acked in any SACK so
> + * far, set cacc_saw_newack to 1 for
> + * the destination that the TSN was
> + * sent to.
> + */
> + if (transport &&
> + sack->num_gap_ack_blocks &&
> + q->asoc->peer.primary_path->cacc.
> + changeover_active
> + )
> + transport->cacc.cacc_saw_newack = 1;
> }
>
> if (TSN_lte(tsn, sack_ctsn)) {
> @@ -1411,30 +1427,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,
> restart_timer = 1;
> forward_progress = true;
>
> - if (!tchunk->tsn_gap_acked) {
> - /*
> - * SFR-CACC algorithm:
> - * 2) If the SACK contains gap acks
> - * and the flag CHANGEOVER_ACTIVE is
> - * set the receiver of the SACK MUST
> - * take the following action:
> - *
> - * B) For each TSN t being acked that
> - * has not been acked in any SACK so
> - * far, set cacc_saw_newack to 1 for
> - * the destination that the TSN was
> - * sent to.
> - */
> - if (transport &&
> - sack->num_gap_ack_blocks &&
> - q->asoc->peer.primary_path->cacc.
> - changeover_active)
> - transport->cacc.cacc_saw_newack
> - = 1;
> - }
> -
> list_add_tail(&tchunk->transmitted_list,
> - &q->sacked);
> + &q->sacked);
> } else {
> /* RFC2960 7.2.4, sctpimpguide-05 2.8.2
> * M2) Each time a SACK arrives reporting
>
^ permalink raw reply
* Re: [RFC net-next] ipv6: Use destination address determined by IPVS
From: Simon Horman @ 2013-10-16 2:14 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明, lvs-devel,
netdev, Julian Anastasov, Mark Brooks
In-Reply-To: <20131016005322.GA18135@order.stressinduktion.org>
On Wed, Oct 16, 2013 at 02:53:22AM +0200, Hannes Frederic Sowa wrote:
> On Wed, Oct 16, 2013 at 09:02:31AM +0900, Simon Horman wrote:
> > In v3.9 6fd6ce2056de2709 ("ipv6: Do not depend on rt->n in
> > ip6_finish_output2()") changed the behaviour of ip6_finish_output2()
> > such that it creates and uses a neigh entry if none is found.
> > Subsequently the 'n' field was removed from struct rt6_info.
> >
> > Unfortunately my analysis is that in the case of IPVS direct routing this
> > change leads to incorrect behaviour as in this case packets may be output
> > to a destination other than where they would be output according to the
> > route table. In particular, the destination address may actually be a local
> > address and empirically a neighbour lookup seems to result in it becoming
> > unreachable.
> >
> > This patch resolves the problem by providing the destination address
> > determined by IPVS to ip6_finish_output2() in the skb callback. Although
> > this seems to work I can see several problems with this approach:
> >
> > * It is rather ugly, stuffing an IPVS exception right in
> > the middle of IPv6 code. The overhead could be eliminated for many users
> > by using a staic key. But none the less it is not attractive.
> >
> > * The use of the skb callback is may not be valid
> > as it crosses from IPVS to IPv6 code. A possible, though unpleasant,
> > alternative is to add a new field to struct sk_buff.
> >
> > * This covers all IPv6 packets output by IPVS but actually
> > only those output using IPVS Direct-Routing need this. One way to
> > resolve this would be to add a more fine-grained ipvs_property to
> > struct sk_buff.
>
> Hmm, that reminds me on the following bug report which would be nice we could
> solve in one go, too: http://www.spinics.net/lists/netdev/msg250785.html
I think it should be possible to solve that using the
IP6CB() approach that Eric suggested. Hopefully we can make
that approach fly.
^ permalink raw reply
* Re: [RFC net-next] ipv6: Use destination address determined by IPVS
From: Eric Dumazet @ 2013-10-16 2:40 UTC (permalink / raw)
To: Simon Horman
Cc: YOSHIFUJI Hideaki / 吉藤英明, lvs-devel,
netdev, Julian Anastasov, Mark Brooks
In-Reply-To: <20131016021304.GA17801@verge.net.au>
On Wed, 2013-10-16 at 11:13 +0900, Simon Horman wrote:
> That does seem very promising but while implementing it
> I hit a problem.
>
> struct tcp_skb_cb includes a field of type struct inet6_skb_parm. And
> expanding struct inet6_skb_parm by 16 bytes means that struct tcp_skb_cb is
> now larger than 48 bytes and no longer fits in skb->cb.
>
> Is it appropriate to grow skb->cb as the comment above struct tcp_skb_cb
> suggests?
Ah well...
No, its not appropriate to grow sk_buff by 16 bytes, sorry.
You could not change struct inet6_skb_parm, but define IP6CB as
a compound
struct ip6cb {
struct inet6_skb_parm foo;
struct in6_addr bar;
};
^ permalink raw reply
* Re: [PATCH 02/18] net: use wrapper functions of net_ratelimit() to simplify code
From: Kefeng Wang @ 2013-10-16 3:24 UTC (permalink / raw)
To: Joe Perches
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Greg Kroah-Hartman,
David S. Miller, Pablo Neira Ayuso, Stephen Hemminger,
Johannes Berg, John W. Linville, Stanislaw Gruszka, Johannes Berg,
Francois Romieu, Ben Hutchings, Chas Williams, Marc Kleine-Budde,
Samuel Ortiz, Paul Mackerras, Oliver Neukum,
Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel,
Rusty Russell, Michael S. Tsirkin, netfilter
In-Reply-To: <1381854263.22110.19.camel@joe-AO722>
Thanks for your reply.
On 10/16 0:24, Joe Perches wrote:
> On Tue, 2013-10-15 at 19:44 +0800, Kefeng Wang wrote:
>> Wrapper functions net_ratelimited_function() and net_XXX_ratelimited()
>> are called to simplify code.
> []
>> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
> []
>> @@ -465,10 +465,8 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
>> if (likely(fdb)) {
>> /* attempt to update an entry for a local interface */
>> if (unlikely(fdb->is_local)) {
>> - if (net_ratelimit())
>> - br_warn(br, "received packet on %s with "
>> - "own address as source address\n",
>> - source->dev->name);
>> + net_ratelimited_function(br_warn, br, "received packet on %s "
>> + "with own address as source address\n", source->dev->name);
>
> Hello Kefeng.
>
> When these types of lines are changed, please coalesce the
> fragmented format pieces into a single string.
>
> It makes grep a bit easier and 80 columns limits don't
> apply to formats.
Got it, I will coalesce them, but 80 columns limits will be
broken.
> I think using net_ratelimited_function is not particularly
> clarifying here.
>
> Maybe net_ratelimited_function should be removed instead
> of its use sites expanded.
>
> Perhaps adding macros like #define br_warn_ratelimited()
> would be better.
yes, I found dev_emerg_ratelimited already exists. I should
use them and will add some similar mcaros.
> This comment applies to the whole series.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
> .
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 14/18] net: usb: use wrapper functions of net_ratelimit() to simplify code
From: Kefeng Wang @ 2013-10-16 3:27 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: linux-kernel, Greg Kroah-Hartman, David S. Miller,
Pablo Neira Ayuso, Stephen Hemminger, Johannes Berg,
John W. Linville, Stanislaw Gruszka, Johannes Berg,
Francois Romieu, Ben Hutchings, Chas Williams, Marc Kleine-Budde,
Samuel Ortiz, Paul Mackerras, Oliver Neukum,
Konrad Rzeszutek Wilk, Boris Ostrovsky, David Vrabel,
Rusty Russell, Michael S. Tsirkin, netfilter
In-Reply-To: <525D921C.2030709@cogentembedded.com>
Thanks for you reply.
On 10/16 3:06, Sergei Shtylyov wrote:
> Hello.
>
> On 10/15/2013 03:45 PM, Kefeng Wang wrote:
>
>> net_ratelimited_function() is called to simplify code.
>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> drivers/net/usb/usbnet.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
>> index bf94e10..edf81de 100644
>> --- a/drivers/net/usb/usbnet.c
>> +++ b/drivers/net/usb/usbnet.c
>> @@ -450,8 +450,8 @@ void usbnet_defer_kevent (struct usbnet *dev, int work)
>> {
>> set_bit (work, &dev->flags);
>> if (!schedule_work (&dev->kevent)) {
>> - if (net_ratelimit())
>> - netdev_err(dev->net, "kevent %d may have been dropped\n", work);
>> + net_ratelimited_function(netdev_err, dev->net,
>> + "kevent %d may have been dropped\n", work);
>
> The continuation line should start under 'netdev_err'. Same about the other patches where you didn't change the indentation of the continuation lines though you should have.
Got it, indentation will be changed.
> WBR, Sergei
>
>
> .
>
^ permalink raw reply
* Re: [PATCH v2.43 0/5] MPLS actions and matches
From: Ben Pfaff @ 2013-10-16 3:55 UTC (permalink / raw)
To: Simon Horman
Cc: dev, netdev, Jesse Gross, Pravin B Shelar, Ravi K, Isaku Yamahata,
Joe Stringer
In-Reply-To: <20131010003139.GA20311@verge.net.au>
On Thu, Oct 10, 2013 at 09:31:41AM +0900, Simon Horman wrote:
> I believe this series addresses the feedback that each of you
> gave with regards to recent previous postings of this patch-set.
> I'm wondering if you could find some time to review it.
I'm waiting for an ack from Jesse, then I'm going to do a final pass and
I hope to commit this series at this point. I see some ways that we can
improve MPLS support afterward but I don't see any blockers.
^ permalink raw reply
* Re: [PATCH v2.43 0/5] MPLS actions and matches
From: Ben Pfaff @ 2013-10-16 3:56 UTC (permalink / raw)
To: Simon Horman
Cc: dev, netdev, Jesse Gross, Pravin B Shelar, Ravi K, Isaku Yamahata,
Joe Stringer
In-Reply-To: <20131016035530.GA29165@nicira.com>
On Tue, Oct 15, 2013 at 08:55:30PM -0700, Ben Pfaff wrote:
> On Thu, Oct 10, 2013 at 09:31:41AM +0900, Simon Horman wrote:
> > I believe this series addresses the feedback that each of you
> > gave with regards to recent previous postings of this patch-set.
> > I'm wondering if you could find some time to review it.
>
> I'm waiting for an ack from Jesse, then I'm going to do a final pass and
> I hope to commit this series at this point. I see some ways that we can
> improve MPLS support afterward but I don't see any blockers.
(Yet. Somehow MPLS seems to require fractal review.)
^ permalink raw reply
* Re: [PATCH v2.43 0/5] MPLS actions and matches
From: Simon Horman @ 2013-10-16 4:23 UTC (permalink / raw)
To: Ben Pfaff
Cc: dev, netdev, Jesse Gross, Pravin B Shelar, Ravi K, Isaku Yamahata,
Joe Stringer
In-Reply-To: <20131016035600.GB29165@nicira.com>
On Tue, Oct 15, 2013 at 08:56:00PM -0700, Ben Pfaff wrote:
> On Tue, Oct 15, 2013 at 08:55:30PM -0700, Ben Pfaff wrote:
> > On Thu, Oct 10, 2013 at 09:31:41AM +0900, Simon Horman wrote:
> > > I believe this series addresses the feedback that each of you
> > > gave with regards to recent previous postings of this patch-set.
> > > I'm wondering if you could find some time to review it.
> >
> > I'm waiting for an ack from Jesse, then I'm going to do a final pass and
> > I hope to commit this series at this point. I see some ways that we can
> > improve MPLS support afterward but I don't see any blockers.
>
> (Yet. Somehow MPLS seems to require fractal review.)
If you notice something please let me know :)
^ permalink raw reply
* Re: [RFC net-next] ipv6: Use destination address determined by IPVS
From: Simon Horman @ 2013-10-16 4:26 UTC (permalink / raw)
To: Eric Dumazet
Cc: YOSHIFUJI Hideaki / 吉藤英明, lvs-devel,
netdev, Julian Anastasov, Mark Brooks
In-Reply-To: <1381891259.2045.100.camel@edumazet-glaptop.roam.corp.google.com>
On Tue, Oct 15, 2013 at 07:40:59PM -0700, Eric Dumazet wrote:
> On Wed, 2013-10-16 at 11:13 +0900, Simon Horman wrote:
>
> > That does seem very promising but while implementing it
> > I hit a problem.
> >
> > struct tcp_skb_cb includes a field of type struct inet6_skb_parm. And
> > expanding struct inet6_skb_parm by 16 bytes means that struct tcp_skb_cb is
> > now larger than 48 bytes and no longer fits in skb->cb.
> >
> > Is it appropriate to grow skb->cb as the comment above struct tcp_skb_cb
> > suggests?
>
> Ah well...
>
> No, its not appropriate to grow sk_buff by 16 bytes, sorry.
>
> You could not change struct inet6_skb_parm, but define IP6CB as
> a compound
>
> struct ip6cb {
> struct inet6_skb_parm foo;
> struct in6_addr bar;
> };
Thanks for your guidance, that possibility had occured to me too.
I'll rework the patch accordingly.
^ permalink raw reply
* Re: [PATCH] net: sh_eth: Fix RX packets errors on R8A7740
From: Guennadi Liakhovetski @ 2013-10-16 5:37 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Nguyen Hong Ky, David S. Miller, netdev, Ryusuke Sakato,
Simon Horman
In-Reply-To: <525DB81C.6010106@cogentembedded.com>
On Wed, 16 Oct 2013, Sergei Shtylyov wrote:
> Hello.
>
> On 10/15/2013 11:28 AM, Guennadi Liakhovetski wrote:
>
> > > > This patch will fix RX packets errors when receiving big size
> > > > of data by set bit RNC = 1.
>
> > > > RNC - Receive Enable Control
>
> > > > 0: Upon completion of reception of one frame, the E-DMAC writes
> > > > the receive status to the descriptor and clears the RR bit in
> > > > EDRRR to 0.
>
> > > > 1: Upon completion of reception of one frame, the E-DMAC writes
> > > > (writes back) the receive status to the descriptor. In addition,
> > > > the E-DMAC reads the next descriptor and prepares for reception
> > > > of the next frame.
>
> > > > In addition, for get more stable when receiving packets, I set
> > > > maximum size for the transmit/receive FIFO and inserts padding
> > > > in receive data.
>
> > > > Signed-off-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> > > > ---
> > > > drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
> > > > 1 files changed, 4 insertions(+), 0 deletions(-)
>
> > > > diff --git a/drivers/net/ethernet/renesas/sh_eth.c
> > > > b/drivers/net/ethernet/renesas/sh_eth.c
> > > > index a753928..11d34f0 100644
> > > > --- a/drivers/net/ethernet/renesas/sh_eth.c
> > > > +++ b/drivers/net/ethernet/renesas/sh_eth.c
> > > > @@ -649,12 +649,16 @@ static struct sh_eth_cpu_data r8a7740_data = {
> > > > .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT
> > > > |
> > > > EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE
> > > > |
> > > > EESR_TDE | EESR_ECI,
> > > > + .fdr_value = 0x0000070f,
> > > > + .rmcr_value = 0x00000001,
> > > >
> > > > .apr = 1,
> > > > .mpr = 1,
> > > > .tpauser = 1,
> > > > .bculr = 1,
> > > > .hw_swap = 1,
> > > > + .rpadir = 1,
> > > > + .rpadir_value = 2 << 16,
> > > > .no_trimd = 1,
> > > > .no_ade = 1,
> > > > .tsu = 1,
>
> > > Guennadi, could you check if this patch fixes your issue with NFS.
> > > Make
> > > sure it applies to 'r8a7740_data' (it was misapplied to DaveM's tree).
>
> > Yes, the current -next, which includes this patch (in a slightly different
> > form) boots fine over NFS for me.
>
> I don't know what you mean by "slightly different form" exactly. Also, I
> was unable to locate the fresh -next tree.
git://gitorious.org/thierryreding/linux-next.git
> 'net-next.git' contains this patch
> in a mismerged form, 'net.git' has Simon's patch that corrects this mismerge.
>
> > Thanks
> > Guennadi
>
> WBR, Sergei
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* [PATCH net-next] {selinux, af_key} Rework pfkey_sadb2xfrm_user_sec_ctx
From: Fan Du @ 2013-10-16 6:15 UTC (permalink / raw)
To: steffen.klassert; +Cc: davem, netdev
Taking advantages of sadb_x_sec_ctx and xfrm_user_sec_ctx share the same
structure arrangement, rework pfkey_sadb2xfrm_user_sec_ctx by casting
sadb_x_sec_ctx into xfrm_user_sec_ctx with minor len fix.
Then we can:
-Avoid kmalloc/free memory for xfrm_user_sec_ctx, sadb_x_sec_ctx would be fine.
-Fix missing return value check bug for pfkey_compile_policy when kmalloc fails
Signed-off-by: Fan Du <fan.du@windriver.com>
---
net/key/af_key.c | 33 +--------------------------------
1 file changed, 1 insertion(+), 32 deletions(-)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 9d58537..c7d304d 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -435,22 +435,9 @@ static inline int verify_sec_ctx_len(const void *p)
static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx)
{
- struct xfrm_user_sec_ctx *uctx = NULL;
- int ctx_size = sec_ctx->sadb_x_ctx_len;
-
- uctx = kmalloc((sizeof(*uctx)+ctx_size), GFP_KERNEL);
-
- if (!uctx)
- return NULL;
+ struct xfrm_user_sec_ctx *uctx = (struct xfrm_user_sec_ctx *)sec_ctx;
uctx->len = pfkey_sec_ctx_len(sec_ctx);
- uctx->exttype = sec_ctx->sadb_x_sec_exttype;
- uctx->ctx_doi = sec_ctx->sadb_x_ctx_doi;
- uctx->ctx_alg = sec_ctx->sadb_x_ctx_alg;
- uctx->ctx_len = sec_ctx->sadb_x_ctx_len;
- memcpy(uctx + 1, sec_ctx + 1,
- uctx->ctx_len);
-
return uctx;
}
@@ -1125,12 +1112,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx);
- if (!uctx)
- goto out;
-
err = security_xfrm_state_alloc(x, uctx);
- kfree(uctx);
-
if (err)
goto out;
}
@@ -2225,14 +2207,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, const struct sadb_
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx);
- if (!uctx) {
- err = -ENOBUFS;
- goto out;
- }
-
err = security_xfrm_policy_alloc(&xp->security, uctx);
- kfree(uctx);
-
if (err)
goto out;
}
@@ -2329,11 +2304,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx);
- if (!uctx)
- return -ENOMEM;
-
err = security_xfrm_policy_alloc(&pol_ctx, uctx);
- kfree(uctx);
if (err)
return err;
}
@@ -3230,8 +3201,6 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt,
goto out;
uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx);
*dir = security_xfrm_policy_alloc(&xp->security, uctx);
- kfree(uctx);
-
if (*dir)
goto out;
}
--
1.7.9.5
^ permalink raw reply related
* 答复: Re: DomU's network interface will hung when Dom0 running 32bit
From: Annie Li @ 2013-10-16 6:42 UTC (permalink / raw)
To: Ian.Campbell; +Cc: netdev, xen-devel, jianhai.luan, wei.liu2
On Tue, 2013-10-15 at 10:44 +0800, jianhai luan wrote:
> On 2013-10-14 19:19, Wei Liu wrote:
> > On Sat, Oct 12, 2013 at 04:53:18PM +0800, jianhai luan wrote:
> >> Hi Ian,
> >> I meet the DomU's network interface hung issue recently, and have
> >> been working on the issue from that time. I find that DomU's network
> >> interface, which send lesser package, will hung if Dom0 running
> >> 32bit and DomU's up-time is very long. I think that one jiffies
> >> overflow bug exist in the function tx_credit_exceeded().
> >> I know the inline function time_after_eq(a,b) will process jiffies
> >> overflow, but the function have one limit a should little that (b +
> >> MAX_SIGNAL_LONG). If a large than the value, time_after_eq will
> >> return false. The MAX_SINGNAL_LONG should be 0x7fffffff at 32-bit
> >> machine.
> >> If DomU's network interface send lesser package (<0.5k/s if
> >> jiffies=250 and credit_bytes=ULONG_MAX), jiffies will beyond out
> >> (credit_timeout.expires + MAX_SIGNAL_LONG) and time_after_eq(now,
> >> next_credit) will failure (should be true). So one timer which will
> >> not be trigger in short time, and later process will be aborted when
> >> timer_pending(&vif->credit_timeout) is true. The result will be
> >> DomU's network interface will be hung in long time (> 40days).
> >> Please think about the below scenario:
> >> Condition:
> >> Dom0 running 32-bit and HZ = 1000
> >> vif->credit_timeout->expire = 0xffffffff, vif->remaining_credit
> >> = 0xffffffff, vif->credit_usec=0 jiffies=0
> >> vif receive lesser package (DomU send lesser package). If the
> >> value is litter than 2K/s, consume 4G(0xffffffff) will need 582.55
> >> hours. jiffies will large than 0x7ffffff. we guess jiffies =
> >> 0x800000ff, time_after_eq(0x800000ff, 0xffffffff) will failure, and
> >> one time which expire is 0xfffffff will be pended into system. So
> >> the interface will hung until jiffies recount 0xffffffff (that will
> >> need very long time).
> > If I'm not mistaken you meant time_after_eq(now, next_credit) in
> > netback. How does next_credit become 0xffffffff?
>
> I only assume the value is 0xfffffff, and the value of next_credit
> isn't point. If the delta between now and next_credit larger than
> ULONG_MAX, time_after_eq will do wrong judge.
So it sounds like we need a timer which is independent of the traffic
being sent to keep credit_timeout.expires rolling over.
Is it a timer to be set as less than ULONG_MAX/2 to avoid credit_timeout.expires rolling over? But the problem is that we can not assure where jiffies start from, and this probably results into current issue again.
I assume Jason's patch fix this issue and this patch only uses __mod_timer to add a timer with next_credit when the netback fails to send out current available credits.
Thanks
Annie
> >
> > Wei.
> >
> >> If some error exist in above explain, please help me point it out.
> >>
> >> Thanks,
> >> Jason
>
^ permalink raw reply
* Re: [PATCH] X.25: Fix address field length calculation
From: Kelleter, Günther @ 2013-10-16 6:58 UTC (permalink / raw)
To: Joe Perches
Cc: andrew.hendry@gmail.com, davem@davemloft.net,
linux-x25@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
In-Reply-To: <1381858190.22110.25.camel@joe-AO722>
Am 15.10.2013 19:29, schrieb Joe Perches:
> On Tue, 2013-10-15 at 14:29 +0000, Kelleter, Günther wrote:
>> Addresses are BCD encoded, not ASCII. x25_addr_ntoa got it right.
> []
>> Wrong length calculation leads to rejection of CALL ACCEPT packets.
> []
>> diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
> []
>> @@ -98,7 +98,7 @@ int x25_parse_address_block(struct sk_buff *skb,
>> }
>> len = *skb->data;
>> - needed = 1 + (len >> 4) + (len & 0x0f);
>> + needed = 1 + ((len >> 4) + (len & 0x0f) + 1) / 2;
> This calculation looks odd.
> Perhaps use bcd.h instead?
>
It's just the same calculation as in x25_add_ntoa (last line) and it's
used this way by x.25.
Two digits are encoded to one byte and the last byte is padded with 0 if
the total number of digits is odd.--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
^ 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