History

Revert "net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver"

This reverts commit 6d709cadfde68dbd12bef12fcced6222226dcb06. The above change was done to avoid calling symbols exported by the switch driver from the tagging protocol driver. With the tagger-owned storage model, we have a new option on our hands, and that is for the switch driver to provide a data consumer handler in the form of a function pointer inside the ->connect_tag_protocol() method. Having a function pointer avoids the problems of the exported symbols approach. By creating a handler for metadata frames holding TX timestamps on SJA1110, we are able to eliminate an skb queue from the tagger data, and replace it with a simple, and stateless, function pointer. This skb queue is now handled exclusively by sja1105_ptp.c, which makes the code easier to follow, as it used to be before the reverted patch.

Vladimir Oltean committed 4 years ago

Commit fcbf9791 parent c79e8485 files · +78 −67Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/dsa/sja1105.h+7−19
@@ -37,6 +37,11 @@ · 36 unmodified lines
3737
3838 #define SJA1105_HWTS_RX_EN 0
3939
40+enum sja1110_meta_tstamp {
41+ SJA1110_META_TSTAMP_TX = 0,
42+ SJA1110_META_TSTAMP_RX = 1,
43+};
44+
4045 struct sja1105_deferred_xmit_work {
4146 struct dsa_port *dp;
4247 struct sk_buff *skb;
@@ -51,12 +56,10 @@ struct sja1105_tagger_data { · 8 unmodified lines
5156 */
5257 spinlock_t meta_lock;
5358 unsigned long state;
54− /* Used on SJA1110 where meta frames are generated only for
55− * 2-step TX timestamps
56− */
57− struct sk_buff_head skb_txtstamp_queue;
5859 struct kthread_worker *xmit_worker;
5960 void (*xmit_work_fn)(struct kthread_work *work);
61+ void (*meta_tstamp_handler)(struct dsa_switch *ds, int port, u8 ts_id,
62+ enum sja1110_meta_tstamp dir, u64 tstamp);
6063 };
6164
6265 struct sja1105_skb_cb {
@@ -69,21 +72,6 @@ struct sja1105_skb_cb { · 6 unmodified lines
6972 #define SJA1105_SKB_CB(skb) \
7073 ((struct sja1105_skb_cb *)((skb)->cb))
7174
72−/* Timestamps are in units of 8 ns clock ticks (equivalent to
73− * a fixed 125 MHz clock).
74− */
75−#define SJA1105_TICK_NS 8
76−
77−static inline s64 ns_to_sja1105_ticks(s64 ns)
78−{
79− return ns / SJA1105_TICK_NS;
80−}
81−
82−static inline s64 sja1105_ticks_to_ns(s64 ticks)
83−{
84− return ticks * SJA1105_TICK_NS;
85−}
86−
8775 static inline struct sja1105_tagger_data *
8876 sja1105_tagger_data(struct dsa_switch *ds)
8977 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t