History

Revert "ptr_ring: move free-space check into separate helper"

This reverts commit fba362c17d9d9211fc51f272156bb84fc23bdf98. __ptr_ring_check_produce() has no users left after reverting commit 1d6e569b7d0c ("tun/tap & vhost-net: avoid ptr_ring tail-drop when a qdisc is present").

Simon Schippers committed 3 months ago

Commit 6bc85571 parent f11b48a1 file · +2 −18Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/linux/ptr_ring.h+2−18
@@ -96,20 +96,6 @@ static inline bool ptr_ring_full_bh(struct ptr_ring *r) · 95 unmodified lines
96 return ret;96 return ret;
97}97}
98 98
99/* Note: callers invoking this in a loop must use a compiler barrier,
100 * for example cpu_relax(). Callers must hold producer_lock.
101 */
102static inline int __ptr_ring_check_produce(struct ptr_ring *r)
103{
104 if (unlikely(!r->size))
105 return -EINVAL;
106
107 if (data_race(r->queue[r->producer]))
108 return -ENOSPC;
109
110 return 0;
111}
112
113/* Note: callers invoking this in a loop must use a compiler barrier,99/* Note: callers invoking this in a loop must use a compiler barrier,
114 * for example cpu_relax(). Callers must hold producer_lock.100 * for example cpu_relax(). Callers must hold producer_lock.
115 * Callers are responsible for making sure pointer that is being queued101 * Callers are responsible for making sure pointer that is being queued
@@ -117,10 +103,8 @@ static inline int __ptr_ring_check_produce(struct ptr_ring *r) · 1 unmodified line
117 */103 */
118static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr)104static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr)
119{105{
120 int p = __ptr_ring_check_produce(r);106 if (unlikely(!r->size) || data_race(r->queue[r->producer]))
121 107 return -ENOSPC;
122 if (p)
123 return p;
124 108
125 /* Make sure the pointer we are storing points to a valid data. */109 /* Make sure the pointer we are storing points to a valid data. */
126 /* Pairs with the dependency ordering in __ptr_ring_consume. */110 /* Pairs with the dependency ordering in __ptr_ring_consume. */