From: Nicholas Richardson <hidden> Date: 2021-08-02 17:12:27
From: Nick Richardson <redacted>
When the netif_receive xmit_mode is set, a line is supposed to set
clone_skb to a default 0 value. This line is not reached due to a line
that checks if clone_skb is more than zero and returns -ENOTSUPP.
Removes line that defaults clone_skb to zero. -ENOTSUPP is returned
if clone_skb is more than zero. If clone_skb is equal to zero then the
xmit_mode is set to netif_receive as usual and no error is returned.
Signed-off-by: Nick Richardson <redacted>
---
net/core/pktgen.c | 5 -----
1 file changed, 5 deletions(-)
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-08-02 17:21:04
On Mon, 2 Aug 2021 17:12:07 +0000 Nicholas Richardson wrote:
From: Nick Richardson <redacted>
When the netif_receive xmit_mode is set, a line is supposed to set
clone_skb to a default 0 value. This line is not reached due to a line
that checks if clone_skb is more than zero and returns -ENOTSUPP.
Removes line that defaults clone_skb to zero.
s/Removes/Remove/
s/defaults/sets/
-ENOTSUPP is returned
if clone_skb is more than zero.
That's already mentioned in the previous paragraph.
If clone_skb is equal to zero then the
xmit_mode is set to netif_receive as usual and no error is returned.
Please add the explanation why clone_skb can't be negative to the
commit message.
From: Nicholas Richardson <hidden> Date: 2021-08-02 18:22:04
From: Nick Richardson <redacted>
When the netif_receive xmit_mode is set, a line is supposed to set
clone_skb to a default 0 value. This line is made redundant due to a
preceding line that checks if clone_skb is more than zero and returns
-ENOTSUPP.
Only the positive case for clone_skb needs to be checked. It
is impossible for a user to set clone_skb to a negative number.
When a user passes a negative value for clone_skb, the num_arg()
function stops parsing at the first nonnumeric value.
For example: "clone_skb -200" would stop parsing at the
first char ('-') and return zero for the new clone_skb value.
The value read by num_arg() cannot be overflow-ed into the negative
range, since it is an unsigned long.
Remove redundant line that sets clone_skb to zero. If clone_skb is
equal to zero then set xmit_mode to netif_receive as usual and return
no error.
Signed-off-by: Nick Richardson <redacted>
---
net/core/pktgen.c | 5 -----
1 file changed, 5 deletions(-)
From: Nick Richardson <redacted>
When the netif_receive xmit_mode is set, a line is supposed to set
clone_skb to a default 0 value. This line is made redundant due to a
preceding line that checks if clone_skb is more than zero and returns
-ENOTSUPP.
Only the positive case for clone_skb needs to be checked. It
is impossible for a user to set clone_skb to a negative number.
When a user passes a negative value for clone_skb, the num_arg()
function stops parsing at the first nonnumeric value.
For example: "clone_skb -200" would stop parsing at the
first char ('-') and return zero for the new clone_skb value.
The value read by num_arg() cannot be overflow-ed into the negative
range, since it is an unsigned long.
module_param(pg_clone_skb_d, int, 0);
This kernel parameter can also set the value of pkt_dev->clone_skb
In pktgen_add_device() and the value can be negative.
quoted hunk
Remove redundant line that sets clone_skb to zero. If clone_skb is
equal to zero then set xmit_mode to netif_receive as usual and return
no error.
Signed-off-by: Nick Richardson <redacted>
---
net/core/pktgen.c | 5 -----
1 file changed, 5 deletions(-)
From: Nicholas Richardson <hidden> Date: 2021-08-03 16:27:55
From: Nick Richardson <redacted>
When the netif_receive xmit_mode is set, a line is supposed to set
clone_skb to a default 0 value. This line is made redundant due to a
preceding line that checks if clone_skb is more than zero and returns
-ENOTSUPP.
Overriding clone_skb to 0 does not make any difference to the behavior
because if it was positive we return error. So it can be either 0 or
negative, and in both cases the behavior is the same.
Remove redundant line that sets clone_skb to zero.
Signed-off-by: Nick Richardson <redacted>
---
net/core/pktgen.c | 5 -----
1 file changed, 5 deletions(-)
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Tue, 3 Aug 2021 16:27:35 +0000 you wrote:
From: Nick Richardson <redacted>
When the netif_receive xmit_mode is set, a line is supposed to set
clone_skb to a default 0 value. This line is made redundant due to a
preceding line that checks if clone_skb is more than zero and returns
-ENOTSUPP.
[...]