Message ID | 20250112140911.1702-4-ryazanov.s.a@gmail.com |
---|---|
State | Superseded |
Delegated to: | Hauke Mehrtens |
Headers | show |
Series | ipq40xx: fritzbox 7530: fix ADSL/ATM support | expand |
On 2025-01-12 15:09, Sergey Ryazanov wrote: > atm_qos struct should be the same both for user and kernel spaces. Via > the __SO_ENCODE() macro it is used to define the SO_ATMQOS socket IOC. > > During the VRX518 support introduction, the atm_trafprm sturct nested > into the atm_qos stucture was update with newer fields that are > referenced by the ATM TC layer of the VRX518 TC driver. These new > fields > are intended to communicate information for extra traffic classes > supported by the driver. But we are still using vanilla kernel headers > to build the toolchain. Due to the atm.h header incoherency br2684ctl > from linux-atm tools is incapable to configure the ATM bridge netdev: > > br2684ctl: Interface "dsl0" created sucessfully > br2684ctl: Communicating over ATM 0.1.2, encapsulation: LLC > br2684ctl: setsockopt SO_ATMQOS 22 <-- EINVAL errno > br2684ctl: Fatal: failed to connect on socket; File descriptor in bad > state Hmmm... I have fixed this problem in the past by including the "user_headers". See commit e53ed6af8744 (“linux-atm: use target specific kernel headers”) [1]. Felix suggested this to me in [2]. Does this no longer work? > > There are two options to fix this incoherency. (a) update the header > file in the toolchain to build linux-atm against updated atm_trafprm > and > atm_qos structures, or (b) revert atm_trafprm changes. > ... [1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=e53ed6af8744b588ca9da5f395b427a0b0d659ba [2] http://lists.openwrt.org/pipermail/openwrt-devel/2023-July/041337.html
On 13/01/2025 9:17 am, Martin Schiller wrote: > On 2025-01-12 15:09, Sergey Ryazanov wrote: >> atm_qos struct should be the same both for user and kernel spaces. Via >> the __SO_ENCODE() macro it is used to define the SO_ATMQOS socket IOC. >> >> During the VRX518 support introduction, the atm_trafprm sturct nested >> into the atm_qos stucture was update with newer fields that are >> referenced by the ATM TC layer of the VRX518 TC driver. These new fields >> are intended to communicate information for extra traffic classes >> supported by the driver. But we are still using vanilla kernel headers >> to build the toolchain. Due to the atm.h header incoherency br2684ctl >> from linux-atm tools is incapable to configure the ATM bridge netdev: >> >> br2684ctl: Interface "dsl0" created sucessfully >> br2684ctl: Communicating over ATM 0.1.2, encapsulation: LLC >> br2684ctl: setsockopt SO_ATMQOS 22 <-- EINVAL errno >> br2684ctl: Fatal: failed to connect on socket; File descriptor in >> bad state > > Hmmm... I have fixed this problem in the past by including the > "user_headers". See commit e53ed6af8744 (“linux-atm: use target specific > kernel headers”) [1]. Felix suggested this to me in [2]. > Does this no longer work? Good question, I didn't know about that patch. At least on ipq40xx there's nothing writing the custom classes to qos->txtp.traffic_class, it's all just code that reads and checks for those, so it's basically useless and dead code. This removal here allows us to drop the atm.h patch. If that's the case too for lantiq, we could apply the same logic there and make linux-atm shared again? In any case, this set still works on my ipq40xx device and vdsl seems to work just fine! Cheers, Andre
Hi Andre, Martin, On 13.01.2025 14:17, Andre Heider wrote: > On 13/01/2025 9:17 am, Martin Schiller wrote: >> On 2025-01-12 15:09, Sergey Ryazanov wrote: >>> atm_qos struct should be the same both for user and kernel spaces. Via >>> the __SO_ENCODE() macro it is used to define the SO_ATMQOS socket IOC. >>> >>> During the VRX518 support introduction, the atm_trafprm sturct nested >>> into the atm_qos stucture was update with newer fields that are >>> referenced by the ATM TC layer of the VRX518 TC driver. These new fields >>> are intended to communicate information for extra traffic classes >>> supported by the driver. But we are still using vanilla kernel headers >>> to build the toolchain. Due to the atm.h header incoherency br2684ctl >>> from linux-atm tools is incapable to configure the ATM bridge netdev: >>> >>> br2684ctl: Interface "dsl0" created sucessfully >>> br2684ctl: Communicating over ATM 0.1.2, encapsulation: LLC >>> br2684ctl: setsockopt SO_ATMQOS 22 <-- EINVAL errno >>> br2684ctl: Fatal: failed to connect on socket; File descriptor in >>> bad state >> >> Hmmm... I have fixed this problem in the past by including the >> "user_headers". See commit e53ed6af8744 (“linux-atm: use target specific >> kernel headers”) [1]. Felix suggested this to me in [2]. >> Does this no longer work? > > Good question, I didn't know about that patch. Me too. As it was mentioned in cover letter, I've faced the ATM bridge issue on the latest stable release - 23.05.5. And the e53ed6af87 ("linux-atm: use target specific kernel headers") commit was introduced after the branching and was never backported: $ git log --oneline -n3 master package/network/utils/linux-atm/ 3e024022c3 linux-atm: fix build with GCC 14 e53ed6af87 linux-atm: use target specific kernel headers 9aa3d5b345 linux-atm: Include linux/sockios.h for SIOCGSTAMP $ git log --oneline -n2 openwrt-23.05 package/network/utils/linux-atm/ 9aa3d5b345 linux-atm: Include linux/sockios.h for SIOCGSTAMP 806354ab53 linux-atm: Fix compile warning I developed the extra fields disabling patch for the stable release and then rebased. And then in V3 extended it to drop the Lantiq's ATM hacks entirely. BTW, I checked the Martin's fix in the latest master just now. It works and picks the correct atm.h from the patched kernel. > At least on ipq40xx there's nothing writing the custom classes to qos- > >txtp.traffic_class, it's all just code that reads and checks for > those, so it's basically useless and dead code. This removal here allows > us to drop the atm.h patch. I checked the git history, it looks like since 2007 only Lantiq's legacy driver (now ltq-atm) and various compat patches (now MIPS-lantiq-add-atm-hack.patch) are referencing ATM_VBR_NRT/ATM_VBR_RT/ATM_UBR_PLUS/ATM_GFR. We have two options now. (a) Keep the Lantiq's hack in the tree for both platform and keep the include path amend in linux-atm. (b) proceed with this patch and probably backport it to v23 and v24. And with a follow up patch remove the corresponding ATM hacks from Lantiq and eventually from linux-atm. > If that's the case too for lantiq, we could apply the same logic there > and make linux-atm shared again? Yep. I like the plan 'b' for cleaning the tree from vendor's hacks, stop spreading them to other targets and simplifying maintenance. > In any case, this set still works on my ipq40xx device and vdsl seems to > work just fine! Have you gave a change to this series, Andre? -- Sergey
On 13/01/2025 11:27 pm, Sergey Ryazanov wrote: > Hi Andre, Martin, > > On 13.01.2025 14:17, Andre Heider wrote: >> In any case, this set still works on my ipq40xx device and vdsl seems >> to work just fine! > > Have you gave a change to this series, Andre? Yes, I used this V3. No build errors and at runtime there're no regressions so far!
On 2025-01-13 23:27, Sergey Ryazanov wrote: > Hi Andre, Martin, > > On 13.01.2025 14:17, Andre Heider wrote: >> On 13/01/2025 9:17 am, Martin Schiller wrote: >>> On 2025-01-12 15:09, Sergey Ryazanov wrote: >>>> atm_qos struct should be the same both for user and kernel spaces. >>>> Via >>>> the __SO_ENCODE() macro it is used to define the SO_ATMQOS socket >>>> IOC. >>>> >>>> During the VRX518 support introduction, the atm_trafprm sturct >>>> nested >>>> into the atm_qos stucture was update with newer fields that are >>>> referenced by the ATM TC layer of the VRX518 TC driver. These new >>>> fields >>>> are intended to communicate information for extra traffic classes >>>> supported by the driver. But we are still using vanilla kernel >>>> headers >>>> to build the toolchain. Due to the atm.h header incoherency >>>> br2684ctl >>>> from linux-atm tools is incapable to configure the ATM bridge >>>> netdev: >>>> >>>> br2684ctl: Interface "dsl0" created sucessfully >>>> br2684ctl: Communicating over ATM 0.1.2, encapsulation: LLC >>>> br2684ctl: setsockopt SO_ATMQOS 22 <-- EINVAL errno >>>> br2684ctl: Fatal: failed to connect on socket; File descriptor in >>>> bad state >>> >>> Hmmm... I have fixed this problem in the past by including the >>> "user_headers". See commit e53ed6af8744 (“linux-atm: use target >>> specific >>> kernel headers”) [1]. Felix suggested this to me in [2]. >>> Does this no longer work? >> >> Good question, I didn't know about that patch. > > Me too. As it was mentioned in cover letter, I've faced the ATM bridge > issue on the latest stable release - 23.05.5. And the e53ed6af87 > ("linux-atm: use target specific kernel headers") commit was > introduced after the branching and was never backported: > > $ git log --oneline -n3 master package/network/utils/linux-atm/ > 3e024022c3 linux-atm: fix build with GCC 14 > e53ed6af87 linux-atm: use target specific kernel headers > 9aa3d5b345 linux-atm: Include linux/sockios.h for SIOCGSTAMP > > $ git log --oneline -n2 openwrt-23.05 package/network/utils/linux-atm/ > 9aa3d5b345 linux-atm: Include linux/sockios.h for SIOCGSTAMP > 806354ab53 linux-atm: Fix compile warning > > I developed the extra fields disabling patch for the stable release > and then rebased. And then in V3 extended it to drop the Lantiq's ATM > hacks entirely. > > BTW, I checked the Martin's fix in the latest master just now. It > works and picks the correct atm.h from the patched kernel. > >> At least on ipq40xx there's nothing writing the custom classes to qos- >> >txtp.traffic_class, it's all just code that reads and checks for >> those, so it's basically useless and dead code. This removal here >> allows us to drop the atm.h patch. > > I checked the git history, it looks like since 2007 only Lantiq's > legacy driver (now ltq-atm) and various compat patches (now > MIPS-lantiq-add-atm-hack.patch) are referencing > ATM_VBR_NRT/ATM_VBR_RT/ATM_UBR_PLUS/ATM_GFR. > > We have two options now. (a) Keep the Lantiq's hack in the tree for > both platform and keep the include path amend in linux-atm. (b) > proceed with this patch and probably backport it to v23 and v24. And > with a follow up patch remove the corresponding ATM hacks from Lantiq > and eventually from linux-atm. > >> If that's the case too for lantiq, we could apply the same logic there >> and make linux-atm shared again? > > Yep. I like the plan 'b' for cleaning the tree from vendor's hacks, > stop spreading them to other targets and simplifying maintenance. I think it would be good if we remove this from the lantiq target as well. The fewer patches, the better. > >> In any case, this set still works on my ipq40xx device and vdsl seems >> to work just fine! > > Have you gave a change to this series, Andre? > > -- > Sergey
On 1/13/25 23:27, Sergey Ryazanov wrote: > Hi Andre, Martin, > > On 13.01.2025 14:17, Andre Heider wrote: > >> At least on ipq40xx there's nothing writing the custom classes to qos- >> >txtp.traffic_class, it's all just code that reads and checks for >> those, so it's basically useless and dead code. This removal here >> allows us to drop the atm.h patch. > > I checked the git history, it looks like since 2007 only Lantiq's legacy > driver (now ltq-atm) and various compat patches (now MIPS-lantiq-add- > atm-hack.patch) are referencing ATM_VBR_NRT/ATM_VBR_RT/ATM_UBR_PLUS/ > ATM_GFR. > > We have two options now. (a) Keep the Lantiq's hack in the tree for both > platform and keep the include path amend in linux-atm. (b) proceed with > this patch and probably backport it to v23 and v24. And with a follow up > patch remove the corresponding ATM hacks from Lantiq and eventually from > linux-atm. > >> If that's the case too for lantiq, we could apply the same logic there >> and make linux-atm shared again? > > Yep. I like the plan 'b' for cleaning the tree from vendor's hacks, stop > spreading them to other targets and simplifying maintenance. > >> In any case, this set still works on my ipq40xx device and vdsl seems >> to work just fine! > > Have you gave a change to this series, Andre? Hi, I am for plan b. If the atm code in the lantiq target does not need the changes to the kernel ABI I would prefer when we remove it and use the unmodified atm header files also for lantiq. Hauke
This set is still working fine without hiccups,. I think we can merge this, I'd even backport it as I think adsl is still a thing in some countries. Cheers, Andre
diff --git a/package/kernel/lantiq/vrx518_tc/patches/101-dcdp-atm_tc-drop-extra-qos-classes.patch b/package/kernel/lantiq/vrx518_tc/patches/101-dcdp-atm_tc-drop-extra-qos-classes.patch new file mode 100644 index 0000000000..5c7b246545 --- /dev/null +++ b/package/kernel/lantiq/vrx518_tc/patches/101-dcdp-atm_tc-drop-extra-qos-classes.patch @@ -0,0 +1,144 @@ +Extra ATM traffic classes requires atm_qos struct extension and a set of +new defines. What itself requires atm.h updates both in the kernel and +in the toolchain. On another hand we do not have any real users of these +traffic classes. + +In absence of real user there are no benefits to support this +functionality. There is only the burden of maintenance of extra patches +all around the building framework. So just drop these extra QoS traffic +classes in order to facilitate maintenance and avoid side effects like +breaking compatibility with existing userspace tools like linux-atm. + +Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> +-- +--- a/dcdp/atm_tc.c ++++ b/dcdp/atm_tc.c +@@ -463,34 +463,9 @@ static void set_qsb(struct atm_priv *pri + /* Weighted Fair Queueing Factor (WFQF) */ + switch (qos->txtp.traffic_class) { + case ATM_CBR: +- case ATM_VBR_RT: + /* real time queue gets weighted fair queueing bypass */ + q_parm_tbl.bit.wfqf = 0; + break; +- case ATM_VBR_NRT: +- case ATM_UBR_PLUS: +- /* WFQF calculation here is based on virtual cell rates, +- to reduce granularity for high rates +- */ +- /* WFQF is maximum cell rate / garenteed cell rate */ +- /* wfqf = qsb_minimum_cell_rate * QSB_WFQ_NONUBR_MAX / +- requested_minimum_peak_cell_rate +- */ +- if (qos->txtp.min_pcr == 0) +- q_parm_tbl.bit.wfqf = QSB_WFQ_NONUBR_MAX; +- else { +- tmp = QSB_GCR_MIN * QSB_WFQ_NONUBR_MAX / +- qos->txtp.min_pcr; +- if (tmp == 0) +- q_parm_tbl.bit.wfqf = 1; +- else if (tmp > QSB_WFQ_NONUBR_MAX) +- q_parm_tbl.bit.wfqf +- = QSB_WFQ_NONUBR_MAX; +- else +- q_parm_tbl.bit.wfqf = tmp; +- } +- break; +- + case ATM_UBR: + default: + q_parm_tbl.bit.wfqf = QSB_WFQ_UBR_BYPASS; +@@ -498,42 +473,9 @@ static void set_qsb(struct atm_priv *pri + } + + /* Sustained Cell Rate (SCR) Leaky Bucket Shaper VBR.0/VBR.1 */ +- if (qos->txtp.traffic_class == ATM_VBR_RT || +- qos->txtp.traffic_class == ATM_VBR_NRT) { +- if (qos->txtp.scr == 0) { +- /* disable shaper */ +- q_vbr_parm_tbl.bit.taus = 0; +- q_vbr_parm_tbl.bit.ts = 0; +- } else { +- /* Cell Loss Priority (CLP) */ +- if ((vcc->atm_options & ATM_ATMOPT_CLP)) +- /* CLP1 */ +- q_parm_tbl.bit.vbr = 1; +- else +- /* CLP0 */ +- q_parm_tbl.bit.vbr = 0; +- /* Rate Shaper Parameter (TS) and +- Burst Tolerance Parameter for SCR (tauS) +- */ +- tmp = ((qsb_clk * param->qsb_tstep) >> 5) / +- qos->txtp.scr + 1; +- q_vbr_parm_tbl.bit.ts +- = tmp > QSB_TP_TS_MAX ? QSB_TP_TS_MAX : tmp; +- tmp = (qos->txtp.mbs - 1) * +- (q_vbr_parm_tbl.bit.ts - +- q_parm_tbl.bit.tp) / 64; +- if (tmp == 0) +- q_vbr_parm_tbl.bit.taus = 1; +- else if (tmp > QSB_TAUS_MAX) +- q_vbr_parm_tbl.bit.taus +- = QSB_TAUS_MAX; +- else +- q_vbr_parm_tbl.bit.taus = tmp; +- } +- } else { +- q_vbr_parm_tbl.bit.taus = 0; +- q_vbr_parm_tbl.bit.ts = 0; +- } ++ /* NB: shaper disabled since there no user interface to activate it */ ++ q_vbr_parm_tbl.bit.taus = 0; ++ q_vbr_parm_tbl.bit.ts = 0; + + /* Queue Parameter Table (QPT) */ + tc_w32(QSB_QPT_SET_MASK, QSB_RTM); +@@ -1064,15 +1006,6 @@ static int ppe_open(struct atm_vcc *vcc) + /* check bandwidth */ + if ((vcc->qos.txtp.traffic_class == ATM_CBR && + vcc->qos.txtp.max_pcr > +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) +- || (vcc->qos.txtp.traffic_class == ATM_VBR_RT && +- vcc->qos.txtp.max_pcr > +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) +- || (vcc->qos.txtp.traffic_class == ATM_VBR_NRT && +- vcc->qos.txtp.scr > +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) +- || (vcc->qos.txtp.traffic_class == ATM_UBR_PLUS && +- vcc->qos.txtp.min_pcr > + (port->tx_max_cell_rate - port->tx_used_cell_rate))) { + tc_dbg(priv->tc_priv, MSG_INIT, "exceed TX line rate\n"); + return -EINVAL; +@@ -1128,15 +1061,8 @@ static int ppe_open(struct atm_vcc *vcc) + /* reserve bandwidth */ + switch (vcc->qos.txtp.traffic_class) { + case ATM_CBR: +- case ATM_VBR_RT: + port->tx_used_cell_rate += vcc->qos.txtp.max_pcr; + break; +- case ATM_VBR_NRT: +- port->tx_used_cell_rate += vcc->qos.txtp.scr; +- break; +- case ATM_UBR_PLUS: +- port->tx_used_cell_rate += vcc->qos.txtp.min_pcr; +- break; + } + + /* update atm_vcc structure */ +@@ -1222,15 +1148,8 @@ static void ppe_close(struct atm_vcc *vc + /* release bandwidth */ + switch (vcc->qos.txtp.traffic_class) { + case ATM_CBR: +- case ATM_VBR_RT: + port->tx_used_cell_rate -= vcc->qos.txtp.max_pcr; + break; +- case ATM_VBR_NRT: +- port->tx_used_cell_rate -= vcc->qos.txtp.scr; +- break; +- case ATM_UBR_PLUS: +- port->tx_used_cell_rate -= vcc->qos.txtp.min_pcr; +- break; + } + + /* idle for a while to let parallel operation finish */ diff --git a/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch b/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch index 0d97ec4d5f..fb1c097f1e 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch @@ -3,7 +3,7 @@ This replaces it by a basic working implementation. --- a/dcdp/atm_tc.c +++ b/dcdp/atm_tc.c -@@ -603,7 +603,11 @@ static void atm_aca_init(struct atm_priv +@@ -545,7 +545,11 @@ static void atm_aca_init(struct atm_priv cfg = &priv->tc_priv->cfg; txin = ¶m.aca_txin; @@ -15,7 +15,7 @@ This replaces it by a basic working implementation. txin->hd_size_in_dw = cfg->txin.soc_desc_dwsz; txin->pd_desc_base = SB_XBAR_ADDR(__ACA_TX_IN_PD_LIST_BASE); txin->pd_desc_num = __ACA_TX_IN_PD_LIST_NUM; -@@ -625,7 +629,11 @@ static void atm_aca_init(struct atm_priv +@@ -567,7 +571,11 @@ static void atm_aca_init(struct atm_priv txin->soc_cmlt_cnt_addr); txout = ¶m.aca_txout; @@ -27,7 +27,7 @@ This replaces it by a basic working implementation. txout->hd_size_in_dw = cfg->txout.soc_desc_dwsz; txout->pd_desc_base = SB_XBAR_ADDR(__ACA_TX_OUT_PD_LIST_BASE); txout->pd_desc_num = __ACA_TX_OUT_PD_LIST_NUM; -@@ -647,7 +655,11 @@ static void atm_aca_init(struct atm_priv +@@ -589,7 +597,11 @@ static void atm_aca_init(struct atm_priv txout->soc_cmlt_cnt_addr); rxout = ¶m.aca_rxout; @@ -39,7 +39,7 @@ This replaces it by a basic working implementation. rxout->hd_size_in_dw = cfg->rxout.soc_desc_dwsz; rxout->pd_desc_base = SB_XBAR_ADDR(__ACA_RX_OUT_PD_LIST_BASE); rxout->pd_desc_num = __ACA_RX_OUT_PD_LIST_NUM; -@@ -669,7 +681,11 @@ static void atm_aca_init(struct atm_priv +@@ -611,7 +623,11 @@ static void atm_aca_init(struct atm_priv rxout->soc_cmlt_cnt_addr); rxin = ¶m.aca_rxin; @@ -51,7 +51,7 @@ This replaces it by a basic working implementation. rxin->hd_size_in_dw = cfg->rxin.soc_desc_dwsz; rxin->pd_desc_base = SB_XBAR_ADDR(__RX_IN_PD_DES_LIST_BASE); rxin->pd_desc_num = __ACA_RX_IN_PD_LIST_NUM; -@@ -1261,7 +1277,7 @@ static int ppe_ioctl(struct atm_dev *dev +@@ -1180,7 +1196,7 @@ static int ppe_ioctl(struct atm_dev *dev static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb) { int ret, qid, mpoa_pt, mpoa_type, vid; @@ -60,7 +60,7 @@ This replaces it by a basic working implementation. struct atm_priv *priv; if (!vcc) { -@@ -1327,12 +1343,14 @@ static int ppe_send(struct atm_vcc *vcc, +@@ -1246,12 +1262,14 @@ static int ppe_send(struct atm_vcc *vcc, tc_dbg(priv->tc_priv, MSG_TX, "vid: 0x%x, qid: 0x%x\n", vid, qid); diff --git a/package/kernel/lantiq/vrx518_tc/patches/202-napi.patch b/package/kernel/lantiq/vrx518_tc/patches/202-napi.patch index 266beba1a7..75d18138c0 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/202-napi.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/202-napi.patch @@ -296,7 +296,7 @@ priv->tc_ops.umt_start = plat_umt_start; --- a/dcdp/atm_tc.c +++ b/dcdp/atm_tc.c -@@ -3650,7 +3650,7 @@ static void atm_aca_ring_config_init(str +@@ -3569,7 +3569,7 @@ static void atm_aca_ring_config_init(str static int atm_ring_init(struct atm_priv *priv) { atm_aca_ring_config_init(priv); @@ -305,7 +305,7 @@ } static int atm_init(struct tc_priv *tcpriv, u32 ep_id) -@@ -4020,7 +4020,7 @@ void atm_tc_unload(void) +@@ -3939,7 +3939,7 @@ void atm_tc_unload(void) /* unregister device */ if (priv->tc_priv->tc_ops.dev_unreg != NULL) priv->tc_priv->tc_ops.dev_unreg(NULL, diff --git a/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch b/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch index bf2d82e2b5..1b70a663cd 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch @@ -1,6 +1,6 @@ --- a/dcdp/atm_tc.c +++ b/dcdp/atm_tc.c -@@ -746,7 +746,8 @@ static void atm_aca_init(struct atm_priv +@@ -688,7 +688,8 @@ static void atm_aca_init(struct atm_priv ACA_TXOUT_EN | ACA_RXIN_EN | ACA_RXOUT_EN, 1); } @@ -10,7 +10,7 @@ { struct tm nowtm; char tmbuf[64]; -@@ -765,7 +766,8 @@ static int print_datetime(char *buffer, +@@ -707,7 +708,8 @@ static int print_datetime(char *buffer, nowtm.tm_hour, nowtm.tm_min, nowtm.tm_sec); @@ -20,7 +20,7 @@ return 0; } -@@ -967,7 +969,7 @@ void show_atm_pvc(struct seq_file *seq, +@@ -909,7 +911,7 @@ void show_atm_pvc(struct seq_file *seq, char buf[64]; seq_printf(seq, "\tNet device: %s\n", pvc->dev->name); diff --git a/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch b/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch index 87456424c3..f268c0908c 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch @@ -23,7 +23,7 @@ Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> --- --- a/dcdp/atm_tc.c +++ b/dcdp/atm_tc.c -@@ -1232,8 +1232,9 @@ static void ppe_close(struct atm_vcc *vc +@@ -1158,8 +1158,9 @@ static void ppe_close(struct atm_vcc *vc validate_oam_htu_entry(priv, 0); spin_unlock_bh(&priv->atm_lock); @@ -35,7 +35,7 @@ Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> memset(conn, 0, sizeof(*conn)); -@@ -2791,24 +2792,26 @@ static void mpoa_setup_sync(struct atm_p +@@ -2710,24 +2711,26 @@ static void mpoa_setup_sync(struct atm_p struct wtx_queue_config_t tx_qcfg; struct uni_cell_header *cell_header; struct atm_vcc *vcc; diff --git a/target/linux/ipq40xx/patches-6.6/998-lantiq-atm-hacks.patch b/target/linux/ipq40xx/patches-6.6/998-lantiq-atm-hacks.patch deleted file mode 100644 index c15a4b3ae3..0000000000 --- a/target/linux/ipq40xx/patches-6.6/998-lantiq-atm-hacks.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: John Crispin <blogic@openwrt.org> -Date: Fri, 3 Aug 2012 10:27:25 +0200 -Subject: [PATCH 04/36] MIPS: lantiq: add atm hack - -Signed-off-by: John Crispin <blogic@openwrt.org> ---- a/include/uapi/linux/atm.h -+++ b/include/uapi/linux/atm.h -@@ -131,8 +131,14 @@ - #define ATM_ABR 4 - #define ATM_ANYCLASS 5 /* compatible with everything */ - -+#define ATM_VBR_NRT ATM_VBR -+#define ATM_VBR_RT 6 -+#define ATM_UBR_PLUS 7 -+#define ATM_GFR 8 -+ - #define ATM_MAX_PCR -1 /* maximum available PCR */ - -+ - struct atm_trafprm { - unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */ - int max_pcr; /* maximum PCR in cells per second */ -@@ -155,6 +161,9 @@ struct atm_trafprm { - unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */ - unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */ - unsigned int spare :9; /* spare bits */ -+ int scr; /* sustained rate in cells per second */ -+ int mbs; /* maximum burst size (MBS) in cells */ -+ int cdv; /* Cell delay variation */ - }; - - struct atm_qos { ---- a/net/atm/proc.c -+++ b/net/atm/proc.c -@@ -141,7 +141,7 @@ static void *vcc_seq_next(struct seq_fil - static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) - { - static const char *const class_name[] = { -- "off", "UBR", "CBR", "VBR", "ABR"}; -+ "off","UBR","CBR","NTR-VBR","ABR","ANY","RT-VBR","UBR+","GFR"}; - static const char *const aal_name[] = { - "---", "1", "2", "3/4", /* 0- 3 */ - "???", "5", "???", "???", /* 4- 7 */
atm_qos struct should be the same both for user and kernel spaces. Via the __SO_ENCODE() macro it is used to define the SO_ATMQOS socket IOC. During the VRX518 support introduction, the atm_trafprm sturct nested into the atm_qos stucture was update with newer fields that are referenced by the ATM TC layer of the VRX518 TC driver. These new fields are intended to communicate information for extra traffic classes supported by the driver. But we are still using vanilla kernel headers to build the toolchain. Due to the atm.h header incoherency br2684ctl from linux-atm tools is incapable to configure the ATM bridge netdev: br2684ctl: Interface "dsl0" created sucessfully br2684ctl: Communicating over ATM 0.1.2, encapsulation: LLC br2684ctl: setsockopt SO_ATMQOS 22 <-- EINVAL errno br2684ctl: Fatal: failed to connect on socket; File descriptor in bad state There are two options to fix this incoherency. (a) update the header file in the toolchain to build linux-atm against updated atm_trafprm and atm_qos structures, or (b) revert atm_trafprm changes. Since there are no actual users of the extra ATM QoS traffic classes, just drop these extra traffic classes from vrx518_tc ATM TC layer and drop the kernel patch updating atm.h. Besides fixing the compatibility with linux-atm tools, removing the kernel patch should simplify kernel updates removing unneeded burden of maintenance. Run tested with FRITZ!Box 7530 with disabled extra traffic classes and then removed them entirely before the submission. CC: John Crispin <john@phrozen.org> Fixes: cfd42a0098 ("ipq40xx: add Intel/Lantiq ATM hacks") Suggested-by: Andre Heider <a.heider@gmail.com> Reported-and-tested-by: nebibigon93@yandex.ru Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> -- Changes: v2->3: drop the extra traffic classes entirely together with the kernel patch for atm.h --- ...1-dcdp-atm_tc-drop-extra-qos-classes.patch | 144 ++++++++++++++++++ .../lantiq/vrx518_tc/patches/200-swplat.patch | 12 +- .../lantiq/vrx518_tc/patches/202-napi.patch | 4 +- ...-dcdp-atm_tc-fix-compilation-warning.patch | 6 +- ...tm_tc-fix-crash-on-subif_reg-absence.patch | 4 +- .../patches-6.6/998-lantiq-atm-hacks.patch | 43 ------ 6 files changed, 157 insertions(+), 56 deletions(-) create mode 100644 package/kernel/lantiq/vrx518_tc/patches/101-dcdp-atm_tc-drop-extra-qos-classes.patch delete mode 100644 target/linux/ipq40xx/patches-6.6/998-lantiq-atm-hacks.patch