Skip to contentSkip to conversation

backport: allow compilation with Ubuntu's 3.13

PATCH In review Emmanuel Grumbach 7 participants 16 messages May 19, 2015 – Jun 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backport: allow compilation with Ubuntu's 3.13

Canonical backported:

Author: Or Gerlitz <[email protected]>
Date:   Mon Jan 20 13:59:19 2014 +0200

net: Add GRO support for UDP encapsulating protocols

This is commit 2da204a8f67fbe25816cbce8cc8551f03d5b951a in their tree.
Cope with that.

---
Touch compiled only. And I don't really know how the UTS thing goes :)

---
 backport/backport-include/linux/netdevice.h | 2 ++
 1 file changed, 2 insertions(+)
backport/backport-include/linux/netdevice.h +2 -0
index bb3fefb..61ac95c 100644
@@ -81,6 +81,7 @@ static inline void dev_consume_skb_any(struct sk_buff *skb)
 	dev_kfree_skb_any(skb);
 }
 
+#if (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI < 24)
 struct pcpu_sw_netstats {
 	u64     rx_packets;
 	u64     rx_bytes;
@@ -88,6 +89,7 @@ struct pcpu_sw_netstats {
 	u64     tx_bytes;
 	struct u64_stats_sync   syncp;
 };
+#endif
 
 #define netdev_tstats(dev)	((struct pcpu_sw_netstats *)dev->ml_priv)
 #define netdev_assign_tstats(dev, e)	dev->ml_priv = (e);
Signature · 1 line
2.1.4
#1 lore raw
Quoted 1 line · Emmanuel Grumbach

+#if (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI < 24)

Now that I look at this again, I'm confused - shouldn't this whole thing have a ! in front?

johannes

#2 lore raw

T24gV2VkLCAyMDE1LTA1LTIwIGF0IDEwOjI3ICswMjAwLCBKb2hhbm5lcyBCZXJnIHdyb3RlOg0K PiBPbiBUdWUsIDIwMTUtMDUtMTkgYXQgMTY6NDIgKzAzMDAsIEVtbWFudWVsIEdydW1iYWNoIHdy b3RlOg0KPiANCj4gPiArI2lmIChMSU5VWF9WRVJTSU9OX0NPREUgPT0gS0VSTkVMX1ZFUlNJT04o MywxMywxMSkgJiYgVVRTX1VCVU5UVV9SRUxFQVNFX0FCSSA8IDI0KQ0KPiANCj4gTm93IHRoYXQg SSBsb29rIGF0IHRoaXMgYWdhaW4sIEknbSBjb25mdXNlZCAtIHNob3VsZG4ndCB0aGlzIHdob2xl IHRoaW5nDQo+IGhhdmUgYSAhIGluIGZyb250Pw0KPiANCg0Kd2h5Pw0KSSBuZWVkIHRoaXMgZGVm aW5pdGlvbiBvbmx5IGZvciBVYnVudHUgcmVsZWFzZXMgdGhhdCBhcmUgYmVsb3cgMjQuDQpDYW5v bmljYWwgcG9ydGVkIHRoYXQgc3RhcnRpbmcgMjQuDQpXaGF0IGFtIEkgbWlzc2luZz8NCg==

#3 lore raw
Quoted 5 lines · Emmanuel
Quoted 4 lines · Johannes Berg
Quoted 1 line · Emmanuel Grumbach

+#if (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI < 24)

Quoted 8 lines
Quoted 3 lines

Now that I look at this again, I'm confused - shouldn't this whole thing have a ! in front?

why?
I need this definition only for Ubuntu releases that are below 24. Canonical ported that starting 24.
What am I missing?

But every mainline kernel, say 3.10, also needs it. Also Ubuntu with 3.10, for example.

johannes

#4 lore raw

T24gV2VkLCAyMDE1LTA1LTIwIGF0IDEwOjM0ICswMjAwLCBKb2hhbm5lcyBCZXJnIHdyb3RlOg0K PiBPbiBXZWQsIDIwMTUtMDUtMjAgYXQgMDg6MzEgKzAwMDAsIEdydW1iYWNoLCBFbW1hbnVlbCB3 cm90ZToNCj4gPiBPbiBXZWQsIDIwMTUtMDUtMjAgYXQgMTA6MjcgKzAyMDAsIEpvaGFubmVzIEJl cmcgd3JvdGU6DQo+ID4gPiBPbiBUdWUsIDIwMTUtMDUtMTkgYXQgMTY6NDIgKzAzMDAsIEVtbWFu dWVsIEdydW1iYWNoIHdyb3RlOg0KPiA+ID4gDQo+ID4gPiA+ICsjaWYgKExJTlVYX1ZFUlNJT05f Q09ERSA9PSBLRVJORUxfVkVSU0lPTigzLDEzLDExKSAmJiBVVFNfVUJVTlRVX1JFTEVBU0VfQUJJ IDwgMjQpDQo+ID4gPiANCj4gPiA+IE5vdyB0aGF0IEkgbG9vayBhdCB0aGlzIGFnYWluLCBJJ20g Y29uZnVzZWQgLSBzaG91bGRuJ3QgdGhpcyB3aG9sZSB0aGluZw0KPiA+ID4gaGF2ZSBhICEgaW4g ZnJvbnQ/DQo+ID4gPiANCj4gPiANCj4gPiB3aHk/DQo+ID4gSSBuZWVkIHRoaXMgZGVmaW5pdGlv biBvbmx5IGZvciBVYnVudHUgcmVsZWFzZXMgdGhhdCBhcmUgYmVsb3cgMjQuDQo+ID4gQ2Fub25p Y2FsIHBvcnRlZCB0aGF0IHN0YXJ0aW5nIDI0Lg0KPiA+IFdoYXQgYW0gSSBtaXNzaW5nPw0KPiAN Cj4gQnV0IGV2ZXJ5IG1haW5saW5lIGtlcm5lbCwgc2F5IDMuMTAsIGFsc28gbmVlZHMgaXQuIEFs c28gVWJ1bnR1IHdpdGgNCj4gMy4xMCwgZm9yIGV4YW1wbGUuDQo+IA0KDQpZb3UgYXJlIHJpZ2h0 IG9idmlvdXNseS4NCg==

#5 lore raw
Quoted 16 lines · Emmanuel
Quoted 15 lines · Johannes Berg
Quoted 13 lines · Emmanuel
Quoted 7 lines · Johannes Berg
Quoted 1 line · Emmanuel Grumbach

+#if (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI < 24)

Now that I look at this again, I'm confused - shouldn't this whole thing have a ! in front?

why?
I need this definition only for Ubuntu releases that are below 24. Canonical ported that starting 24.
What am I missing?

Quoted 5 lines
Quoted 3 lines

But every mainline kernel, say 3.10, also needs it. Also Ubuntu with 3.10, for example.

You are right obviously.

What happens if the user is not running a Ubuntu kernel and UTS_UBUNTU_RELEASE_ABI is undefined?

I am really pissed off about Ubuntu's backporting API changes so that testing LINUX_VERSION_CODE is no longer sufficient. In fact when someone complains the one of the out-of-kernel drivers that I maintain does not build with kernel X.Y, I check that version out in mainline, build the driver to make sure the problem is not mine, and then tell them to complain to their vendor. I no longer fix those problems. I think RHEL is also doing the same kind of thing - at least I did get one complaint about a build problem that seemed to be due to an API backport. Where do we stop?

Larry

#6 lore raw

T24gV2VkLCAyMDE1LTA1LTIwIGF0IDEwOjMwIC0wNTAwLCBMYXJyeSBGaW5nZXIgd3JvdGU6DQo+ IE9uIDA1LzIwLzIwMTUgMDM6MzkgQU0sIEdydW1iYWNoLCBFbW1hbnVlbCB3cm90ZToNCj4gPiBP biBXZWQsIDIwMTUtMDUtMjAgYXQgMTA6MzQgKzAyMDAsIEpvaGFubmVzIEJlcmcgd3JvdGU6DQo+ ID4+IE9uIFdlZCwgMjAxNS0wNS0yMCBhdCAwODozMSArMDAwMCwgR3J1bWJhY2gsIEVtbWFudWVs IHdyb3RlOg0KPiA+Pj4gT24gV2VkLCAyMDE1LTA1LTIwIGF0IDEwOjI3ICswMjAwLCBKb2hhbm5l cyBCZXJnIHdyb3RlOg0KPiA+Pj4+IE9uIFR1ZSwgMjAxNS0wNS0xOSBhdCAxNjo0MiArMDMwMCwg RW1tYW51ZWwgR3J1bWJhY2ggd3JvdGU6DQo+ID4+Pj4NCj4gPj4+Pj4gKyNpZiAoTElOVVhfVkVS U0lPTl9DT0RFID09IEtFUk5FTF9WRVJTSU9OKDMsMTMsMTEpICYmIFVUU19VQlVOVFVfUkVMRUFT RV9BQkkgPCAyNCkNCj4gPj4+Pg0KPiA+Pj4+IE5vdyB0aGF0IEkgbG9vayBhdCB0aGlzIGFnYWlu LCBJJ20gY29uZnVzZWQgLSBzaG91bGRuJ3QgdGhpcyB3aG9sZSB0aGluZw0KPiA+Pj4+IGhhdmUg YSAhIGluIGZyb250Pw0KPiA+Pj4+DQo+ID4+Pg0KPiA+Pj4gd2h5Pw0KPiA+Pj4gSSBuZWVkIHRo aXMgZGVmaW5pdGlvbiBvbmx5IGZvciBVYnVudHUgcm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bmdlciBmaXggDQo+IHRob3NlIHByb2JsZW1zLiBJIHRo aW5rIFJIRUwgaXMgYWxzbyBkb2luZyB0aGUgc2FtZSBraW5kIG9mIHRoaW5nIC0gYXQgbGVhc3Qg SSANCj4gZGlkIGdldCBvbmUgY29tcGxhaW50IGFib3V0IGEgYnVpbGQgcHJvYmxlbSB0aGF0IHNl ZW1lZCB0byBiZSBkdWUgdG8gYW4gQVBJIA0KPiBiYWNrcG9ydC4gV2hlcmUgZG8gd2Ugc3RvcD8N Cg0KR29vZCBxdWVzdGlvbi4uLiBJIGRvbid0IGtub3cuIE9UT0gsIGRpc3Ryb3MgZG9uJ3QgcmVh bGx5IHN1cHBvcnQNCmJhY2twb3J0LiBZb3UgY2FuJ3QgcmVhbGx5IGJsYW1lIHRoZW0gaWYgdGhl eSBicmVhayBiYWNrcG9ydCwgd2h5IHNob3VsZA0KdGhleSBjYXJlPw0KSSBhZ3JlZS4gSXQgaXMg YW5ub3lpbmcuIFdlIGNhbiB0cnkgdG8gY29udmluY2UgdGhlbSwgYnV0IEkgZG9uJ3QgdGhpbmsN CnRoYXQgc2F5aW5nICJ5b3UgYXJlIGFsbCB3cm9uZyIgaXMgdGhlIHJpZ2h0IHBhdGguIE1heWJl IHdlIHNob3VsZCB0cnkNCnRvIGhhdmUgdGhlbSBtb3JlIGludm9sdmVkIGluIGJhY2twb3J0IHRv IGZpeCBpdCB0aGVtc2VsdmVzPw0KQW5kIGV4cGxhaW4gdG8gdGhlbSBob3cgaW1wb3J0YW50IGl0 IGlzIHRvIGJlIGFibGUgdG8gcnVuIGJhY2twb3J0IG9uDQp0b3Agb2YgYWxsIHRoZWlyIHNoaXBw ZWQga2VybmVscz8NCg0KPiANCj4gTGFycnkNCj4gDQo+IA0KPiANCj4gDQoNCg==

#7 lore raw
Quoted 9 lines · Emmanuel

Good question... I don't know. OTOH, distros don't really support backport. You can't really blame them if they break backport, why should they care?
I agree. It is annoying. We can try to convince them, but I don't think that saying "you are all wrong" is the right path. Maybe we should try to have them more involved in backport to fix it themselves? And explain to them how important it is to be able to run backport on top of all their shipped kernels?

Supporting backport would be a first step, but that won't help all of the rtl8* repos that I have at GitHub. Most of those do not have drivers in the kernel, thus the users are dependent on that kind of external repo; however, I do not have any desire to find out what macro needs to be tested so that these drivers will build on distros that I do not use.

I guess I should report a bug to whatever disto breaks my driver and request that they fix it. I already know how much that will help :)

