From nobody Mon Apr 29 09:42:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1680009199; cv=none; d=zohomail.com; s=zohoarc; b=EZ6mFzaNSuaO20pQKamOHSJBQl0XR+ElvdrKnJ00FBWA18bhj7LFdVeSS7WATTYOyZESYwzPdNAYA5eOlWeWDazCUaWvJnRoMv6LdytWcq4Oo3A2KrBFcm44DXGyjSX+dlMnSS+wZiriOgQPUEpTFkiMYswfcE3Qm12ZxARjfZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680009199; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GRtiw58QBwYt1y2vIyrV4Ht9sSLlbTNKn/D5VG5kP7Q=; b=iRXPMjXjyubRrfInW9zNZ4eEHIPIvO6yFS19ZXV1QMAjZvRfGF911Z6fqal+vHlEHPk/Ahv9/FFD+eJIKwKmdJFM8iKY/yRyhYG7ozwIXaqZOtoDFvSqd1RjQZwux5TpVVceRipAnOl63L2D9ITQ0kuGjC4AemlJ/30ropshZmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1680009199420659.3362483090374; Tue, 28 Mar 2023 06:13:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.515803.798989 (Exim 4.92) (envelope-from ) id 1ph98G-0005p9-Go; Tue, 28 Mar 2023 13:13:00 +0000 Received: by outflank-mailman (output) from mailman id 515803.798989; Tue, 28 Mar 2023 13:13:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ph98G-0005p2-EA; Tue, 28 Mar 2023 13:13:00 +0000 Received: by outflank-mailman (input) for mailman id 515803; Tue, 28 Mar 2023 13:12:59 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ph98F-0005os-2X for xen-devel@lists.xenproject.org; Tue, 28 Mar 2023 13:12:59 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 41801ebf-cd6a-11ed-b464-930f4c7d94ae; Tue, 28 Mar 2023 15:12:56 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A0B271FD68; Tue, 28 Mar 2023 13:12:56 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 465211390D; Tue, 28 Mar 2023 13:12:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1mr0D9jnImQvTgAAMHmgww (envelope-from ); Tue, 28 Mar 2023 13:12:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 41801ebf-cd6a-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680009176; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GRtiw58QBwYt1y2vIyrV4Ht9sSLlbTNKn/D5VG5kP7Q=; b=T8dWjekjuCeQuXPswXPubpp/ASd5SY0NYnRBczh42+aTdCelOiFWCymfpmrRbED+E+Tc08 j1Juj+Ph6kGm1D58BaiYC5r8FLnV8X8Yp2pRbjEy91XLbE6A84OfTp95bz/xioUXHglBy9 ivSyG2ZAVS4xp+CvmysQeiDShu/Nnfo= From: Juergen Gross To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Juergen Gross , Wei Liu , Paul Durrant , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , xen-devel@lists.xenproject.org, stable@vger.kernel.org Subject: [PATCH v2 1/3] xen/netback: don't do grant copy across page boundary Date: Tue, 28 Mar 2023 15:12:31 +0200 Message-Id: <20230328131233.2534-2-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230328131047.2440-1-jgross@suse.com> References: <20230328131047.2440-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1680009201248100001 Content-Type: text/plain; charset="utf-8" Fix xenvif_get_requests() not to do grant copy operations across local page boundaries. This requires to double the maximum number of copy operations per queue, as each copy could now be split into 2. Make sure that struct xenvif_tx_cb doesn't grow too large. Cc: stable@vger.kernel.org Fixes: ad7f402ae4f4 ("xen/netback: Ensure protocol headers don't fall in th= e non-linear area") Signed-off-by: Juergen Gross Reviewed-by: Paul Durrant --- V2: - add another BUILD_BUG_ON() (Jan Beulich) --- drivers/net/xen-netback/common.h | 2 +- drivers/net/xen-netback/netback.c | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/com= mon.h index 3dbfc8a6924e..1fcbd83f7ff2 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h @@ -166,7 +166,7 @@ struct xenvif_queue { /* Per-queue data for xenvif */ struct pending_tx_info pending_tx_info[MAX_PENDING_REQS]; grant_handle_t grant_tx_handle[MAX_PENDING_REQS]; =20 - struct gnttab_copy tx_copy_ops[MAX_PENDING_REQS]; + struct gnttab_copy tx_copy_ops[2 * MAX_PENDING_REQS]; struct gnttab_map_grant_ref tx_map_ops[MAX_PENDING_REQS]; struct gnttab_unmap_grant_ref tx_unmap_ops[MAX_PENDING_REQS]; /* passed to gnttab_[un]map_refs with pages under (un)mapping */ diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/ne= tback.c index 1b42676ca141..54c76af90233 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -334,6 +334,7 @@ static int xenvif_count_requests(struct xenvif_queue *q= ueue, struct xenvif_tx_cb { u16 copy_pending_idx[XEN_NETBK_LEGACY_SLOTS_MAX + 1]; u8 copy_count; + u32 split_mask; }; =20 #define XENVIF_TX_CB(skb) ((struct xenvif_tx_cb *)(skb)->cb) @@ -361,6 +362,10 @@ static inline struct sk_buff *xenvif_alloc_skb(unsigne= d int size) struct sk_buff *skb =3D alloc_skb(size + NET_SKB_PAD + NET_IP_ALIGN, GFP_ATOMIC | __GFP_NOWARN); + + BUILD_BUG_ON(sizeof(*XENVIF_TX_CB(skb)) > sizeof(skb->cb)); + BUILD_BUG_ON(sizeof(XENVIF_TX_CB(skb)->split_mask) * 8 < + ARRAY_SIZE(XENVIF_TX_CB(skb)->copy_pending_idx)); if (unlikely(skb =3D=3D NULL)) return NULL; =20 @@ -396,11 +401,13 @@ static void xenvif_get_requests(struct xenvif_queue *= queue, nr_slots =3D shinfo->nr_frags + 1; =20 copy_count(skb) =3D 0; + XENVIF_TX_CB(skb)->split_mask =3D 0; =20 /* Create copy ops for exactly data_len bytes into the skb head. */ __skb_put(skb, data_len); while (data_len > 0) { int amount =3D data_len > txp->size ? txp->size : data_len; + bool split =3D false; =20 cop->source.u.ref =3D txp->gref; cop->source.domid =3D queue->vif->domid; @@ -413,6 +420,13 @@ static void xenvif_get_requests(struct xenvif_queue *q= ueue, cop->dest.u.gmfn =3D virt_to_gfn(skb->data + skb_headlen(skb) - data_len); =20 + /* Don't cross local page boundary! */ + if (cop->dest.offset + amount > XEN_PAGE_SIZE) { + amount =3D XEN_PAGE_SIZE - cop->dest.offset; + XENVIF_TX_CB(skb)->split_mask |=3D 1U << copy_count(skb); + split =3D true; + } + cop->len =3D amount; cop->flags =3D GNTCOPY_source_gref; =20 @@ -420,7 +434,8 @@ static void xenvif_get_requests(struct xenvif_queue *qu= eue, pending_idx =3D queue->pending_ring[index]; callback_param(queue, pending_idx).ctx =3D NULL; copy_pending_idx(skb, copy_count(skb)) =3D pending_idx; - copy_count(skb)++; + if (!split) + copy_count(skb)++; =20 cop++; data_len -=3D amount; @@ -441,7 +456,8 @@ static void xenvif_get_requests(struct xenvif_queue *qu= eue, nr_slots--; } else { /* The copy op partially covered the tx_request. - * The remainder will be mapped. + * The remainder will be mapped or copied in the next + * iteration. */ txp->offset +=3D amount; txp->size -=3D amount; @@ -539,6 +555,13 @@ static int xenvif_tx_check_gop(struct xenvif_queue *qu= eue, pending_idx =3D copy_pending_idx(skb, i); =20 newerr =3D (*gopp_copy)->status; + + /* Split copies need to be handled together. */ + if (XENVIF_TX_CB(skb)->split_mask & (1U << i)) { + (*gopp_copy)++; + if (!newerr) + newerr =3D (*gopp_copy)->status; + } if (likely(!newerr)) { /* The first frag might still have this slot mapped */ if (i < copy_count(skb) - 1 || !sharedslot) --=20 2.35.3 From nobody Mon Apr 29 09:42:51 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 019AEC76196 for ; Tue, 28 Mar 2023 13:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233064AbjC1NNS (ORCPT ); Tue, 28 Mar 2023 09:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232952AbjC1NNF (ORCPT ); Tue, 28 Mar 2023 09:13:05 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D1268A62; Tue, 28 Mar 2023 06:13:04 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E146221A25; Tue, 28 Mar 2023 13:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680009182; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YW7EQFAaSbV1XiZ+rWOC33Mh7NdDO+nn7h2JPqjxGsU=; b=O/kjrp9uwhaX0UHcxnMEsib0oNTmVBstScUxSKkHjVOFyAM6ud1RCyuekMkZ36jQpPD1ZR DM6toj/Ixa4HrtnnqRELqKdV5fzFX7Xh5gXJKbQgznCMyUK/eCvzYBpBmemN5d0MS02eho LyrmFwNOmbYVjCPAQEH2c0kPLjUJMZE= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 98ADC1390D; Tue, 28 Mar 2023 13:13:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bIYXJN7nImRBTgAAMHmgww (envelope-from ); Tue, 28 Mar 2023 13:13:02 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Juergen Gross , Wei Liu , Paul Durrant , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , xen-devel@lists.xenproject.org, Jan Beulich Subject: [PATCH v2 2/3] xen/netback: remove not needed test in xenvif_tx_build_gops() Date: Tue, 28 Mar 2023 15:12:32 +0200 Message-Id: <20230328131233.2534-3-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230328131047.2440-1-jgross@suse.com> References: <20230328131047.2440-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The tests for the number of grant mapping or copy operations reaching the array size of the operations buffer at the end of the main loop in xenvif_tx_build_gops() isn't needed. The loop can handle at maximum MAX_PENDING_REQS transfer requests, as XEN_RING_NR_UNCONSUMED_REQUESTS() is taking unsent responses into consideration, too. Remove the tests. Suggested-by: Jan Beulich Signed-off-by: Juergen Gross Reviewed-by: Paul Durrant --- drivers/net/xen-netback/netback.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/ne= tback.c index 54c76af90233..9ca4b69d3b39 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -1084,10 +1084,6 @@ static void xenvif_tx_build_gops(struct xenvif_queue= *queue, __skb_queue_tail(&queue->tx_queue, skb); =20 queue->tx.req_cons =3D idx; - - if ((*map_ops >=3D ARRAY_SIZE(queue->tx_map_ops)) || - (*copy_ops >=3D ARRAY_SIZE(queue->tx_copy_ops))) - break; } =20 return; --=20 2.35.3 From nobody Mon Apr 29 09:42:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1680009213; cv=none; d=zohomail.com; s=zohoarc; b=gmQl/KMST7grEUycfQJve2ecOlPdWyDt8/T0bQdenMdAOUNYhncZBG0BG0LLBNa2KZXc8iler60Us1Yk53N73ATc8J5owa5nlJlpYlfJUXCWIZKGUzWuH49KToVYXi5oq7NEIkbmZkVEOtmpk0S0owmppwo5R+SoWFztQt6K1Xs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680009213; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e6vgelWHY1ROLaWG0osSVVXd0iuJBGBZOPQEJcLJre4=; b=DLsUm/sUnD3TzE6OCW3gpNra9cFKe1bFiKNoqpStsVjNiAFNpQrPqx5Nx/PpedHN9+AcbRtyychb2o/fYtEvjyGuGwVtXoUVJZgU3uPVTX+mhJIrWmdrWVWiSx/oZW/tz4uIGR1H4e4t5KOfuZj4ixDpYNKj0Pg6ijlwsx3FrLc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1680009213747408.0208038719678; Tue, 28 Mar 2023 06:13:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.515805.799010 (Exim 4.92) (envelope-from ) id 1ph98T-0006RD-1m; Tue, 28 Mar 2023 13:13:13 +0000 Received: by outflank-mailman (output) from mailman id 515805.799010; Tue, 28 Mar 2023 13:13:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ph98S-0006R0-VF; Tue, 28 Mar 2023 13:13:12 +0000 Received: by outflank-mailman (input) for mailman id 515805; Tue, 28 Mar 2023 13:13:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ph98Q-0005os-Ue for xen-devel@lists.xenproject.org; Tue, 28 Mar 2023 13:13:10 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [2001:67c:2178:6::1d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 48f0a444-cd6a-11ed-b464-930f4c7d94ae; Tue, 28 Mar 2023 15:13:09 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 26F491FD68; Tue, 28 Mar 2023 13:13:09 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CEEE21390D; Tue, 28 Mar 2023 13:13:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5g83MeTnImRMTgAAMHmgww (envelope-from ); Tue, 28 Mar 2023 13:13:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 48f0a444-cd6a-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680009189; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e6vgelWHY1ROLaWG0osSVVXd0iuJBGBZOPQEJcLJre4=; b=LFdM3W5zZdqeRLZgZr7qTz4F8ur5guOoVem4nRZ5tsOfJdaBCOsiQzafNzRFzubTv7yfyb feDgbHO21RGAggkFmlAu9qVgUNQwRwRcMSErkykvTj3OpSc/KPkMlv24EVnN1IiuN5l4HP lBHqk0bOEMYvh57nwqVONSIthXtdbiA= From: Juergen Gross To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Juergen Gross , Wei Liu , Paul Durrant , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , xen-devel@lists.xenproject.org, Jan Beulich Subject: [PATCH v2 3/3] xen/netback: use same error messages for same errors Date: Tue, 28 Mar 2023 15:12:33 +0200 Message-Id: <20230328131233.2534-4-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230328131047.2440-1-jgross@suse.com> References: <20230328131047.2440-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1680009215241100003 Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Juergen Gross --- 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/ne= tback.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, =20 /* 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; } --=20 2.35.3