Re: [ovs-dev] [PATCH 3/3] rhel: Fix ifup and ifdown after DPDK naming change.

2017-02-14 Thread Aaron Conole
Daniele Di Proietto  writes:

> On 02/02/2017 12:48, "Ben Pfaff"  wrote:
>
>>On Tue, Jan 24, 2017 at 06:21:53PM -0800, Daniele Di Proietto wrote:
>>> Names like dpdk0 and dpdk1 are not enough to identify a DPDK interface.
>>> We could update README.RHEL.rst and add
>>> 
>>> OVS_EXTRA='set Interface ${DEVICE} options:dpdk-devargs=:01:00.0'
>>> 
>>> but a better solution is to add new parameters in the configuration file
>>> to explicitly specify the dpdk-devargs.
>>> 
>>> Fixes: 55e075e65ef9("netdev-dpdk: Arbitrary 'dpdk' port naming")
>>> Signed-off-by: Daniele Di Proietto 
>>
>>This seems useful.
>
> Hi Ben,
>
> thanks for looking at this one and sorry for the delay.
>
>
>>
>>I don't understand why this uses "set" then $1.  Are you concerned that
>>BOND_DPDK_DEVARGS might have multiple words and you want to get just the
>>first one?
>
> Now for each interface we need to specify two parameters: the name (it is
> chosen by the user and it can be arbitrary) and the devargs (most likely the
> PCI address).
>
> With this patch the user enters the names in BOND_IFACES and the devargs in
> BOND_DPDK_DEVARGS.
>
> set -- ${BOND_DPDK_DEVARGS}
> for _iface in ${BOND_IFACE}; do
> echo $_iface $1
> shift
> done
>
> is a quick and dirty way to iterate through both lists in the same loop.
>
> Or maybe we could change the interface to specify in the same list the
> name and the devargs.
>
> Aaron, since you were looking at this as well, do you have any preference
> on the user interface?

I don't have a preference, but I think typically put OVS_ in front of
variables in the ifcfg-* files.

Otherwise, ACK

> Thanks,
>
> Daniele
>
>>
>>> OVSDPDKBond)
>>> ifup_ovs_bridge
>>> +   set -- ${BOND_DPDK_DEVARGS}
>>> for _iface in $BOND_IFACES; do
>>> -   IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} 
>>> type=dpdk"
>>> +   IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} 
>>> type=dpdk options:dpdk-devargs=$1"
>>> +   shift
>>> done
>>> ovs-vsctl -t ${TIMEOUT} \
>>> -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 3/3] rhel: Fix ifup and ifdown after DPDK naming change.

2017-02-10 Thread Daniele Di Proietto





On 02/02/2017 12:48, "Ben Pfaff"  wrote:

>On Tue, Jan 24, 2017 at 06:21:53PM -0800, Daniele Di Proietto wrote:
>> Names like dpdk0 and dpdk1 are not enough to identify a DPDK interface.
>> We could update README.RHEL.rst and add
>> 
>> OVS_EXTRA='set Interface ${DEVICE} options:dpdk-devargs=:01:00.0'
>> 
>> but a better solution is to add new parameters in the configuration file
>> to explicitly specify the dpdk-devargs.
>> 
>> Fixes: 55e075e65ef9("netdev-dpdk: Arbitrary 'dpdk' port naming")
>> Signed-off-by: Daniele Di Proietto 
>
>This seems useful.

Hi Ben,

thanks for looking at this one and sorry for the delay.


>
>I don't understand why this uses "set" then $1.  Are you concerned that
>BOND_DPDK_DEVARGS might have multiple words and you want to get just the
>first one?

Now for each interface we need to specify two parameters: the name (it is
chosen by the user and it can be arbitrary) and the devargs (most likely the
PCI address).

With this patch the user enters the names in BOND_IFACES and the devargs in
BOND_DPDK_DEVARGS.

set -- ${BOND_DPDK_DEVARGS}
for _iface in ${BOND_IFACE}; do
echo $_iface $1
shift
done

is a quick and dirty way to iterate through both lists in the same loop.

Or maybe we could change the interface to specify in the same list the
name and the devargs.

Aaron, since you were looking at this as well, do you have any preference
on the user interface?

Thanks,

Daniele

>
>>  OVSDPDKBond)
>>  ifup_ovs_bridge
>> +set -- ${BOND_DPDK_DEVARGS}
>>  for _iface in $BOND_IFACES; do
>> -IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} 
>> type=dpdk"
>> +IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} 
>> type=dpdk options:dpdk-devargs=$1"
>> +shift
>>  done
>>  ovs-vsctl -t ${TIMEOUT} \
>>  -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 3/3] rhel: Fix ifup and ifdown after DPDK naming change.

