On 4/30/12 12:34 PM, Felix Fietkau wrote:
> On 2012-04-30 8:11 PM, Dave Taht wrote:
>> On Mon, Apr 30, 2012 at 10:26 AM, Felix Fietkau <n...@openwrt.org> wrote:
>>
>> I agree it would blow up the dcache and be worse than what exists by a lot.
>>
>> So, out of this conversation:
>>
>> 1) It would be nice to not have this patch take effect on any but the
>> ar71xx and ar91xx. As these share code in openwrt, doing it with a
>> compile time define
> Right. For upstreaming parts of this stuff, this would definitely be
> necessary.
> 
>> 2) IF there existed another brain damaged ethernet chip on some other
>> arch, it would be worth coming up with a Kbuild option to enable
>> defining __packed generically as part of the network stack for those
>> arches. Something more
>> pithy than
>>
>> #define F_ING_HW_ENGINEER_SAVED_PIN
>>
>> would be needed tho.
>>
>> #define UNALIGNED_ETHERNET
>>
>> perhaps.
> There could be a generic Kconfig variable which could be selected by CPU
> targets or ethernet drivers (with a dependency on
> !HAVE_EFFICIENT_UNALIGNED_ACCESS).
> That's cleaner than messing around with #define stuff manually.
> 
>> 3) I don't like the tcp_hdr macro in general, but it looks like that
>> is an obsolete part of the patch anyway, so I'll try ripping it out.
>>
>> 4) get_unaligned_be32 seems like the right thing rather than
>> get_unaligned_cpu32?
> Right.
> 
>> 5) I THINK the 'if aligned, do assembly version' for the checksums is
>> a win, but if item #2 is true, I'm not happy with the casts...
>>
>> @@ -105,6 +141,9 @@ static inline __sum16 ip_fast_csum(const void
>> *iph, unsigned int ihl)
>>         unsigned int csum;
>>         int carry;
>>
>> +       if ((unsigned int) iph & 3)
>> +               return ip_fast_csum_unaligned(iph,ihl);
>> +
> For casts from pointers to integers, the kernel typically uses unsigned
> long instead of unsigned int.
> 
> - Felix
The kernel has a specific type for this:

include/linux/types.h:typedef unsigned long             uintptr_t;


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to