/* * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE.See the GNU General Public License * for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IOCTL_H__ #define __IOCTL_H__ #ifndef __user #define __user #endif /* VIAFB IOCTL definition */ #define VIAFB_GET_INFO_SIZE 0x56494101 /* 'VIA\01' */ #define VIAFB_GET_INFO 0x56494102 /* 'VIA\02' */ #define VIAFB_HOTPLUG 0x56494103 /* 'VIA\03' */ #define VIAFB_SET_HOTPLUG_FLAG 0x56494104 /* 'VIA\04' */ #define VIAFB_GET_RESOLUTION 0x56494105 /* 'VIA\05' */ #define VIAFB_GET_SAMM_INFO 0x56494107 /* 'VIA\07' */ #define VIAFB_TURN_ON_OUTPUT_DEVICE 0x56494108 /* 'VIA\08' */ #define VIAFB_TURN_OFF_OUTPUT_DEVICE 0x56494109 /* 'VIA\09' */ #define VIAFB_GET_DEVICE 0x5649410B #define VIAFB_GET_DRIVER_VERSION 0x56494112 /* 'VIA\12' */ #define VIAFB_GET_CHIP_INFO 0x56494113 /* 'VIA\13' */ #define VIAFB_GET_DEVICE_INFO 0x56494115 #define VIAFB_GET_DEVICE_SUPPORT 0x56494118 #define VIAFB_GET_DEVICE_CONNECT 0x56494119 #define VIAFB_GET_PANEL_SUPPORT_EXPAND 0x5649411A #define VIAFB_GET_DRIVER_NAME 0x56494122 #define VIAFB_GET_DEVICE_SUPPORT_STATE 0x56494123 #define VIAFB_GET_GAMMA_LUT 0x56494124 #define VIAFB_SET_GAMMA_LUT 0x56494125 #define VIAFB_GET_GAMMA_SUPPORT_STATE 0x56494126 #define VIAFB_SYNC_SURFACE 0x56494130 #define VIAFB_GET_DRIVER_CAPS 0x56494131 #define VIAFB_GET_IGA_SCALING_INFO 0x56494132 #define VIAFB_GET_PANEL_MAX_SIZE 0x56494133 #define VIAFB_GET_PANEL_MAX_POSITION 0x56494134 #define VIAFB_SET_PANEL_SIZE 0x56494135 #define VIAFB_SET_PANEL_POSITION 0x56494136 #define VIAFB_GET_PANEL_POSITION 0x56494137 #define VIAFB_GET_PANEL_SIZE 0x56494138 #define None_Device 0x00 #define CRT_Device 0x01 #define LCD_Device 0x02 #define DVI_Device 0x08 #define CRT2_Device 0x10 #define LCD2_Device 0x40 #define OP_LCD_CENTERING 0x01 #define OP_LCD_PANEL_ID 0x02 #define OP_LCD_MODE 0x03 /*SAMM operation flag*/ #define OP_SAMM 0x80 #define LCD_PANEL_ID_MAXIMUM 23 #define STATE_ON 0x1 #define STATE_OFF 0x0 #define STATE_DEFAULT 0xFFFF #define MAX_ACTIVE_DEV_NUM 2 struct device_t { unsigned short crt:1; unsigned short dvi:1; unsigned short lcd:1; unsigned short samm:1; unsigned short lcd_dsp_cent:1; unsigned char lcd_mode:1; unsigned short epia_dvi:1; unsigned short lcd_dual_edge:1; unsigned short lcd2:1; unsigned short primary_dev; unsigned char lcd_panel_id; unsigned short xres, yres; unsigned short xres1, yres1; unsigned short refresh; unsigned short bpp; unsigned short refresh1; unsigned short bpp1; unsigned short sequence; unsigned short bus_width; }; struct viafb_ioctl_info { u32 viafb_id; /* for identifying viafb */ #define VIAID 0x56494146 /* Identify myself with 'VIAF' */ u16 vendor_id; u16 device_id; u8 version; u8 revision; u8 reserved[246]; /* for future use */ }; struct viafb_ioctl_mode { u32 xres; u32 yres; u32 refresh; u32 bpp; u32 xres_sec; u32 yres_sec; u32 virtual_xres_sec; u32 virtual_yres_sec; u32 refresh_sec; u32 bpp_sec; }; struct viafb_ioctl_samm { u32 samm_status; u32 size_prim; u32 size_sec; u32 mem_base; u32 offset_sec; }; struct viafb_driver_version { int iMajorNum; int iKernelNum; int iOSNum; int iMinorNum; }; struct viafb_ioctl_lcd_attribute { unsigned int panel_id; unsigned int display_center; unsigned int lcd_mode; }; struct viafb_ioctl_setting { /* Enable or disable active devices */ unsigned short device_flag; /* Indicate which device should be turn on or turn off. */ unsigned short device_status; unsigned int reserved; /* Indicate which LCD's attribute can be changed. */ unsigned short lcd_operation_flag; /* 1: SAMM ON 0: SAMM OFF */ unsigned short samm_status; /* horizontal resolution of first device */ unsigned short first_dev_hor_res; /* vertical resolution of first device */ unsigned short first_dev_ver_res; /* horizontal resolution of second device */ unsigned short second_dev_hor_res; /* vertical resolution of second device */ unsigned short second_dev_ver_res; /* refresh rate of first device */ unsigned short first_dev_refresh; /* bpp of first device */ unsigned short first_dev_bpp; /* refresh rate of second device */ unsigned short second_dev_refresh; /* bpp of second device */ unsigned short second_dev_bpp; /* Indicate which device are primary display device. */ unsigned int primary_device; unsigned int struct_reserved[35]; struct viafb_ioctl_lcd_attribute lcd_attributes; }; struct _UTFunctionCaps { unsigned int dw3DScalingState; unsigned int reserved[31]; }; struct _POSITIONVALUE { unsigned int dwX; unsigned int dwY; }; struct _panel_size_pos_info { unsigned int device_type; int x; int y; }; extern int viafb_LCD_ON; extern int viafb_DVI_ON; int viafb_ioctl_get_viafb_info(u_long arg); int viafb_ioctl_hotplug(int hres, int vres, int bpp); #endif /* __IOCTL_H__ */ hat value, and thus it will never recover from such pressure. This means that we will not issue window updates when recovering from 0 window and will rely on a sender retransmit to notice it. The fix here is to remove such threshold, as no value is good enough: it depends on the (avg) chunk sizes being used. Test with netperf -t SCTP_STREAM -- -m 1, and trigger 0 window by sending SIGSTOP to netserver, sleep 1.2, and SIGCONT. Rate limited to 845kbps, for visibility. Capture done at netserver side. Previously: 01.500751 IP B.48277 > A.36925: sctp (1) [SACK] [cum ack 632372996] [a_rwnd 99153] [ 01.500752 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632372997] [SID: 0] [SS 01.517471 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632373010] [SID: 0] [SS 01.517483 IP B.48277 > A.36925: sctp (1) [SACK] [cum ack 632373009] [a_rwnd 0] [#gap 01.517485 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632373083] [SID: 0] [SS 01.517488 IP B.48277 > A.36925: sctp (1) [SACK] [cum ack 632373009] [a_rwnd 0] [#gap 01.534168 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632373096] [SID: 0] [SS 01.534180 IP B.48277 > A.36925: sctp (1) [SACK] [cum ack 632373009] [a_rwnd 0] [#gap 01.534181 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632373169] [SID: 0] [SS 01.534185 IP B.48277 > A.36925: sctp (1) [SACK] [cum ack 632373009] [a_rwnd 0] [#gap 02.525978 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632373010] [SID: 0] [SS 02.526021 IP B.48277 > A.36925: sctp (1) [SACK] [cum ack 632373009] [a_rwnd 0] [#gap (window update missed) 04.573807 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632373010] [SID: 0] [SS 04.779370 IP B.48277 > A.36925: sctp (1) [SACK] [cum ack 632373082] [a_rwnd 859] [#g 04.789162 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632373083] [SID: 0] [SS 04.789323 IP A.36925 > B.48277: sctp (1) [DATA] (B)(E) [TSN: 632373156] [SID: 0] [SS 04.789372 IP B.48277 > A.36925: sctp (1) [SACK] [cum ack 632373228] [a_rwnd 786] [#g After: 02.568957 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098728] [a_rwnd 99153] 02.568961 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098729] [SID: 0] [S 02.585631 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098742] [SID: 0] [S 02.585666 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 0] [#ga 02.585671 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098815] [SID: 0] [S 02.585683 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 0] [#ga 02.602330 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098828] [SID: 0] [S 02.602359 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 0] [#ga 02.602363 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098901] [SID: 0] [S 02.602372 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 0] [#ga 03.600788 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098742] [SID: 0] [S 03.600830 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 0] [#ga 03.619455 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 13508] 03.619479 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 27017] 03.619497 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 40526] 03.619516 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 54035] 03.619533 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 67544] 03.619552 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 81053] 03.619570 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098741] [a_rwnd 94562] (following data transmission triggered by window updates above) 03.633504 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098742] [SID: 0] [S 03.836445 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098814] [a_rwnd 100000] 03.843125 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098815] [SID: 0] [S 03.843285 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098888] [SID: 0] [S 03.843345 IP B.50536 > A.55173: sctp (1) [SACK] [cum ack 2490098960] [a_rwnd 99894] 03.856546 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098961] [SID: 0] [S 03.866450 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490099011] [SID: 0] [S Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>