Larry

#8 lore raw

T24gV2VkLCAyMDE1LTA1LTIwIGF0IDExOjUzIC0wNTAwLCBMYXJyeSBGaW5nZXIgd3JvdGU6DQo+ IE9uIDA1LzIwLzIwMTUgMTE6NDIgQU0sIEdydW1iYWNoLCBFbW1hbnVlbCB3cm90ZToNCj4gPg0K PiA+IEdvb2QgcXVlc3Rpb24uLi4gSSBkb24ndCBrbm93LiBPVE9ILCBkaXN0cm9zIGRvbid0IHJl YWxseSBzdXBwb3J0DQo+ID4gYmFja3BvcnQuIFlvdSBjYW4ndCByZWFsbHkgYmxhbWUgdGhlbSBp ZiB0aGV5IGJyZWFrIGJhY2twb3J0LCB3aHkgc2hvdWxkDQo+ID4gdGhleSBjYXJlPw0KPiA+IEkg YWdyZWUuIEl0IGlzIGFubm95aW5nLiBXZSBjYW4gdHJ5IHRvIGNvbnZpbmNlIHRoZW0sIGJ1dCBJ IGRvbid0IHRoaW5rDQo+ID4gdGhhdCBzYXlpbmcgInlvdSBhcmUgYWxsIHdyb25nIiBpcyB0aGUg cmlnaHQgcGF0aC4gTWF5YmUgd2Ugc2hvdWxkIHRyeQ0KPiA+IHRvIGhhdmUgdGhlbSBtb3JlIGlu dm9sdmVkIGluIGJhY2twb3J0IHRvIGZpeCBpdCB0aGVtc2VsdmVzPw0KPiA+IEFuZCBleHBsYWlu IHRvIHRoZW0gaG93IGltcG9ydGFudCBpdCBpcyB0byBiZSBhYmxlIHRvIHJ1biBiYWNrcG9ydCBv bg0KPiA+IHRvcCBvZiBhbGwgdGhlaXIgc2hpcHBlZCBrZXJuZWxzPw0KPiANCj4gU3VwcG9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ciBpc3N1ZXMuLi4gOikNCg0KPiBM YXJyeQ0KPiANCj4gDQoNCg==

