From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH iproute2] ss: Tell user about -EOPNOTSUPP for SOCK_DESTROY Date: Wed, 18 May 2016 22:05:55 -0600 Message-ID: <7b91db2e-9e27-48e3-e080-00037bc1a9c3@cumulusnetworks.com> References: <1463442791-2399-1-git-send-email-dsa@cumulusnetworks.com> <1463442791-2399-2-git-send-email-dsa@cumulusnetworks.com> <39db6a27-9dfa-1c9a-2699-2f01a0e64a66@cumulusnetworks.com> <3d0fd83a-fa88-8ceb-a44d-237f5a005eb4@cumulusnetworks.com> <4ca62c9f-4d19-4dd1-0d8c-c2cfe17c0443@cumulusnetworks.com> <1463629667.18194.150.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Lorenzo Colitti , Subash Abhinov Kasiviswanathan , Stephen Hemminger , "netdev@vger.kernel.org" , netdev-owner@vger.kernel.org, David Miller , =?UTF-8?Q?Maciej_=c5=bbenczykowski?= , Tom Herbert To: Eric Dumazet Return-path: Received: from mail-io0-f179.google.com ([209.85.223.179]:35683 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbcESEF7 (ORCPT ); Thu, 19 May 2016 00:05:59 -0400 Received: by mail-io0-f179.google.com with SMTP id p64so413148ioi.2 for ; Wed, 18 May 2016 21:05:59 -0700 (PDT) In-Reply-To: <1463629667.18194.150.camel@edumazet-glaptop3.roam.corp.google.com> Sender: netdev-owner@vger.kernel.org List-ID: On 5/18/16 9:47 PM, Eric Dumazet wrote: > On Wed, 2016-05-18 at 21:02 -0600, David Ahern wrote: >> On 5/18/16 6:55 PM, Lorenzo Colitti wrote: >>> On Wed, May 18, 2016 at 3:35 AM, wrote: >>>> Would it be acceptable to have a separate column which displays the result of the sock destroy operation per socket. >>>> State ... Killed >>>> ESTAB Y >>>> TIME_WAIT N >>> >>> Fine by me, but... what problem are we trying to address? People who >>> compile their own kernels and don't turn CONFIG_INET_DIAG_DESTROY, and >>> then are confused why it doesn't work? Seems like we could fix that by >>> turning CONFIG_INET_DIAG_DESTROY on by default. CCing the people who >>> commented on the original SOCK_DESTROY patch to see if they have >>> opinions. >> >> The problem is proper feedback to a user. If the kernel supports an >> action but the action is not enabled the user should get some message to >> that fact. Doing nothing and exiting 0 is just wrong. > > So, lets say the filter found 123456 sockets matching the filter, and > 12345 could be killed > > What would be exit status of ss command ? Again, I could care less if the exit status is 0 if the user is given "A request failed b/c operations is not supported" message. That is feedback. > > In this case, there is no black/white answer. > > It looks like you have specific needs, you should probably add an option > to ss to have a specific behavior. > > But saying current behavior is 'wrong' is subjective. You think it is ok to send a request to the kernel, the kernel says "I can't do it" and the command says nothing to the user? That is current behavior. How on Earth is that acceptable? I believe my last proposal is that that user gets a single "I could not do what you asked" message and nice little summary: N sockets closed M sockets failed If M = total number of sockets then perhaps there is a bigger problem -- like a config option is not enabled.