Re: [PATCH v8 net-next 3/4] net: enetc: add LSO support for i.MX95 ENETC PF

From: Alexander Lobakin
Date: Wed Dec 18 2024 - 09:31:41 EST


From: Wei Fang <wei.fang@xxxxxxx>
Date: Wed, 18 Dec 2024 03:06:06 +0000

>>> +static inline int enetc_lso_count_descs(const struct sk_buff *skb) {
>>> + /* 4 BDs: 1 BD for LSO header + 1 BD for extended BD + 1 BD
>>> + * for linear area data but not include LSO header, namely
>>> + * skb_headlen(skb) - lso_hdr_len. And 1 BD for gap.

[...]

>>> + ((first) & SILSOSFMR0_TCP_1ST_SEG))
>>> +
>>> +#define ENETC4_SILSOSFMR1 0x1304
>>> +#define SILSOSFMR1_TCP_LAST_SEG GENMASK(11, 0)
>>> +#define TCP_FLAGS_FIN BIT(0)
>>> +#define TCP_FLAGS_SYN BIT(1)
>>> +#define TCP_FLAGS_RST BIT(2)
>>> +#define TCP_FLAGS_PSH BIT(3)
>>> +#define TCP_FLAGS_ACK BIT(4)
>>> +#define TCP_FLAGS_URG BIT(5)
>>> +#define TCP_FLAGS_ECE BIT(6)
>>> +#define TCP_FLAGS_CWR BIT(7)
>>> +#define TCP_FLAGS_NS BIT(8)
>>
>> Why are you open-coding these if they're present in uapi/linux/tcp.h?
>
> Okay, I will add 'ENETC' prefix.

You don't need to add a prefix, you need to just use the generic
definitions from the abovementioned file.

>>
>>> +/* According to tso_build_hdr(), clear all special flags for not last
>>> +packet. */
>>
>> But this mask is used only to do a writel(), I don't see it anywhere clearing
>> anything...

Thanks,
Olek