#9 lore raw
In reply to Larry Finger
Quoted 11 lines · Larry Finger
Quoted 9 lines · Emmanuel

Good question... I don't know. OTOH, distros don't really support backport. You can't really blame them if they break backport, why should they care?
I agree. It is annoying. We can try to convince them, but I don't think that saying "you are all wrong" is the right path. Maybe we should try to have them more involved in backport to fix it themselves? And explain to them how important it is to be able to run backport on top of all their shipped kernels?

Quoted 5 lines

Supporting backport would be a first step, but that won't help all of the rtl8* repos that I have at GitHub. Most of those do not have drivers in the kernel, thus the users are dependent on that kind of external repo; however, I do not have any desire to find out what macro needs to be tested so that these drivers will build on distros that I do not use.

Maybe you could just use backports for those drivers?

johannes

#10 lore raw
In reply to Larry Finger
Quoted 8 lines · Larry Finger

I am really pissed off about Ubuntu's backporting API changes so that testing LINUX_VERSION_CODE is no longer sufficient. In fact when someone complains the one of the out-of-kernel drivers that I maintain does not build with kernel X.Y, I check that version out in mainline, build the driver to make sure the problem is not mine, and then tell them to complain to their vendor. I no longer fix those problems. I think RHEL is also doing the same kind of thing - at least I did get one complaint about a build problem that seemed to be due to an API backport. Where do we stop?

