|
| 1 | +Extra ATM traffic classes requires atm_qos struct extension and a set of |
| 2 | +new defines. What itself requires atm.h updates both in the kernel and |
| 3 | +in the toolchain. On another hand we do not have any real users of these |
| 4 | +traffic classes. |
| 5 | + |
| 6 | +In absence of real user there are no benefits to support this |
| 7 | +functionality. There is only the burden of maintenance of extra patches |
| 8 | +all around the building framework. So just drop these extra QoS traffic |
| 9 | +classes in order to facilitate maintenance and avoid side effects like |
| 10 | +breaking compatibility with existing userspace tools like linux-atm. |
| 11 | + |
| 12 | +Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> |
| 13 | +-- |
| 14 | +--- a/dcdp/atm_tc.c |
| 15 | ++++ b/dcdp/atm_tc.c |
| 16 | +@@ -463,34 +463,9 @@ static void set_qsb(struct atm_priv *pri |
| 17 | + /* Weighted Fair Queueing Factor (WFQF) */ |
| 18 | + switch (qos->txtp.traffic_class) { |
| 19 | + case ATM_CBR: |
| 20 | +- case ATM_VBR_RT: |
| 21 | + /* real time queue gets weighted fair queueing bypass */ |
| 22 | + q_parm_tbl.bit.wfqf = 0; |
| 23 | + break; |
| 24 | +- case ATM_VBR_NRT: |
| 25 | +- case ATM_UBR_PLUS: |
| 26 | +- /* WFQF calculation here is based on virtual cell rates, |
| 27 | +- to reduce granularity for high rates |
| 28 | +- */ |
| 29 | +- /* WFQF is maximum cell rate / garenteed cell rate */ |
| 30 | +- /* wfqf = qsb_minimum_cell_rate * QSB_WFQ_NONUBR_MAX / |
| 31 | +- requested_minimum_peak_cell_rate |
| 32 | +- */ |
| 33 | +- if (qos->txtp.min_pcr == 0) |
| 34 | +- q_parm_tbl.bit.wfqf = QSB_WFQ_NONUBR_MAX; |
| 35 | +- else { |
| 36 | +- tmp = QSB_GCR_MIN * QSB_WFQ_NONUBR_MAX / |
| 37 | +- qos->txtp.min_pcr; |
| 38 | +- if (tmp == 0) |
| 39 | +- q_parm_tbl.bit.wfqf = 1; |
| 40 | +- else if (tmp > QSB_WFQ_NONUBR_MAX) |
| 41 | +- q_parm_tbl.bit.wfqf |
| 42 | +- = QSB_WFQ_NONUBR_MAX; |
| 43 | +- else |
| 44 | +- q_parm_tbl.bit.wfqf = tmp; |
| 45 | +- } |
| 46 | +- break; |
| 47 | +- |
| 48 | + case ATM_UBR: |
| 49 | + default: |
| 50 | + q_parm_tbl.bit.wfqf = QSB_WFQ_UBR_BYPASS; |
| 51 | +@@ -498,42 +473,9 @@ static void set_qsb(struct atm_priv *pri |
| 52 | + } |
| 53 | + |
| 54 | + /* Sustained Cell Rate (SCR) Leaky Bucket Shaper VBR.0/VBR.1 */ |
| 55 | +- if (qos->txtp.traffic_class == ATM_VBR_RT || |
| 56 | +- qos->txtp.traffic_class == ATM_VBR_NRT) { |
| 57 | +- if (qos->txtp.scr == 0) { |
| 58 | +- /* disable shaper */ |
| 59 | +- q_vbr_parm_tbl.bit.taus = 0; |
| 60 | +- q_vbr_parm_tbl.bit.ts = 0; |
| 61 | +- } else { |
| 62 | +- /* Cell Loss Priority (CLP) */ |
| 63 | +- if ((vcc->atm_options & ATM_ATMOPT_CLP)) |
| 64 | +- /* CLP1 */ |
| 65 | +- q_parm_tbl.bit.vbr = 1; |
| 66 | +- else |
| 67 | +- /* CLP0 */ |
| 68 | +- q_parm_tbl.bit.vbr = 0; |
| 69 | +- /* Rate Shaper Parameter (TS) and |
| 70 | +- Burst Tolerance Parameter for SCR (tauS) |
| 71 | +- */ |
| 72 | +- tmp = ((qsb_clk * param->qsb_tstep) >> 5) / |
| 73 | +- qos->txtp.scr + 1; |
| 74 | +- q_vbr_parm_tbl.bit.ts |
| 75 | +- = tmp > QSB_TP_TS_MAX ? QSB_TP_TS_MAX : tmp; |
| 76 | +- tmp = (qos->txtp.mbs - 1) * |
| 77 | +- (q_vbr_parm_tbl.bit.ts - |
| 78 | +- q_parm_tbl.bit.tp) / 64; |
| 79 | +- if (tmp == 0) |
| 80 | +- q_vbr_parm_tbl.bit.taus = 1; |
| 81 | +- else if (tmp > QSB_TAUS_MAX) |
| 82 | +- q_vbr_parm_tbl.bit.taus |
| 83 | +- = QSB_TAUS_MAX; |
| 84 | +- else |
| 85 | +- q_vbr_parm_tbl.bit.taus = tmp; |
| 86 | +- } |
| 87 | +- } else { |
| 88 | +- q_vbr_parm_tbl.bit.taus = 0; |
| 89 | +- q_vbr_parm_tbl.bit.ts = 0; |
| 90 | +- } |
| 91 | ++ /* NB: shaper disabled since there no user interface to activate it */ |
| 92 | ++ q_vbr_parm_tbl.bit.taus = 0; |
| 93 | ++ q_vbr_parm_tbl.bit.ts = 0; |
| 94 | + |
| 95 | + /* Queue Parameter Table (QPT) */ |
| 96 | + tc_w32(QSB_QPT_SET_MASK, QSB_RTM); |
| 97 | +@@ -1064,15 +1006,6 @@ static int ppe_open(struct atm_vcc *vcc) |
| 98 | + /* check bandwidth */ |
| 99 | + if ((vcc->qos.txtp.traffic_class == ATM_CBR && |
| 100 | + vcc->qos.txtp.max_pcr > |
| 101 | +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) |
| 102 | +- || (vcc->qos.txtp.traffic_class == ATM_VBR_RT && |
| 103 | +- vcc->qos.txtp.max_pcr > |
| 104 | +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) |
| 105 | +- || (vcc->qos.txtp.traffic_class == ATM_VBR_NRT && |
| 106 | +- vcc->qos.txtp.scr > |
| 107 | +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) |
| 108 | +- || (vcc->qos.txtp.traffic_class == ATM_UBR_PLUS && |
| 109 | +- vcc->qos.txtp.min_pcr > |
| 110 | + (port->tx_max_cell_rate - port->tx_used_cell_rate))) { |
| 111 | + tc_dbg(priv->tc_priv, MSG_INIT, "exceed TX line rate\n"); |
| 112 | + return -EINVAL; |
| 113 | +@@ -1128,15 +1061,8 @@ static int ppe_open(struct atm_vcc *vcc) |
| 114 | + /* reserve bandwidth */ |
| 115 | + switch (vcc->qos.txtp.traffic_class) { |
| 116 | + case ATM_CBR: |
| 117 | +- case ATM_VBR_RT: |
| 118 | + port->tx_used_cell_rate += vcc->qos.txtp.max_pcr; |
| 119 | + break; |
| 120 | +- case ATM_VBR_NRT: |
| 121 | +- port->tx_used_cell_rate += vcc->qos.txtp.scr; |
| 122 | +- break; |
| 123 | +- case ATM_UBR_PLUS: |
| 124 | +- port->tx_used_cell_rate += vcc->qos.txtp.min_pcr; |
| 125 | +- break; |
| 126 | + } |
| 127 | + |
| 128 | + /* update atm_vcc structure */ |
| 129 | +@@ -1222,15 +1148,8 @@ static void ppe_close(struct atm_vcc *vc |
| 130 | + /* release bandwidth */ |
| 131 | + switch (vcc->qos.txtp.traffic_class) { |
| 132 | + case ATM_CBR: |
| 133 | +- case ATM_VBR_RT: |
| 134 | + port->tx_used_cell_rate -= vcc->qos.txtp.max_pcr; |
| 135 | + break; |
| 136 | +- case ATM_VBR_NRT: |
| 137 | +- port->tx_used_cell_rate -= vcc->qos.txtp.scr; |
| 138 | +- break; |
| 139 | +- case ATM_UBR_PLUS: |
| 140 | +- port->tx_used_cell_rate -= vcc->qos.txtp.min_pcr; |
| 141 | +- break; |
| 142 | + } |
| 143 | + |
| 144 | + /* idle for a while to let parallel operation finish */ |
0 commit comments