26 Dec, 2008

5 commits


28 Nov, 2008

1 commit

  • Fix missing label when CONFIG_PROC_FS=n:

    net/sctp/protocol.c: In function 'sctp_proc_init':
    net/sctp/protocol.c:106: error: label 'out_nomem' used but not defined
    make[3]: *** [net/sctp/protocol.o] Error 1

    Signed-off-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Randy Dunlap
     

26 Nov, 2008

2 commits

  • Instead of using one atomic_t per protocol, use a percpu_counter
    for "sockets_allocated", to reduce cache line contention on
    heavy duty network servers.

    Note : We revert commit (248969ae31e1b3276fc4399d67ce29a5d81e6fd9
    net: af_unix can make unix_nr_socks visbile in /proc),
    since it is not anymore used after sock_prot_inuse_add() addition

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • prot->destroy is not called with BH disabled. So we must add
    explicit BH disable around call to sock_prot_inuse_add()
    in sctp_destroy_sock()

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

24 Nov, 2008

1 commit


17 Nov, 2008

1 commit

  • This patch is a preparation to namespace conversion of /proc/net/protocols

    In order to have relevant information for SCTP protocols, we should use
    sock_prot_inuse_add() to update a (percpu and pernamespace) counter of
    inuse sockets.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

04 Nov, 2008

1 commit

  • I want to compile out proc_* and sysctl_* handlers totally and
    stub them to NULL depending on config options, however usage of &
    will prevent this, since taking adress of NULL pointer will break
    compilation.

    So, drop & in front of every ->proc_handler and every ->strategy
    handler, it was never needed in fact.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     

31 Oct, 2008

1 commit


30 Oct, 2008

1 commit


29 Oct, 2008

1 commit


23 Oct, 2008

4 commits

  • Once an endpoint has reached the SHUTDOWN-RECEIVED state,
    it MUST NOT send a SHUTDOWN in response to a ULP request.
    The Cumulative TSN Ack of the received SHUTDOWN chunk
    MUST be processed.

    This patch fix to process Cumulative TSN Ack of the received
    SHUTDOWN chunk in SHUTDOWN_RECEIVED state.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • If SHUTDOWN is received in SHUTDOWN-PENDING state, enpoint should enter
    the SHUTDOWN-RECEIVED state and check the Cumulative TSN Ack field of
    the SHUTDOWN chunk (RFC 4960 Section 9.2). If the SHUTDOWN chunk can
    acknowledge all of the send DATA chunks, SHUTDOWN-ACK should be sent.

    But now endpoint just silently discarded the SHUTDOWN chunk.

    SHUTDOWN received in SHUTDOWN-PENDING state can happend when the last
    SACK is lost by network, or the SHUTDOWN chunk can acknowledge all of
    the received DATA chunks. The packet sequence(SACK lost) is like this:

    Endpoint A Endpoint B ULP
    (ESTABLISHED) (ESTABLISHED)

    SHUTDOWN(*1) ------------>


    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • If SHUTDOWN chunk is received Cumulative TSN Ack beyond the max tsn currently
    send, SHUTDOWN chunk be accepted and the association will be broken. New data
    is send, but after received SACK it will be drop because TSN in SACK is less
    than the Cumulative TSN, data will be retrans again and again even if correct
    SACK is received.

    The packet sequence is like this:

    Endpoint A Endpoint B ULP
    (ESTABLISHED) (ESTABLISHED)

    (Now Cumulative TSN=x+1000)
    (TSN=x+1000)
    drop the SACK
    (TSN=x+1)

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • If ICMP packet too big message is received with MTU larger than current
    PMTU, SCTP will still accept this ICMP message and sync the PMTU of assoc
    with the wrong MTU.

    Endpoing A Endpoint B
    (ESTABLISHED) (ESTABLISHED)
    ICMP --------->
    (packet too big, MTU too larger)
    sync PMTU

    This patch fixed the problem by drop that ICMP message.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     

10 Oct, 2008