Distros have been doing backporting for years, and their solutions differ a bit, the Linux backports projects provides an outlet to generalize a bit of this work through a systematic approach that aims towards automation as much as possible. Some distributions have already found value to this and embrace backports somehow, some others are considering how to integrate it. For those distributions that have already embraced backports and that also provide their own ABI they resort to ABI solutions as described in this thread and patch. As an example Red Hat already has integrated into backports support to address ABI differences and they do that themselves, we welcome this. Other distros should follow suit if they need this as well, and obviously their solution should not interfere with the general kernels.

On the other hand based on experience with these issues we have also embraced proactive practices over time to try to avoid conflicts with such kernel ABIs, one example was to embrace the #idef foo strategy which checks to see if a kernel has defined a "foo" API already instead of #if code with LINUX_VERSION_CODE stuff in which we know an upstream kernel defined it, as is typically done. This is a strategy *new* developers can embrace to help with this problem but it means new code should use these #define strategies somehow when introducing APIs.

For a while now I have been suggesting that over time we will likely run into concrete items for automation for backporting or just general backporting which could implicate how we should do development upstream. This is an example of one of those best practices that could be widely embraced to help make backporter's life easier. If we want to take this a step further, which I want to, we'd add a grammatical strategy to help with automation but I don't think we're there yet to formalize that precisely just yet.

Luis

#11 lore raw
Quoted 2 lines · Luis R. Rodriguez

