+ */
+void rmnet_egress_handler(struct sk_buff *skb,
+                         struct rmnet_logical_ep_conf_s *ep)
+{
+       struct rmnet_phys_ep_conf_s *config;
+       struct net_device *orig_dev;
+       int rc;
+
+       orig_dev = skb->dev;
+       skb->dev = ep->egress_dev;
+
+       config = (struct rmnet_phys_ep_conf_s *)
+               rcu_dereference(skb->dev->rx_handler_data);

This is certainly a misuse of dev->rx_handler_data. Dev private of a
function arg to carry the pointer around.


Hi Jiri

Sorry for the delay in posting a new series.
I have an additional query regarding this comment.

This dev (from skb->dev->rx_handler_data) corresponds to the real_dev to which the rmnet devices are attached to. I had earlier setup a rx_handler on this real_dev netdevice in rmnet_associate_network_device(). Would it still be incorrect to use rx_handler_data of real_dev to have rmnet specific config
information?

Bridge is similarly storing the bridge information on the real_dev
rx_handler_data and retrieving it through br_port_get_rcu(). I am using that
as a reference.

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Reply via email to