diff mbox series

Fix encoding of ethernet frame length for big endian platforms in QCA7000/7005 protocol header.

Message ID 20230822065956.8719-1-kornel.swierzy@embevity.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Fix encoding of ethernet frame length for big endian platforms in QCA7000/7005 protocol header. | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1332 this patch: 1330
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1355 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

kornel.swierzy@embevity.com Aug. 22, 2023, 6:59 a.m. UTC
From: Kornel Swierzy <kornel.swierzy@embevity.com>

QCA7000 protocol requires that ethernet frame length is encoded
as u16 little endian value. Current implementation does not work
on big endian architectures.

Signed-off-by: Kornel Swierzy <kornel.swierzy@embevity.com>
---
 drivers/net/ethernet/qualcomm/qca_7k_common.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Andrew Lunn Aug. 22, 2023, 4:08 p.m. UTC | #1
On Tue, Aug 22, 2023 at 08:59:56AM +0200, kornel.swierzy@embevity.com wrote:
> From: Kornel Swierzy <kornel.swierzy@embevity.com>
> 
> QCA7000 protocol requires that ethernet frame length is encoded
> as u16 little endian value. Current implementation does not work
> on big endian architectures.
> 
> Signed-off-by: Kornel Swierzy <kornel.swierzy@embevity.com>

Hi Kornel

Please take a look at

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq

and

https://docs.kernel.org/process/submitting-patches.html

This appears to be a bugfix, so it should have a Fixes: tag. It then
should be based on the net tree, and this should be indicated in the
Subject: line.

That change itself looks fine, you just have some process issues to
correct.

	Andrew
kornel.swierzy@embevity.com Aug. 26, 2023, 4:43 a.m. UTC | #2
From: Kornel Swierzy <kornel.swierzy@embevity.com>

On 8/22/23 18:08, Andrew Lunn wrote:

> On Tue, Aug 22, 2023 at 08:59:56AM +0200, kornel.swierzy@embevity.com wrote:
>> From: Kornel Swierzy <kornel.swierzy@embevity.com>
>>
>> QCA7000 protocol requires that ethernet frame length is encoded
>> as u16 little endian value. Current implementation does not work
>> on big endian architectures.
>>
>> Signed-off-by: Kornel Swierzy <kornel.swierzy@embevity.com>
> Hi Kornel
>
> Please take a look at
>
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq
>
> and
>
> https://docs.kernel.org/process/submitting-patches.html
>
> This appears to be a bugfix, so it should have a Fixes: tag. It then
> should be based on the net tree, and this should be indicated in the
> Subject: line.
>
> That change itself looks fine, you just have some process issues to
> correct.
>
> 	Andrew

Hi Andrew,

thanks for the answer and help in submitting my first patch.

I have one question regarding your comment on which I couldn't find any 
answer in the internet: should I post the patch with corrected subject 
and added "fixes" line as an reply to this conversation or it is better 
to submit it as a new patch?


Best regards,

Kornel
diff mbox series

Patch

diff --git a/drivers/net/ethernet/qualcomm/qca_7k_common.c b/drivers/net/ethernet/qualcomm/qca_7k_common.c
index 6b511f05df61..7bb7ae85fcf7 100644
--- a/drivers/net/ethernet/qualcomm/qca_7k_common.c
+++ b/drivers/net/ethernet/qualcomm/qca_7k_common.c
@@ -30,19 +30,15 @@ 
 u16
 qcafrm_create_header(u8 *buf, u16 length)
 {
-	__le16 len;
-
 	if (!buf)
 		return 0;
 
-	len = cpu_to_le16(length);
-
 	buf[0] = 0xAA;
 	buf[1] = 0xAA;
 	buf[2] = 0xAA;
 	buf[3] = 0xAA;
-	buf[4] = len & 0xff;
-	buf[5] = (len >> 8) & 0xff;
+	buf[4] = length & 0xff;
+	buf[5] = (length >> 8) & 0xff;
 	buf[6] = 0;
 	buf[7] = 0;