3 commits

  • The T5 timer is the timer for the over-all shutdown procedure. If
    this timer expires, then shutdown procedure has not completed and we
    ABORT the association. We should update SCTP_MIB_ABORTED and
    SCTP_MIB_CURRESTAB when aborting.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • If ABORT chunks require authentication and a protocol violation
    is triggered, we do not tear down the association. Subsequently,
    we should not increment SCTP_MIB_ABORTED.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • RFC3873 defined SCTP_MIB_CURRESTAB:
    sctpCurrEstab OBJECT-TYPE
    SYNTAX Gauge32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "The number of associations for which the current state is
    either ESTABLISHED, SHUTDOWN-RECEIVED or SHUTDOWN-PENDING."
    REFERENCE
    "Section 4 in RFC2960 covers the SCTP Association state
    diagram."

    If the T4 RTO timer expires many times(timeout), the association will enter
    CLOSED state, so we should dec the number of SCTP_MIB_CURRESTAB, not inc the
    number of SCTP_MIB_CURRESTAB.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     

09 Oct, 2008

3 commits

  • The gabs array in the sctp_tsnmap structure is only used
    in one place, sctp_make_sack(). As such, carrying the
    array around in the sctp_tsnmap and thus directly in
    the sctp_association is rather pointless since most
    of the time it's just taking up space. Now, let
    sctp_make_sack create and populate it and then throw
    it away when it's done.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • The tsn map currently use is 4K large and is stuck inside
    the sctp_association structure making memory references REALLY
    expensive. What we really need is at most 4K worth of bits
    so the biggest map we would have is 512 bytes. Also, the
    map is only really usefull when we have gaps to store and
    report. As such, starting with minimal map of say 32 TSNs (bits)
    should be enough for normal low-loss operations. We can grow
    the map by some multiple of 32 along with some extra room any
    time we receive the TSN which would put us outside of the map
    boundry. As we close gaps, we can shift the map to rebase
    it on the latest TSN we've seen. This saves 4088 bytes per
    association just in the map alone along savings from the now
    unnecessary structure members.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • Signed-off-by: Denis V. Lunev
    Signed-off-by: David S. Miller

    Denis V. Lunev
     

01 Oct, 2008