This is a strategy
*new* developers

Sorry I meant that developers can use for *new* upstream code.

Luis

#12 lore raw
In reply to Grumbach, Emmanuel
Quoted 5 lines · Emmanuel
Quoted 4 lines · Johannes Berg
Quoted 1 line · Emmanuel Grumbach

+#if (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI < 24)

Quoted 8 lines
Quoted 3 lines

Now that I look at this again, I'm confused - shouldn't this whole thing have a ! in front?

why?
I need this definition only for Ubuntu releases that are below 24. Canonical ported that starting 24.
What am I missing?

At least the code as is doesn't work for me on Ubuntu 12.04 with 3.10 kernel...

--
Luca

#13 lore raw
In reply to Emmanuel Grumbach
Quoted 32 lines · Emmanuel Grumbach

Canonical backported:

Author: Or Gerlitz <[email protected]>
Date:   Mon Jan 20 13:59:19 2014 +0200

net: Add GRO support for UDP encapsulating protocols

This is commit 2da204a8f67fbe25816cbce8cc8551f03d5b951a in their tree.
Cope with that.

---
Touch compiled only. And I don't really know how the UTS thing goes :)

---
 backport/backport-include/linux/netdevice.h | 2 ++
 1 file changed, 2 insertions(+)
backport/backport-include/linux/netdevice.h +1 -0
index bb3fefb..61ac95c 100644
@@ -81,6 +81,7 @@ static inline void dev_consume_skb_any(struct sk_buff *skb)
 	dev_kfree_skb_any(skb);
 }
 
+#if (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI < 24)
 struct pcpu_sw_netstats {
 	u64     rx_packets;
 	u64     rx_bytes;

backport/backport-include/linux/netdevice.h struct pcpu_sw_netstats { · line 95

Quoted 7 lines
backport/backport-include/linux/netdevice.h +1 -0
@@ -88,6 +89,7 @@ struct pcpu_sw_netstats {
 	u64     tx_bytes;
 	struct u64_stats_sync   syncp;
 };
+#endif
 
 #define netdev_tstats(dev)	((struct pcpu_sw_netstats *)dev->ml_priv)
 #define netdev_assign_tstats(dev, e)	dev->ml_priv = (e);

Thank you for the patch, it was applied and pushed.

I changed it into this:
+#if (LINUX_VERSION_CODE != KERNEL_VERSION(3,13,11) || UTS_UBUNTU_RELEASE_ABI < 24)
...
#endif

Hauke

#14 lore raw
Quoted 44 lines · Hauke Mehrtens
Quoted 32 lines · Emmanuel Grumbach

Canonical backported:

Author: Or Gerlitz <[email protected]>
Date:   Mon Jan 20 13:59:19 2014 +0200

net: Add GRO support for UDP encapsulating protocols

This is commit 2da204a8f67fbe25816cbce8cc8551f03d5b951a in their tree.
Cope with that.

---
Touch compiled only. And I don't really know how the UTS thing goes :)

---
 backport/backport-include/linux/netdevice.h | 2 ++
 1 file changed, 2 insertions(+)
backport/backport-include/linux/netdevice.h +1 -0
index bb3fefb..61ac95c 100644
@@ -81,6 +81,7 @@ static inline void dev_consume_skb_any(struct sk_buff *skb)
 	dev_kfree_skb_any(skb);
 }
 
+#if (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI < 24)
 struct pcpu_sw_netstats {
 	u64     rx_packets;
 	u64     rx_bytes;

backport/backport-include/linux/netdevice.h struct pcpu_sw_netstats { · line 95

Quoted 7 lines
backport/backport-include/linux/netdevice.h +1 -0
@@ -88,6 +89,7 @@ struct pcpu_sw_netstats {
 	u64     tx_bytes;
 	struct u64_stats_sync   syncp;
 };
+#endif
 
 #define netdev_tstats(dev)	((struct pcpu_sw_netstats *)dev->ml_priv)
 #define netdev_assign_tstats(dev, e)	dev->ml_priv = (e);

Thank you for the patch, it was applied and pushed.

Quoted 5 lines

I changed it into this:
+#if (LINUX_VERSION_CODE != KERNEL_VERSION(3,13,11) || UTS_UBUNTU_RELEASE_ABI < 24)
...
#endif

Isn't this still wrong? What if the kernel is >= 3,13,11? In that case, the struct will be already defined... and if it's an upstream kernel (i.e. UTS_UBU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