info.wcid);
} else {
struct airoha_gdm_port *port = netdev_priv(dev);
- u8 pse_port;
+ u8 pse_port, channel;
if (!airoha_is_valid_gdm_port(eth, port))
return -EINVAL;
* loopback
*/
+ /* For traffic forwarded to DSA devices select QoS
+ * channel according to the DSA user port index, rely
+ * on port id otherwise.
+ */
+ channel = dsa_port >= 0 ? dsa_port : port->id;
+ channel = channel % AIROHA_NUM_QOS_CHANNELS;
+ qdata |= FIELD_PREP(AIROHA_FOE_CHANNEL, channel);
+
val |= FIELD_PREP(AIROHA_FOE_IB2_PSE_PORT, pse_port) |
AIROHA_FOE_IB2_PSE_QOS;
/* For downlink traffic consume SRAM memory for hw