10 commits

  • The INIT perameter carries the adapatation value in network-byte
    order. We need to store it in host byte order as expected
    by data types and the user API.

    Signed-off-by: Vlad Yasevich

    Vlad Yasevich
     
  • This patch enables cookie-echo retransmission transport switch
    feature. If COOKIE-ECHO retransmission happens, it will be sent
    to the address other than the one last sent to.

    Signed-off-by: Gui Jianfeng
    Signed-off-by: Vlad Yasevich

    Vlad Yasevich
     
  • RFC3873 defined SCTP_MIB_OUTOFBLUES:

    sctpOutOfBlues OBJECT-TYPE
    SYNTAX Counter32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
    "The number of out of the blue packets received by the host.
    An out of the blue packet is an SCTP packet correctly formed,
    including the proper checksum, but for which the receiver was
    unable to identify an appropriate association."
    REFERENCE
    "Section 8.4 in RFC2960 deals with the Out-Of-The-Blue
    (OOTB) packet definition and procedures."

    But OOTB packet INIT, INIT-ACK and SHUTDOWN-ACK(COOKIE-WAIT or
    COOKIE-ECHOED state) are not counted by SCTP_MIB_OUTOFBLUES.

    Case 1(INIT):

    Endpoint A Endpoint B
    (CLOSED) (CLOSED)

    INIT ---------->




    Signed-off-by: Vlad Yasevich

    Wei Yongjun
     
  • RFC 4960: Section 9.2
    The sender of the SHUTDOWN MAY also start an overall guard timer
    'T5-shutdown-guard' to bound the overall time for the shutdown
    sequence. At the expiration of this timer, the sender SHOULD abort
    the association by sending an ABORT chunk. If the 'T5-shutdown-
    guard' timer is used, it SHOULD be set to the recommended value of 5
    times 'RTO.Max'.

    The timer 'T5-shutdown-guard' is used to counter the overall time
    for shutdown sequence, and it's start by the sender of the SHUTDOWN.
    So timer 'T5-shutdown-guard' should be start when we send the first
    SHUTDOWN chunk and enter the SHUTDOWN-SENT state, not start when we
    receipt of the SHUTDOWN primitive and enter SHUTDOWN-PENDING state.

    If 'T5-shutdown-guard' timer is start at SHUTDOWN-PENDING state, the
    association may be ABORT while data is still transmitting.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Vlad Yasevich

    Wei Yongjun
     
  • sctp_is_any() function that is used to check for wildcard addresses
    only looks at the address itself to determine the address family.
    This function is used in the API to check the address passed in from
    the user. If the user simply zerroes out the sockaddr_storage and
    pass that in, we'll end up failing. So, let's try harder to determine
    the address family by also checking the socket if it's possible.

    Signed-off-by: Vlad Yasevich

    Vlad Yasevich
     
  • sctp_chunks should be put on a diet. This is some of the low hanging
    fruit that we can strip out. Changes all the __s8/__u8 flags to
    bitfields. Saves 12 bytes per chunk.

    Signed-off-by: Neil Horman
    Signed-off-by: Vlad Yasevich

    Neil Horman
     
  • Chunks placed on the retransmit list are marked as inelegible
    for fast retrasnmission. Since missing indications determine
    when fast reransmission is done, there is not point in calling
    sctp_mark_missing() on the retransmit list since those chunks
    will not be marked.

    Signed-off-by: Vlad Yasevich

    Vlad Yasevich
     
  • There is a possibility of walking the transport list twice during
    SACK processing when doing SFR-CACC algorithm. We can restructure
    the code to only do this once.

    Signed-off-by: Vlad Yasevich

    Vlad Yasevich
     
  • Frist small step in optimizing SACK processing. Do not call
    sctp_mark_missing() when there are no gaps reported and thus
    not missing chunks.

    Signed-off-by: Vlad Yasevich

    Vlad Yasevich
     
  • Conflicts:

    drivers/net/wireless/ath9k/core.c
    drivers/net/wireless/ath9k/main.c
    net/core/dev.c

    David S. Miller
     

30 Sep, 2008

1 commit

  • Since call to function sctp_sf_abort_violation() need paramter 'arg' with
    'struct sctp_chunk' type, it will read the chunk type and chunk length from
    the chunk_hdr member of chunk. But call to sctp_sf_violation_paramlen()
    always with 'struct sctp_paramhdr' type's parameter, it will be passed to
    sctp_sf_abort_violation(). This may cause kernel panic.

    sctp_sf_violation_paramlen()
    |-- sctp_sf_abort_violation()
    |-- sctp_make_abort_violation()

    This patch fixed this problem. This patch also fix two place which called
    sctp_sf_violation_paramlen() with wrong paramter type.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     

22 Sep, 2008

1 commit


19 Sep, 2008

2 commits

  • If INIT-ACK is received with SupportedExtensions parameter which
    indicates that the peer does not support AUTH, the packet will be
    silently ignore, and sctp_process_init() do cleanup all of the
    transports in the association.
    When T1-Init timer is expires, OOPS happen while we try to choose
    a different init transport.

    The solution is to only clean up the non-active transports, i.e
    the ones that the peer added. However, that introduces a problem
    with sctp_connectx(), because we don't mark the proper state for
    the transports provided by the user. So, we'll simply mark
    user-provided transports as ACTIVE. That will allow INIT
    retransmissions to work properly in the sctp_connectx() context
    and prevent the crash.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     
  • Do not enable peer features like addip and auth, if they
    are administratively disabled localy. If the peer resports
    that he supports something that we don't, neither end can
    use it so enabling it is pointless. This solves a problem
    when talking to a peer that has auth and addip enabled while
    we do not. Found by Andrei Pelinescu-Onciul .

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Vlad Yasevich
     

18 Sep, 2008

1 commit


28 Aug, 2008

1 commit