diff mbox series

[v2,3/3] xen/netback: use same error messages for same errors

Message ID 20230328131233.2534-4-jgross@suse.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series xen/netback: fix issue introduced recently | expand

Checks

Context Check Description
netdev/series_format warning 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: 18 this patch: 18
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
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: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jürgen Groß March 28, 2023, 1:12 p.m. UTC
Issue the same error message in case an illegal page boundary crossing
has been detected in both cases where this is tested.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch
---
 drivers/net/xen-netback/netback.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Jan Beulich March 28, 2023, 1:32 p.m. UTC | #1
On 28.03.2023 15:12, Juergen Gross wrote:
> Issue the same error message in case an illegal page boundary crossing
> has been detected in both cases where this is tested.
> 
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - new patch
> ---
>  drivers/net/xen-netback/netback.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 9ca4b69d3b39..5dfdec44354a 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -996,10 +996,8 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
>  
>  		/* No crossing a page as the payload mustn't fragment. */
>  		if (unlikely((txreq.offset + txreq.size) > XEN_PAGE_SIZE)) {
> -			netdev_err(queue->vif->dev,
> -				   "txreq.offset: %u, size: %u, end: %lu\n",
> -				   txreq.offset, txreq.size,
> -				   (unsigned long)(txreq.offset&~XEN_PAGE_MASK) + txreq.size);
> +			netdev_err(queue->vif->dev, "Cross page boundary, txp->offset: %u, size: %u\n",
> +				   txreq.offset, txreq.size);
>  			xenvif_fatal_tx_err(queue->vif);
>  			break;
>  		}

To be honest I'm of the opinion that this goes slightly too far:
Making the two messages more similar is certainly helpful. But in
case of problems I think it wouldn't hurt if they're still
distinguishable - when the one here triggers it may e.g also mean
that the calculation of the residual size is causing an issue. So
maybe stick to txreq.offset in the message text, with everything
else left as you have it?

Jan
Jürgen Groß March 29, 2023, 6:21 a.m. UTC | #2
On 28.03.23 15:32, Jan Beulich wrote:
> On 28.03.2023 15:12, Juergen Gross wrote:
>> Issue the same error message in case an illegal page boundary crossing
>> has been detected in both cases where this is tested.
>>
>> Suggested-by: Jan Beulich <jbeulich@suse.com>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>> V2:
>> - new patch
>> ---
>>   drivers/net/xen-netback/netback.c | 6 ++----
>>   1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
>> index 9ca4b69d3b39..5dfdec44354a 100644
>> --- a/drivers/net/xen-netback/netback.c
>> +++ b/drivers/net/xen-netback/netback.c
>> @@ -996,10 +996,8 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
>>   
>>   		/* No crossing a page as the payload mustn't fragment. */
>>   		if (unlikely((txreq.offset + txreq.size) > XEN_PAGE_SIZE)) {
>> -			netdev_err(queue->vif->dev,
>> -				   "txreq.offset: %u, size: %u, end: %lu\n",
>> -				   txreq.offset, txreq.size,
>> -				   (unsigned long)(txreq.offset&~XEN_PAGE_MASK) + txreq.size);
>> +			netdev_err(queue->vif->dev, "Cross page boundary, txp->offset: %u, size: %u\n",
>> +				   txreq.offset, txreq.size);
>>   			xenvif_fatal_tx_err(queue->vif);
>>   			break;
>>   		}
> 
> To be honest I'm of the opinion that this goes slightly too far:
> Making the two messages more similar is certainly helpful. But in
> case of problems I think it wouldn't hurt if they're still
> distinguishable - when the one here triggers it may e.g also mean
> that the calculation of the residual size is causing an issue. So
> maybe stick to txreq.offset in the message text, with everything
> else left as you have it?

Fine with me.


Juergen
diff mbox series

Patch

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 9ca4b69d3b39..5dfdec44354a 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -996,10 +996,8 @@  static void xenvif_tx_build_gops(struct xenvif_queue *queue,
 
 		/* No crossing a page as the payload mustn't fragment. */
 		if (unlikely((txreq.offset + txreq.size) > XEN_PAGE_SIZE)) {
-			netdev_err(queue->vif->dev,
-				   "txreq.offset: %u, size: %u, end: %lu\n",
-				   txreq.offset, txreq.size,
-				   (unsigned long)(txreq.offset&~XEN_PAGE_MASK) + txreq.size);
+			netdev_err(queue->vif->dev, "Cross page boundary, txp->offset: %u, size: %u\n",
+				   txreq.offset, txreq.size);
 			xenvif_fatal_tx_err(queue->vif);
 			break;
 		}