[Devel] [PATCH RHEL7 COMMIT] ve/net/packet: show tx-ring warning only for host

Konstantin Khorenko khorenko at virtuozzo.com
Fri Mar 24 05:03:37 PDT 2017


The commit is pushed to "branch-rh7-3.10.0-514.10.2.vz7.29.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.10.2.vz7.29.6
------>
commit 2dd0ab0ab60be81e2354e22cbc4206d12ae2d89b
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Fri Mar 24 16:03:36 2017 +0400

    ve/net/packet: show tx-ring warning only for host
    
    Calling setsockopt(SOL_PACKET, PACKET_TX_RING) on TPACKET_V3 version
    fails with EINVAL and also generates these warning. That allows
    host log flood from CT, so do not show these warnings from inside CT.
    
    https://jira.sw.ru/browse/PSBM-56711
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 net/packet/af_packet.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index c15e57a..bc4a04e 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3818,7 +3818,9 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
 	lock_sock(sk);
 	/* Opening a Tx-ring is NOT supported in TPACKET_V3 */
 	if (!closing && tx_ring && (po->tp_version > TPACKET_V2)) {
-		WARN(1, "Tx-ring is not supported.\n");
+		/* Hide warnings initiated from CT */
+		if (ve_is_super(get_exec_env()))
+			WARN(1, "Tx-ring is not supported.\n");
 		goto out;
 	}
 


More information about the Devel mailing list