2017-02-02 Thread Ben Pfaff
On Tue, Jan 24, 2017 at 06:21:53PM -0800, Daniele Di Proietto wrote:
> Names like dpdk0 and dpdk1 are not enough to identify a DPDK interface.
> We could update README.RHEL.rst and add
> 
> OVS_EXTRA='set Interface ${DEVICE} options:dpdk-devargs=:01:00.0'
> 
> but a better solution is to add new parameters in the configuration file
> to explicitly specify the dpdk-devargs.
> 
> Fixes: 55e075e65ef9("netdev-dpdk: Arbitrary 'dpdk' port naming")
> Signed-off-by: Daniele Di Proietto 

This seems useful.

I don't understand why this uses "set" then $1.  Are you concerned that
BOND_DPDK_DEVARGS might have multiple words and you want to get just the
first one?

>   OVSDPDKBond)
>   ifup_ovs_bridge
> + set -- ${BOND_DPDK_DEVARGS}
>   for _iface in $BOND_IFACES; do
> - IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} 
> type=dpdk"
> + IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} 
> type=dpdk options:dpdk-devargs=$1"
> + shift
>   done
>   ovs-vsctl -t ${TIMEOUT} \
>   -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 3/3] rhel: Fix ifup and ifdown after DPDK naming change.

2017-01-24 Thread Daniele Di Proietto
Names like dpdk0 and dpdk1 are not enough to identify a DPDK interface.
We could update README.RHEL.rst and add

OVS_EXTRA='set Interface ${DEVICE} options:dpdk-devargs=:01:00.0'

but a better solution is to add new parameters in the configuration file
to explicitly specify the dpdk-devargs.

Fixes: 55e075e65ef9("netdev-dpdk: Arbitrary 'dpdk' port naming")
Signed-off-by: Daniele Di Proietto 
---
 rhel/README.RHEL.rst| 13 +
 rhel/etc_sysconfig_network-scripts_ifup-ovs |  6 --
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/rhel/README.RHEL.rst b/rhel/README.RHEL.rst
index afccf1703..af4589325 100644
--- a/rhel/README.RHEL.rst
+++ b/rhel/README.RHEL.rst
@@ -266,14 +266,16 @@ DPDK NIC port:
 
 ::
 
-==> ifcfg-dpdk0 <==
-DPDK vhost-user port:
-DEVICE=dpdk0
+==> ifcfg-mydpdk0 <==
+DEVICE=mydpdk0
+DPDK_DEVARGS=":01:00.0"
 ONBOOT=yes
 DEVICETYPE=ovs
 TYPE=OVSDPDKPort
 OVS_BRIDGE=obr0
 
+DPDK vhost-user port:
+
 ::
 
 ==> ifcfg-vhu0 <==
@@ -283,6 +285,8 @@ DPDK NIC port:
 TYPE=OVSDPDKVhostUserPort
 OVS_BRIDGE=obr0
 
+DPDK bond:
+
 ::
 
 ==> ifcfg-bond0 <==
@@ -292,7 +296,8 @@ DPDK NIC port:
 TYPE=OVSDPDKBond
 OVS_BRIDGE=ovsbridge0
 BOOTPROTO=none
-BOND_IFACES="dpdk0 dpdk1"
+BOND_IFACES="mydpdk0 mydpdk1"
+BOND_DPDK_DEVARGS=":01:00.0 :06:00.0"
 OVS_OPTIONS="bond_mode=active-backup"
 HOTPLUG=no
 
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs 
b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index e49e6fe71..8fe60fcb1 100755
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
@@ -170,7 +170,7 @@ case "$TYPE" in
ovs-vsctl -t ${TIMEOUT} \
-- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
-- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \
-   -- set Interface "$DEVICE" type=dpdk ${OVS_EXTRA+-- 
$OVS_EXTRA}
+   -- set Interface "$DEVICE" type=dpdk 
options:dpdk-devargs="${DPDK_DEVARGS}" ${OVS_EXTRA+-- $OVS_EXTRA}
;;
OVSDPDKRPort)
ifup_ovs_bridge
@@ -188,8 +188,10 @@ case "$TYPE" in
;;
OVSDPDKBond)
ifup_ovs_bridge
+   set -- ${BOND_DPDK_DEVARGS}
for _iface in $BOND_IFACES; do
-   IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} 
type=dpdk"
+   IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} 
type=dpdk options:dpdk-devargs=$1"
+   shift
done
ovs-vsctl -t ${TIMEOUT} \
-- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
-- 
2.11.0

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev