Re: [PATCH v2 iproute2-next 1/2] m_vlan: add pop_eth and push_eth actions

2020-10-22 Thread Guillaume Nault
On Thu, Oct 22, 2020 at 08:11:45AM -0600, David Ahern wrote: > On 10/22/20 2:36 AM, Guillaume Nault wrote: > > > >> Is it time to use full string compare for these options? > > > > If there's consensus that matches() should be avoided for new options, > > I'll also follow up on this and replace i

Re: [PATCH v2 iproute2-next 1/2] m_vlan: add pop_eth and push_eth actions

2020-10-22 Thread David Ahern
On 10/22/20 2:36 AM, Guillaume Nault wrote: > >> Is it time to use full string compare for these options? > > If there's consensus that matches() should be avoided for new options, > I'll also follow up on this and replace it with strcmp(). However, that > should be a clear project-wide policy IM

Re: [PATCH v2 iproute2-next 1/2] m_vlan: add pop_eth and push_eth actions

2020-10-22 Thread Guillaume Nault
On Wed, Oct 21, 2020 at 11:32:34AM -0700, Stephen Hemminger wrote: > On Mon, 19 Oct 2020 17:23:01 +0200 > Guillaume Nault wrote: > > > + } else if (matches(*argv, "pop_eth") == 0) { > > Using matches allows for shorter command lines but can be make > for bad user experience if strings

Re: [PATCH v2 iproute2-next 1/2] m_vlan: add pop_eth and push_eth actions

2020-10-21 Thread David Ahern
On 10/21/20 12:32 PM, Stephen Hemminger wrote: > On Mon, 19 Oct 2020 17:23:01 +0200 > Guillaume Nault wrote: > >> +} else if (matches(*argv, "pop_eth") == 0) { > > Using matches allows for shorter command lines but can be make > for bad user experience if strings overlap. > > For ex

Re: [PATCH v2 iproute2-next 1/2] m_vlan: add pop_eth and push_eth actions

2020-10-21 Thread Stephen Hemminger
On Mon, 19 Oct 2020 17:23:01 +0200 Guillaume Nault wrote: > + } else if (matches(*argv, "pop_eth") == 0) { Using matches allows for shorter command lines but can be make for bad user experience if strings overlap. For example 'p' here will match the pop_eth and not the push_eth. Is

[PATCH v2 iproute2-next 1/2] m_vlan: add pop_eth and push_eth actions

2020-10-19 Thread Guillaume Nault
Add support for the new TCA_VLAN_ACT_POP_ETH and TCA_VLAN_ACT_PUSH_ETH actions (kernel commit 19fbcb36a39e ("net/sched: act_vlan: Add {POP,PUSH}_ETH actions"). These action let TC remove or add the Ethernet at the head of a frame. Drop an Ethernet header: # tc filter add dev ethX matchall action